mirror of
https://github.com/debauchee/barrier.git
synced 2025-06-17 18:21:41 +02:00
merge 1.4 r887:888 into trunk
This commit is contained in:
parent
76c47c2346
commit
cc520f08d8
10 changed files with 360 additions and 119 deletions
17
hm.py
17
hm.py
|
@ -30,9 +30,13 @@
|
|||
# This will create an in-source UNIX Makefile.
|
||||
|
||||
import sys, os
|
||||
from build import commands
|
||||
from build import toolchain
|
||||
from getopt import gnu_getopt
|
||||
|
||||
# minimum required version
|
||||
requiredMajor = 2
|
||||
requiredMinor = 3
|
||||
|
||||
# options used by all commands
|
||||
global_options = 'g:v'
|
||||
global_options_long = ['no-prompts', 'generator=', 'verbose', 'make-gui']
|
||||
|
@ -59,6 +63,7 @@ cmd_opt_dict = {
|
|||
'revision' : ['', []],
|
||||
'reformat' : ['', []],
|
||||
'open' : ['', []],
|
||||
'genlist' : ['', []]
|
||||
}
|
||||
|
||||
# aliases to valid commands
|
||||
|
@ -171,7 +176,7 @@ def run_cmd(cmd, argv = []):
|
|||
|
||||
# pass args and optarg data to command handler, which figures out
|
||||
# how to handle the arguments
|
||||
handler = commands.CommandHandler(argv, opts, args, verbose)
|
||||
handler = toolchain.CommandHandler(argv, opts, args, verbose)
|
||||
|
||||
# use reflection to get the function pointer
|
||||
cmd_func = getattr(handler, cmd)
|
||||
|
@ -181,15 +186,17 @@ def run_cmd(cmd, argv = []):
|
|||
if not verbose:
|
||||
# print friendly error for users
|
||||
sys.stderr.write('Error: ' + sys.exc_info()[1].__str__() + '\n')
|
||||
exit(1)
|
||||
sys.exit(1)
|
||||
else:
|
||||
# if user wants to be verbose let python do it's thing
|
||||
raise
|
||||
|
||||
def main(argv):
|
||||
|
||||
if sys.version_info < (2, 4):
|
||||
print 'Python version must be at least: 2.4'
|
||||
if sys.version_info < (requiredMajor, requiredMinor):
|
||||
print ('Python version must be at least ' +
|
||||
str(requiredMajor) + '.' + str(requiredMinor) + ', but is ' +
|
||||
str(sys.version_info[0]) + '.' + str(sys.version_info[1]))
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue