예제 #1
0
 def __init__(self, location='/Public'):
     session = DropboxSession(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TYPE, locale=None)
     session.set_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
     self.client = DropboxClient(session)
     self.account_info = self.client.account_info()
     self.location = location
     self.base_url = 'http://dl.dropbox.com/u/{uid}/'.format(**self.account_info)
 def __init__(self, app_key, app_secret, access_type, access_token, access_token_secret,
               location='',):
     session = DropboxSession(app_key, app_secret, access_type)        
     session.set_token(access_token, access_token_secret)
     self.client = DropboxClient(session)
     self.account_info = self.client.account_info()
     self.location = location
     self.base_url = 'http://dl.dropbox.com/u/{uid}/'.format(**self.account_info)
예제 #3
0
 def __init__(self, location='/Public'):
     session = DropboxSession(CONSUMER_KEY,
                              CONSUMER_SECRET,
                              ACCESS_TYPE,
                              locale=None)
     session.set_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
     self.client = DropboxClient(session)
     self.account_info = self.client.account_info()
     self.location = location
     self.base_url = 'http://dl.dropbox.com/u/{uid}/'.format(
         **self.account_info)
예제 #4
0
def get_dropbox_client(consumer_key, consumer_secret, access_token_key, access_token_secret):
    """Gibt ein vorkonfiguriertes Dropbox Client Object zurück.

        db_client = dropbox.get_dropbox_client(consumer_key='wj123',
                                               consumer_secret='ph123',
                                               access_token_secret='xe123',
                                               access_token_key='1w123')
    """

    session = dropbox.session.DropboxSession(consumer_key, consumer_secret, 'dropbox')
    session.set_token(access_token_key, access_token_secret)
    return dropbox.client.DropboxClient(session)
예제 #5
0
def get_dropbox_client(consumer_key, consumer_secret, access_token_key, access_token_secret):
    """Gibt ein vorkonfiguriertes Dropbox Client Object zurück.

        db_client = dropbox.get_dropbox_client(consumer_key='wj123',
                                               consumer_secret='ph123',
                                               access_token='oauth_token_secret=xe123&oauth_token=1w123')
    """
    # Lazy Import
    from dropbox import session
    from dropbox import client

    session = session.DropboxSession(consumer_key, consumer_secret, 'dropbox')
    session.set_token(access_token_key, access_token_secret)
    return client.DropboxClient(session)