Пример #1
0
    def do_signup(self, full_id, password, invite=None, autoconf=False):
        logger.debug('SIGNUP for %s' % full_id)
        _, provider_id = config.get_username_and_provider(full_id)

        provider = config.Provider(provider_id, autoconf=autoconf)
        d = provider.callWhenReady(
            self._do_signup, provider, full_id, password, invite)
        return d
Пример #2
0
    def do_signup(self, full_id, password):
        log.msg('SIGNUP for %s' % full_id)
        _, provider_id = config.get_username_and_provider(full_id)

        provider = config.Provider(provider_id)
        d = provider.callWhenReady(self._do_signup, provider, full_id,
                                   password)
        return d
Пример #3
0
    def do_authenticate(self, full_id, password, autoconf=False):
        _, provider_id = config.get_username_and_provider(full_id)

        provider = config.Provider(provider_id, autoconf=autoconf)

        def maybe_finish_provider_bootstrap(result, provider):
            session = self._get_session(provider, full_id, password)
            d = provider.download_services_config_with_auth(session)
            d.addCallback(lambda _: result)
            return d

        d = provider.callWhenReady(
            self._do_authenticate, provider, full_id, password)
        d.addCallback(maybe_finish_provider_bootstrap, provider)
        return d
Пример #4
0
def _get_provider_from_full_userid(userid):
    _, provider_id = config.get_username_and_provider(userid)
    return config.Provider(provider_id)
Пример #5
0
 def do_get_provider(self, provider_id, autoconf=False):
     provider = config.Provider(provider_id, autoconf=autoconf)
     return provider.callWhenReady(provider.config)
Пример #6
0
def _get_provider_from_full_userid(userid):
    _, provider_id = config.get_username_and_provider(userid)
    # TODO -- this autoconf should be passed from the
    # command flag. workaround to get cli workinf for now.
    return config.Provider(provider_id, autoconf=True)
Пример #7
0
 def do_get_service(self, provider_id, service, autoconf=False):
     provider = config.Provider(provider_id, autoconf=autoconf)
     return provider.callWhenMainConfigReady(provider.config, service)