MCPcopy Create free account
hub / github.com/ehForwarderBot/ehForwarderBot / main

Function main

ehforwarderbot/__main__.py:306–343  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

304
305
306def main():
307 args = parser.parse_args()
308
309 if getattr(args, "version", None):
310 return print_versions(args)
311
312 if args.trace_threads:
313 try:
314 import hanging_threads
315 global trace_threads
316 trace_threads = True
317 except ModuleNotFoundError:
318 print(_(
319 "Required dependencies are not found. Please install them with "
320 "the following command:"
321 ))
322 print()
323 print(f" ${sys.executable} -m pip install 'ehforwarderbot[trace]'")
324 print()
325 exit(1)
326
327 if args.profile:
328 coordinator.profile = str(args.profile)
329
330 conf = config.load_config()
331
332 setup_logging(args, conf)
333 setup_telemetry(conf['telemetry'])
334
335 init(conf)
336
337 # Only register graceful stop signals when we are ready to start
338 # polling threads.
339 atexit.register(stop_gracefully)
340 signal.signal(signal.SIGTERM, stop_gracefully)
341 signal.signal(signal.SIGINT, stop_gracefully)
342
343 poll()
344
345
346if __name__ == '__main__':

Callers 1

__main__.pyFile · 0.70

Calls 6

print_versionsFunction · 0.85
setup_loggingFunction · 0.85
setup_telemetryFunction · 0.85
initFunction · 0.85
pollFunction · 0.85
load_configMethod · 0.80

Tested by

no test coverage detected