Logo Search packages:      
Sourcecode: ubuntuone-client version File versions

def ubuntuone::u1sync::client::Client::__init__ (   self,
  realm 
)

Create the instance.

Definition at line 115 of file client.py.

00115                              :
        """Create the instance."""

        self.thread = Thread(target=self._run)
        self.thread.setDaemon(True)
        self.factory = SyncClientFactory(self)

        self._status_lock = Lock()
        self._status = "disconnected"
        self._status_reason = None
        self._status_waiting = []

        self.realm = realm

        oauth_config = get_oauth_config()
        if oauth_config.has_section(realm):
            config_section = realm
        elif self.realm.startswith("http://localhost") and \
             oauth_config.has_section("http://localhost"):
            config_section = "http://localhost"
        else:
            config_section = "default"

        def get_oauth_option(option):
            """Retrieves an option from oauth config."""
            try:
                return oauth_config.get(config_section, option)
            except ConfigParser.NoOptionError:
                return oauth_config.get("default", option)

        def get_oauth_url(option):
            """Retrieves an absolutized URL from the OAuth config."""
            suffix = get_oauth_option(option)
            return urlparse.urljoin(realm, suffix)

        self.consumer_key = CONSUMER_KEY
        self.consumer_secret = get_oauth_option("consumer_secret")

        self.request_token_url = get_oauth_url("request_token_url")
        self.user_authorisation_url = get_oauth_url("user_authorisation_url")
        self.access_token_url = get_oauth_url("access_token_url")

    def obtain_oauth_token(self, create_token):


Generated by  Doxygen 1.6.0   Back to index