def main(): """ """ name = "MS287server" p = initiate_option_parser("""Pyro server for MS287 IF switch.""", examples) # Add other options here args = p.parse_args(sys.argv[1:]) # This cannot be delegated to another module or class mylogger = init_logging(logging.getLogger(), loglevel=get_loglevel(args.file_loglevel), consolevel=get_loglevel(args.console_loglevel), logname=args.logpath + name + ".log") mylogger.debug(" Handlers: %s", mylogger.handlers) loggers = set_module_loggers(eval(args.modloglevels)) psl = PyroServerLauncher(name, nameserver_host='dto') IFsw = MS287_Server() psl.start(IFsw) psl.finish()
'--date', dest='date', type=str, default=None, help='last date to process (default: yesterday)') p.add_argument('-n', '--no_dry_run', dest='dry_run', action='store_false', default=True, help='last date to process (default: yesterday)') p.add_argument('-p', '--projects', dest='projects_str', type=str, default='FREGGS,ISM_RRL', help='comma-separated list of projects') args = p.parse_args() logging.basicConfig(level=logging.INFO) mylogger = init_logging(logging.getLogger(), loglevel=get_loglevel(args.file_loglevel), consolevel=get_loglevel(args.console_loglevel), logname=args.logpath + "autoWVSR2FITS.log") mylogger.debug(" Handlers: %s", mylogger.handlers) loggers = set_module_loggers(eval(args.modloglevels)) do = WVSR_to_FITS(projects=args.projects_str.split(',')) do.prepare_jobs() do.launch_jobs() print do.check_outputs()
}) from optparse import OptionParser p = OptionParser() p.set_usage(__name__ + ' [options]') p.set_description(__doc__) p.add_option('-l', '--log_level', dest='loglevel', type='str', default='info', help='Logging level for main program and modules') opts, args = p.parse_args(sys.argv[1:]) set_loglevel(mylogger, get_loglevel(opts.loglevel)) # Set the module logger levels no lower than my level. for lgr in loggers.keys(): if loggers[lgr].level < mylogger.level: loggers[lgr].setLevel(mylogger.level) mylogger.info("%s logger level is %s", lgr, loggers[lgr].level) # overrides pyro_support trace level Pyro.config.PYRO_TRACELEVEL = 3 # Is there a Pyro server running? # if is_running("pyro-ns") == False: locator = Pyro.naming.NameServerLocator() mylogger.debug("Using locator %s", locator) # is this necessary?
'--dss', dest='dss', type=int, default=43, help='DSN station number') p.add_argument('-p', '--project', dest='project', type=str, default='67P', help="Project code") args = p.parse_args() mylogger = logging.getLogger() # change default console logging if get_loglevel(args.console_loglevel) > get_loglevel("info"): loglevel = "info" else: loglevel = args.console_loglevel init_logging(mylogger, loglevel=get_loglevel(args.file_loglevel), consolevel=get_loglevel(loglevel), logname=args.logpath + "TidTipAnalyzer.log") mylogger.debug("dss43-tipping args: %s", args) # object for analyzing tipping data finder = TidTipFinder(date=args.date) # object for creating table ptm = TipTableMaker(args.dss, finder.year, finder.DOY, finder.datefiles)