imap_storage package

Submodules

imap_storage.account module

Account and AccountManager class Use one of them to manage your imap_storage connection(s)

class imap_storage.account.AccountManager[source]

Bases: object

If you work with multiple accounts in parallel you should use this It is a factory class for Account

accounts

the whole dictionary of Accounts

Type:returns
by_id(id_)[source]

Get account object by id :param id_: Id of the Account :returns: Account object

by_request(request)[source]

Get account object by django request :param request: Django request to access the account of the session :returns: Account that belongs to the session

new(config, id_)[source]

Create a new Account :param config: Config object :param id_: Id to store the account with :returns: New created account

class imap_storage.account.Account(config, id_, unsafe=False)[source]

Bases: object

Use this if you only need one account or if you have another manager

close()[source]

close the account connection :returns: True if imap logged out

is_ok()[source]

Tests if the Account is ok :returns: True if the imap connection of the account is ok

Module contents

only these items should be used from outside

class imap_storage.Account(config, id_, unsafe=False)[source]

Bases: object

Use this if you only need one account or if you have another manager

close()[source]

close the account connection :returns: True if imap logged out

is_ok()[source]

Tests if the Account is ok :returns: True if the imap connection of the account is ok

class imap_storage.AccountManager[source]

Bases: object

If you work with multiple accounts in parallel you should use this It is a factory class for Account

accounts

the whole dictionary of Accounts

Type:returns
by_id(id_)[source]

Get account object by id :param id_: Id of the Account :returns: Account object

by_request(request)[source]

Get account object by django request :param request: Django request to access the account of the session :returns: Account that belongs to the session

new(config, id_)[source]

Create a new Account :param config: Config object :param id_: Id to store the account with :returns: New created account

class imap_storage.Config[source]

Bases: object

Account Configuration class

TAG = 'IMAP-Storage'
classmethod from_request(request)[source]

creates a config instance from a Django request :param request: Django request object

Returns:New created Config instance
Return type:Config
is_ok()[source]

Tests if this config seems to be ok :returns: True if config is ok :rtype: bool

imap_storage.file_from_local(path)[source]

create File object from local path :param path: Of the local file

imap_storage.file_from_upload(uploaded_file)[source]

create File object from Django uploaded file