def main(): options.parse_command_line() aps = AgpsServer(options.options.conf) try: logging.info("[AGPS] running on localhost.") aps.start() except KeyboardInterrupt: logging.error("[AGPS] Ctrl-C is pressed.") except: logging.exception("[AGPS] Exit Exception") finally: logging.warn("[AGPS] shutdown...") aps.stop() logging.warn("[AGPS] stopped. Bye!")
def main(): define("console", default=False, type=bool) define("mongo_host", default='localhost') parse_command_line() fetch_extended(options.mongo_host)