diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-04-13 21:16:12 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-04-13 21:16:12 +0200 |
commit | eeb9927c89d6d2425a74c33ff8773bceba39af1c (patch) | |
tree | e5e770fc041fa27b6e13a78dc9c3dc3f75c7c213 /pyevenja.py | |
parent | 99561b834dbd9d52b83aa7b0fb980431fa1aa056 (diff) | |
download | pyevenja-master.zip pyevenja-master.tar.gz |
Diffstat (limited to 'pyevenja.py')
-rw-r--r-- | pyevenja.py | 166 |
1 files changed, 83 insertions, 83 deletions
diff --git a/pyevenja.py b/pyevenja.py index 9fcc574..1a2b6b4 100644 --- a/pyevenja.py +++ b/pyevenja.py @@ -41,97 +41,97 @@ vers = '0.0.9' #---------------------------------------------------------------------------- def usage(name): - print 'usage :'+name+' ['+shorts+'] xml_file' - print ' h - help' - print ' v - version' - print ' t - trace\tfstarter.execute() will print all received messages' - print ' c - compile\tclean and rebuild files' + print 'usage :'+name+' ['+shorts+'] xml_file' + print ' h - help' + print ' v - version' + print ' t - trace\tfstarter.execute() will print all received messages' + print ' c - compile\tclean and rebuild files' #---------------------------------------------------------------------------- def version(name): - print(name+', version '+str(vers)) - print 'written by jeremy zurcher tzurtch@bluemail.ch' - print 'stolen from evenja-2.9.72-beta1, written by Fabian Padilla fp@bridgethink.com' - print '''\nthis version should be ok, but isn't written in "pure" python style ;))''' - print 'the work is in progress ...' + print(name+', version '+str(vers)) + print 'written by jeremy zurcher tzurtch@bluemail.ch' + print 'stolen from evenja-2.9.72-beta1, written by Fabian Padilla fp@bridgethink.com' + print '''\nthis version should be ok, but isn't written in "pure" python style ;))''' + print 'the work is in progress ...' + - #---------------------------------------------------------------------------- def main(): - path,name=os.path.split(sys.argv[0]) - trace = False - try: - opts,args = getopt.getopt(sys.argv[1:],shorts,longs) - except getopt.GetoptError: - print('try '+name+' --help') - sys.exit(0) - - for opt,arg in opts: - if opt in ('-'+shorts[0],'--'+longs[0]): - usage(name) - sys.exit(0) - if opt in ('-'+shorts[1],'--'+longs[1]): - version(name) - sys.exit(0) - if opt in ('-'+shorts[2],'--'+longs[2]): - trace = True - if opt in ('-'+shorts[3],'--'+longs[3]): - L=[ 'OSconfig.py',\ - 'OSlinux.py',\ - 'evenjastrings.py',\ - 'fconfig.py',\ - 'fdoor_cout.py',\ - 'fdoor_file.py',\ - 'fevendoor.py',\ - 'fevenboard.py',\ - 'fevendata.py',\ - 'fevenprg.py',\ - 'flist.py',\ - 'flisthash.py',\ - 'fport.py',\ - 'fportbkpevendata.py',\ - 'fportlist.py',\ - 'fportlisthash.py',\ - 'fposition.py',\ - 'fprg_concat.py',\ - 'frouter.py',\ - 'fstarter.py',\ - 'fstringhash.py',\ - 'fviewer.py',\ - 'globalvars.py',\ - 'returncodes.py'] - if sys.platform != 'linux2': - print "Would you please install an acceptable OS, thanks." - os.system('rm *.pyc *.pyo 2>/dev/null') - for I in L: - print 'python -O -W all '+I - os.system('python -O -W all '+I) - sys.exit(0) - - if not args: - usage(name) - sys.exit(1) - - # here we go ... with this buggy verion ... - - starter = Fstarter() - - if starter: - ret = starter.start(args[0]) - if ret == RET_OK: - starter.execute(trace) # launch the stuff - ret = starter.end() # for dynamc configuration - else: - print "can't start the starter *sigh*" - sys.exit(-1) - else: - print "can't instanciate the starter ... really bad !!!!" - sys.exit(-1) - sys.exit(0) - + path,name=os.path.split(sys.argv[0]) + trace = False + try: + opts,args = getopt.getopt(sys.argv[1:],shorts,longs) + except getopt.GetoptError: + print('try '+name+' --help') + sys.exit(0) + + for opt,arg in opts: + if opt in ('-'+shorts[0],'--'+longs[0]): + usage(name) + sys.exit(0) + if opt in ('-'+shorts[1],'--'+longs[1]): + version(name) + sys.exit(0) + if opt in ('-'+shorts[2],'--'+longs[2]): + trace = True + if opt in ('-'+shorts[3],'--'+longs[3]): + L=[ 'OSconfig.py',\ + 'OSlinux.py',\ + 'evenjastrings.py',\ + 'fconfig.py',\ + 'fdoor_cout.py',\ + 'fdoor_file.py',\ + 'fevendoor.py',\ + 'fevenboard.py',\ + 'fevendata.py',\ + 'fevenprg.py',\ + 'flist.py',\ + 'flisthash.py',\ + 'fport.py',\ + 'fportbkpevendata.py',\ + 'fportlist.py',\ + 'fportlisthash.py',\ + 'fposition.py',\ + 'fprg_concat.py',\ + 'frouter.py',\ + 'fstarter.py',\ + 'fstringhash.py',\ + 'fviewer.py',\ + 'globalvars.py',\ + 'returncodes.py'] + if sys.platform != 'linux2': + print "Would you please install an acceptable OS, thanks." + os.system('rm *.pyc *.pyo 2>/dev/null') + for I in L: + print 'python -O -W all '+I + os.system('python -O -W all '+I) + sys.exit(0) + + if not args: + usage(name) + sys.exit(1) + + # here we go ... with this buggy verion ... + + starter = Fstarter() + + if starter: + ret = starter.start(args[0]) + if ret == RET_OK: + starter.execute(trace) # launch the stuff + ret = starter.end() # for dynamc configuration + else: + print "can't start the starter *sigh*" + sys.exit(-1) + else: + print "can't instanciate the starter ... really bad !!!!" + sys.exit(-1) + sys.exit(0) + #---------------------------------------------------------------------------- if __name__=='__main__': - main() + main() |