def main(): cmdargv=list(sys.argv[1:]) cfg='' if '--config' in cmdargv: i=cmdargv.index('--config') if len(cmdargv)>i+1: cfg=cmdargv[i+1] del cmdargv[i] else: print 'Warning: config file is not given after option --config' del cmdargv[i] if cfg=='': cfg=os.path.join(get_main_dir(),OMCED_CONFIG_FILE) argv=sys.argv[0:1]+['--Q']+ReadOptionFile(cfg) argv = argv + cmdargv pidfile = open(OMCED_PID_FILE, 'w') pidfile.write("%s" % os.getpid()) pidfile.write("%s" % os.getcwd()) ExitCode=run_main(ServerMain,argv,False) return ExitCode
yl=r'%phi% in %unit-1%' else: yl=r'phi(%sym%) in (%unit%)^-1' else: yl='%phi%' ax.set_ylabel(VarConv(opts,D,yl),size=opts['-yls']) for tick in ax.xaxis.get_major_ticks(): tick.label1.set_fontsize(opts['-xts']) for tick in ax.yaxis.get_major_ticks(): tick.label1.set_fontsize(opts['-yts']) if not (pp is None): pp.savefig(fig) if (rs.rowcount>0) and (opts['-pdf']==0): plt.show() if not (pp is None): pp.close() m='[1-%d]' % plotcount PRINT(MSG(107,m,opts['-fo']),VL_Default) return def MAIN(argv): filename,options,params=InitStdMainSingle(argv,__MODID__,__AUTHOR__) Viewer(filename,options) return if __name__=="__main__": DefConText.StopQueue() ExitCode=run_main(MAIN,sys.argv) sys.exit(ExitCode) #{EOF]
else: msg[1][0]='' for prm in oo: DefConText.PRINT(DefConText.MSG(102,prm),VL_Warn) wf=False for prm in sys.argv[1:]: if not (re.match('^-(?!-).*',prm) is None): wf=True if wf: DefConText.PRINT(DefConText.MSG(103,prm),VL_Warn) StartServer(port,ar,host,fork,quiet,vdbn,tls) return def ScanUserInput(): while True: try: c=sys.stdin.read(1) if ord(c)==3: OMCEService.Server.close() break except: break if __name__=="__main__": Thd=THG.Thread(target=ScanUserInput) Thd.daemon=True Thd.start() ExitCode=run_main(ServerMain,sys.argv,True) sys.exit(ExitCode)