Ejemplo n.º 1
0
    from common import utils

    utils.get_cfg_dir(create=True)

    from common.application import Application
    from application.application_impl import ApplicationImpl
    from common.logging_setup import logging_setup

    args = sys.argv[1:]
    # Parse command line arguments
    args = parseArgs(args)

    from application.utils import check_sync_folder_removed, logging_enabled

    if not check_sync_folder_removed():
        if logging_enabled():
            # As side-effect creates cfg dir here
            logging_setup(loglevel=args['loglevel'], copies_logging=False)
        else:
            args['logging_disabled'] = True
    else:
        args['sync_folder_removed'] = True

    # To terminate from console with Ctrl+C
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    Application.set_instance_class(ApplicationImpl)
    Application.start(args)

    print('Exited')
Ejemplo n.º 2
0
            pid = os.getppid()
        else:
            pid = os.getpid()
    #fh.set_process_id(pid)

    # for multiprocessing under build pyinstaller
    multiprocessing.freeze_support()

    args = sys.argv[1:]
    # Parse command line arguments
    args = parseArgs(args)

    if not 'logging_disabled' in args or not args['logging_disabled']:
        # As side-effect creates cfg dir here
        try:
            logging_setup(loglevel=args['loglevel'])
        except FileNotFoundError as e:
            print("Error. Config not found.")
            raise SystemExit(0)

        # Set webrtc loglevel
        loglevel = getattr(WebRtc, args['webrtc_loglevel'])
        WebRtc.set_log_level(loglevel)
    # To terminate from console with Ctrl+C
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    Application.set_instance_class(ApplicationService)
    Application.start(args)

    print('Exited')