The dropbox_store Module

Created on 08.04.2011

@author: joe

class cloudfusion.store.dropbox.dropbox_store.DropboxStore(config)

Bases: cloudfusion.store.store.Store

config can be obtained from the function cloudfusion.store.dropbox.dropbox_store.DropboxStore.get_config(), but you need to add user and password:

config = DropboxStore.get_config()
config['user'] = 'me@emailserver.com' #your account username/e-mail address
config['password'] = 'MySecret!23$' #your account password

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 does not need to rely on auto-login (since the auto-login feature often breaks because Dropbox changes their interface):

config['cache_id'] = 'dropbox_db' 

You can also choose between full access to dropbox or to a single subfolder by setting the value for ‘root’:

config['root'] = 'dropbox' #for full dropbox access (this is the default) or 
config['root'] = 'app_folder' #for restricted access to one subfolder

Or you can use a configuration file that already has password and username set by specifying a path:

path_to_my_config_file = '/home/joe/MyDropbox.ini'       
config = DropboxStore.get_config(path_to_my_config_file)
Parameters:config – dictionary with key value pairs
_DropboxStore__get_size(fileobject)
_add_revision(path, revision)
_auto_connect(authorize_url, user, password)
_backup_overwritten(path, resp_path)

Store path in the directory ‘/overwritten’ and rename the new file resp_path to path. If a new file is stored to path, the response from dropbox may say it was stored in to resp_path, instead. This means there has already been a file stored to path and instead of overwriting it, the new file was stored to resp_path, instead.

_close()
_get_cachedir_name(config)
_get_revision(path)
_get_time_difference()
_handle_error(error, stacktrace, method_name, remaining_tries, *args, **kwargs)

Used by retry decorator to react to errors.

_log_http_error(method_name, path, resp, msg=None)
_parse_dir_list(data)
_parse_filesys_obj(data)
_remove_revision(path)
account_info(*args, **kwargs)
create_directory(*args, **kwargs)
create_session(config, cache_dir)
delete(*args, **kwargs)
duplicate(*args, **kwargs)
static get_config(path_to_configfile=None)

Get initial dropbox configuration to initialize cloudfusion.store.dropbox.dropbox_store.DropboxStore :param path_to_configfile: path to a configuration file or None, which will use the default configuration file

get_directory_listing(*args, **kwargs)
get_file(*args, **kwargs)
get_logging_handler()
get_max_filesize()

Return maximum number of bytes per file

get_metadata(*args, **kwargs)
get_name()
get_overall_space(*args, **kwargs)
get_used_space(*args, **kwargs)
move(*args, **kwargs)
reconnect(tries=20)
store_fileobject(*args, **kwargs)
store_small_fileobject(fileobject, path)
class cloudfusion.store.dropbox.dropbox_store.HTTP_STATUS

Bases: object

AUTHORIZATION_REQUIRED = 401
BAD_REQUEST = 400
CONFLICT_OCCURRED = 409
FORBIDDEN = 403
NOT_CHANGED = 304
NOT_FOUND = 404
OK = [200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299]
OVER_STORAGE_LIMIT = 507
SERVER_ERROR = [500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599]
TOO_MANY_ITEMS = 406
TOO_MANY_REQUESTS = 503
UNEXPECTED_REQUEST = 405
static generate_exception(code, msg, method_name='')
static get_status_desc(code)

The file_decorator Module

Created on 23.04.2011

@author: joe

class cloudfusion.store.dropbox.file_decorator.DataFileWrapper(data, mem_size=1000000)

Bases: file

Create a file like object with data. :param mem_size: Data is written to disk if it is bigger than mem_size bytes

close()
fileno()
flush()
getvalue()
isatty()
next()
read(size=None)
readline(size=None)
readlines(sizehint=None)
seek(offset, whence=0)
tell()
truncate(size)
write(string)
writelines(sequence)
xreadlines()
class cloudfusion.store.dropbox.file_decorator.NameableFile(file_object, name)

Bases: object

close()
fileno()
flush()
getvalue()
isatty()
next()
read(size=None)
readline(size=None)
readlines(sizehint=None)
seek(offset, whence=0)
tell()
truncate(size)
write(string)
writelines(sequence)
xreadlines()
class cloudfusion.store.dropbox.file_decorator.NonclosingFile(file_object)

Bases: object

close()
fileno()
flush()
getvalue()
isatty()
next()
read(size=None)
readline(size=None)
readlines(sizehint=None)
seek(offset, whence=0)
tell()
truncate(size)
write(string)
writelines(sequence)
xreadlines()

Table Of Contents

Previous topic

The amazon_store Module

Next topic

The tinydav_client Module

This Page