def initialize(): args = arguments.parse_user_agent_args() logger.init(debug=args.debug) resource = RootResource() start_site(args, resource) deferred = initialize_leap(args.leap_provider_cert, args.leap_provider_cert_fingerprint, args.credentials_file, args.organization_mode, args.leap_home) deferred.addCallback( lambda leap_session: start_user_agent( resource, args.leap_home, leap_session)) def _quit_on_error(failure): failure.printTraceback() reactor.stop() def _register_shutdown_on_token_expire(leap_session): register(events.SOLEDAD_INVALID_AUTH_TOKEN, lambda _: reactor.stop()) return leap_session deferred.addCallback(_register_shutdown_on_token_expire) deferred.addErrback(_quit_on_error) reactor.run()
def initialize(): args = arguments.parse_user_agent_args() logger.init(debug=args.debug) loading_app = reactor.listenTCP(args.port, Site(LoadingResource()), interface=args.host) deferred = deferToThread( lambda: initialize_leap( args.leap_provider_cert, args.leap_provider_cert_fingerprint, args.credentials_file, args.organization_mode, args.leap_home)) deferred.addCallback( lambda leap_session: start_user_agent( loading_app, args.host, args.port, args.sslkey, args.sslcert, args.leap_home, leap_session)) def _quit_on_error(failure): failure.printTraceback() reactor.stop() deferred.addErrback(_quit_on_error) reactor.run()
def initialize(): args = arguments.parse_user_agent_args() logger.init(debug=args.debug) resource = RootResource() start_site(args, resource) deferred = initialize_leap(args.leap_provider_cert, args.leap_provider_cert_fingerprint, args.credentials_file, args.organization_mode, args.leap_home) deferred.addCallback(lambda leap_session: start_user_agent( resource, args.leap_home, leap_session)) def _quit_on_error(failure): failure.printTraceback() reactor.stop() def _register_shutdown_on_token_expire(leap_session): register(events.SOLEDAD_INVALID_AUTH_TOKEN, lambda _: reactor.stop()) return leap_session deferred.addCallback(_register_shutdown_on_token_expire) deferred.addErrback(_quit_on_error) reactor.run()
def initialize(): args = arguments.parse_user_agent_args() logger.init(debug=args.debug) loading_app = reactor.listenTCP(args.port, Site(LoadingResource()), interface=args.host) deferred = initialize_leap(args.leap_provider_cert, args.leap_provider_cert_fingerprint, args.credentials_file, args.organization_mode, args.leap_home) deferred.addCallback( lambda leap_session: start_user_agent( loading_app, args.host, args.port, args.sslkey, args.sslcert, args.leap_home, leap_session)) def _quit_on_error(failure): failure.printTraceback() reactor.stop() deferred.addErrback(_quit_on_error) reactor.run()
def initialize(): logger_config.init(debug=False) args = arguments.parse_register_args() register( args.provider, args.username, args.leap_home, args.leap_provider_cert, args.leap_provider_cert_fingerprint)
def initialize(): log.info('Starting the Pixelated user agent') args = arguments.parse_user_agent_args() logger.init(debug=args.debug) services_factory = _create_service_factory(args) resource = RootResource(services_factory) start_async = _start_mode(args, resource, services_factory) add_top_level_system_callbacks(start_async, services_factory) log.info('Running the reactor') reactor.run()
def initialize(): log.info('Starting the Pixelated user agent') args = arguments.parse_user_agent_args() logger.init(debug=args.debug) services_factory = _create_service_factory(args) resource = RootResource(services_factory) def start(): start_async = _start_mode(args, resource, services_factory) add_top_level_system_callbacks(start_async, services_factory) log.info('Running the reactor') reactor.callWhenRunning(start) reactor.run()
def initialize(): args = arguments.parse_maintenance_args() logger.init(debug=args.debug) leap_session = initialize_leap( args.leap_provider_cert, args.leap_provider_cert_fingerprint, args.credentials_file, organization_mode=False, leap_home=args.leap_home) execute_command = create_execute_command(args, leap_session) reactor.callWhenRunning(execute_command) reactor.run()
def initialize(): args = arguments.parse_maintenance_args() logger.init(debug=args.debug) @defer.inlineCallbacks def _run(): leap_session = yield initialize_leap_single_user( args.leap_provider_cert, args.leap_provider_cert_fingerprint, args.credentials_file, leap_home=args.leap_home) execute_command(args, leap_session) reactor.callWhenRunning(_run) reactor.run()
def initialize(): args = arguments.parse_maintenance_args() logger.init(debug=args.debug) @defer.inlineCallbacks def _run(): leap_session = yield initialize_leap( args.leap_provider_cert, args.leap_provider_cert_fingerprint, args.credentials_file, organization_mode=False, leap_home=args.leap_home, initial_sync=_do_initial_sync(args)) execute_command(args, leap_session) reactor.callWhenRunning(_run) reactor.run()
def initialize(): logger_config.init(debug=False) args = arguments.parse_register_args() leap_provider = _set_leap_provider(args) def show_error(err): logger.info('error: %s' % err) def shut_down(_): reactor.stop() def _register(): d = register( args.username, args.password, leap_provider, args.invite_code) d.addErrback(show_error) d.addBoth(shut_down) reactor.callWhenRunning(_register) reactor.run()
def initialize(): log.info('Starting the Pixelated user agent') args = arguments.parse_user_agent_args() logger.init(debug=args.debug) services_factory = _create_service_factory(args) resource = RootResource(services_factory) deferred = _start_mode(args, resource, services_factory) def _quit_on_error(failure): failure.printTraceback() reactor.stop() def _register_shutdown_on_token_expire(leap_session): register(events.SOLEDAD_INVALID_AUTH_TOKEN, lambda _: reactor.stop()) return leap_session deferred.addCallback(_register_shutdown_on_token_expire) deferred.addErrback(_quit_on_error) log.info('Running the reactor') reactor.run()
def initialize(): log.info('Starting the Pixelated user agent') args = arguments.parse_user_agent_args() logger.init(debug=args.debug) services_factory = _create_service_factory(args) resource = RootResource(services_factory) deferred = _start_mode(args, resource, services_factory) def _quit_on_error(failure): failure.printTraceback() reactor.stop() def _register_shutdown_on_token_expire(leap_session): register(events.SOLEDAD_INVALID_AUTH_TOKEN, lambda *unused: reactor.stop()) return leap_session deferred.addCallback(_register_shutdown_on_token_expire) deferred.addErrback(_quit_on_error) log.info('Running the reactor') reactor.run()
def initialize(): logger_config.init(debug=False) args = arguments.parse_register_args() register(args.provider, args.username, args.password, args.leap_home, args.leap_provider_cert, args.leap_provider_cert_fingerprint)