Package pamfax :: Package processors :: Class OnlineStorage
[hide private]
[frames] | no frames]

Class OnlineStorage

source code

Class encapsulating actions related to online storage

Instance Methods [hide private]
 
__init__(self, api_credentials, http)
Instantiates the OnlineStorage class
source code
 
authenticate(self, provider, username, password)
Authenticate the current user for a Provider.
source code
 
drop_authentication(self, provider)
Will drop the users authentication for the given provider.
source code
 
get_provider_logo(self, provider, size)
Outputs a providers logo in a given size.
source code
 
list_folder_contents(self, provider, folder=None, clear_cache=None)
Lists all files and folders inside a given folder.
source code
 
list_providers(self, attach_settings=None)
Returns a list of supported providers.
source code
 
set_auth_token(self, provider, token, username=None)
Manually sets auth token for the current user.
source code
Method Details [hide private]

authenticate(self, provider, username, password)

source code 

Authenticate the current user for a Provider.

This is a one-time process and must be done only once for each user. PamFax API will perform the login and store only an authentication token which will be enaugh for future use of the service.

Arguments: provider -- Provider name. See OnlineStorage::ListProviders for available providers. username -- The user's name/login for the provider password -- User's password to access his data at the provider side

drop_authentication(self, provider)

source code 

Will drop the users authentication for the given provider.

This will permanently erase all data related to the account!

get_provider_logo(self, provider, size)

source code 

Outputs a providers logo in a given size.

Call ListProviders for valid sizes per Provider.

list_folder_contents(self, provider, folder=None, clear_cache=None)

source code 

Lists all files and folders inside a given folder.

Leave folder empty to get the contents of the root folder. User must be autheticated for the provider given here to be able to recieve listings (see Authenticate method). If clear_cache is set to true all subitems will be deleted and must be refetched (previously cached UUIDs are invalid)

set_auth_token(self, provider, token, username=None)

source code 

Manually sets auth token for the current user.

token must contain an associative array including the tokens. sample (google): 'auth_token_cp'=>DQAAAHoAAADCrkpB7Ip_vuelbla2UKE9s_ObVKTNA_kT6Ej26SwddJvMUmEz_9qbLlZJnsAdm583Sddp_0FYS9QmmwoUpf51RHxkgPUL20OqsdAP5OnCgY_TdVbvXX8tMQBBX30V4_NhTcE_0sI6zhba5Y3yZWV5nljliG98eA36ybekKucuhQ 'auth_token_writely'=>DQAAAHoAAADCrkpB7Ip_vuelbla2UKE9s_ObVKTNA_kT6Ej62SDwdJvMUmEz_9qbLlZJnsAdm583Sddp_0FYS9QmmwoUpf51RHxkgPUL20OqsdAP5OnCgY_TdVbvXX8tMQBBX30V4_NhTcE_0sI6zhba5Y3yZWV5nljliG98eA36ybekKucuhQ 'auth_token_wise'=>DQAAAHoAAADCrkpB7Ip_vuelbla2UKE9s_ObVKTNA_kT6Ej26SDdwJvMUmEz_9qbLlZJnsAdm583Sddp_0FYS9QmmwoUpf51RHxkgPUL20OqsdAP5OnCgY_TdVbvXX8tMQBBX30V4_NhTcE_0sI6zhba5Y3yZWV5nljliG98eA36ybekKucuhQ 'auth_token_lh2'=>DQAAAHoAAADCrkpB7Ip_vuelbla2UKE9s_ObkvTNA_kT6Ej26SDwdJvMUmEz_9qbLlZJnsAdm583Sddp_0FYS9QmmwoUpf51RHxkgPUL20OqsdAP5OnCgY_TdVbvXX8tMQBBX30V4_NhTcE_0sI6zhba5Y3yZWV5nljliG98eA36ybekKucuhQ

Arguments: provider -- Provider name token -- Associative array with token information username -- Optional username (for displaying purposes)