libgmail.GmailAccount

Module libgmail :: Class GmailAccount |
[hide private]
[frames] | no frames]

# Class GmailAccount

source code

Instance Methods | [hide private]
__init__(self, name=`'````'`, pw=`'````'`, state=None, domain=None) | source code
login(self) | source code
_retrievePage(self, urlOrRequest) | source code
_parsePage(self, urlOrRequest) Retrieve & then parse the requested page content. | source code
_parseSearchResult(self, searchType, start=0, **kwargs) | source code
_parseThreadSearch(self, searchType, allPages=False, **kwargs) Only works for thread-based results at present. | source code
_retrieveJavascript(self, version=`'````'`) Note: `version` seems to be ignored. | source code
getMessagesByFolder(self, folderName, allPages=False) Folders contain conversation/message threads. | source code
getMessagesByQuery(self, query, allPages=False) Returns a `GmailSearchResult` instance. | source code
getQuotaInfo(self, refresh=False) Return MB used, Total MB and percentage used. | source code
getLabelNames(self, refresh=False) | source code
getMessagesByLabel(self, label, allPages=False) | source code
getRawMessage(self, msgId) | source code
getUnreadMessages(self) | source code
getUnreadMsgCount(self) | source code
_getActionToken(self) | source code
sendMessage(self, msg, asDraft=False, _extraParams=None) `msg` -- `GmailComposedMessage` instance. | source code
trashMessage(self, msg) | source code
_doThreadAction(self, actionId, thread) | source code
trashThread(self, thread) | source code
_createUpdateRequest(self, actionId) Helper method to create a Request instance for an update (view) action. | source code
createLabel(self, labelName) | source code
deleteLabel(self, labelName) | source code
renameLabel(self, oldLabelName, newLabelName) | source code
storeFile(self, filename, label=None) | source code
getContacts(self) Returns a GmailContactList object that has all the contacts in it as GmailContacts | source code
addContact(self, myContact, *extra_args) Attempts to add a GmailContact to the gmail address book. | source code
_removeContactById(self, id) Attempts to remove the contact that occupies id "id" from the gmail address book. | source code
removeContact(self, gmailContact) Attempts to remove the GmailContact passed in Returns True if successful, False otherwise. | source code

Method Details | [hide private]

### _parseThreadSearch(self, searchType, allPages=False, **kwargs) | source code
Only works for thread-based results at present. # TODO: Change this?

### getMessagesByFolder(self, folderName, allPages=False) | source code
    Folders contain conversation/message threads.

      `folderName` -- As set in Gmail interface.

    Returns a `GmailSearchResult` instance.

    *** TODO: Change all "getMessagesByX" to "getThreadsByX"? ***

### sendMessage(self, msg, asDraft=False, _extraParams=None) | source code
      `msg` -- `GmailComposedMessage` instance.

      `_extraParams` -- Dictionary containing additional parameters
                        to put into POST message. (Not officially
                        for external use, more to make feature
                        additional a little easier to play with.)

    Note: Now returns `GmailMessageStub` instance with populated
          `id` (and `_account`) fields on success or None on failure.

### _createUpdateRequest(self, actionId) | source code
Helper method to create a Request instance for an update (view) action. Returns populated `Request` instance.

### addContact(self, myContact, *extra_args) | source code
Attempts to add a GmailContact to the gmail address book. Returns true if successful, false otherwise Please note that after version 0.1.3.3, addContact takes one argument of type GmailContact, the contact to add. The old signature of: addContact(name, email, notes='') is still supported, but deprecated.

### _removeContactById(self, id) | source code
Attempts to remove the contact that occupies id "id" from the gmail address book. Returns True if successful, False otherwise. This is a little dangerous since you don't really know who you're deleting. Really, this should return the name or something of the person we just killed. Don't call this method. You should be using removeContact instead.