Created on 08.04.2011
@author: joe
Bases: cloudfusion.store.store.Store
Subclass of Store implementing an interface to the Google Drive.
config can be obtained from the function cloudfusion.store.gdrive.google_drive.GoogleDrive.get_config(), but you need to add the id and secret, which can be obtained by creating an id and secret for an “Installed Application” in the developer console: https://console.developers.google.com/project, as described in https://developers.google.com/drive/web/quickstart/quickstart-python:
config = GoogleDrive.get_config()
config['id'] = '4523154788555-kjsdfj87sdfjh44dfsdfj45kjj.apps.googleusercontent.com' #your id
config['secret'] = 'sdfjk3h5j444jnjfo0' #your secret
You may add a cache id, so that you can continue previous sessions. If you use the same cache id in a later session, the store will remember some metadata and won’t need the id and secret for authentication (just use empty strings in this case):
config['cache_id'] = 'gdrive_db'
Or you can use a configuration file that already has id and secret set by specifying a path:
path_to_my_config_file = '/home/joe/gdrive.ini'
config = GoogleDrive.get_config(path_to_my_config_file)
Parameters: | config – dictionary with key value pairs |
---|
Create a deep copy of the GoogleAuth object, and the GoogleDrive object for use by another thread. :returns: a tuple with the copies of the GoogleAuth and the GoogelDrive object
Used by retry decorator to react to errors.
Get initial google drive configuration to initialize cloudfusion.store.gdrive.google_drive.GoogleDrive :param path_to_configfile: path to a configuration file or None, which will use the default configuration file
Return maximum number of bytes per file