VMM/Account: renamed function getAccountByID -> get_account_by_uid.
Fixed AttributeError (tid) in Account._prepare(). Removed unused imports.
--- a/VirtualMailManager/Account.py Thu Apr 15 22:04:33 2010 +0000
+++ b/VirtualMailManager/Account.py Thu Apr 15 23:25:24 2010 +0000
@@ -12,8 +12,8 @@
from VirtualMailManager.EmailAddress import EmailAddress
from VirtualMailManager.Transport import Transport
from VirtualMailManager.constants.ERROR import \
- ACCOUNT_EXISTS, ACCOUNT_MISSING_PASSWORD, ALIAS_EXISTS, ALIAS_PRESENT, \
- INVALID_AGUMENT, NO_SUCH_ACCOUNT, NO_SUCH_DOMAIN, RELOCATED_EXISTS, \
+ ACCOUNT_EXISTS, ACCOUNT_MISSING_PASSWORD, ALIAS_PRESENT, \
+ INVALID_AGUMENT, NO_SUCH_ACCOUNT, NO_SUCH_DOMAIN, \
UNKNOWN_MAILLOCATION_NAME, UNKNOWN_SERVICE
from VirtualMailManager.errors import AccountError as AErr
from VirtualMailManager.maillocation import MailLocation, known_format
@@ -85,7 +85,7 @@
maillocation, UNKNOWN_MAILLOCATION_NAME)
self._mid = MailLocation(format=maillocation).mid
if not self._tid:
- self._tid = self._domain.tid
+ self._tid = self._domain.transport.tid
self._set_uid()
def _switch_state(self, state, dcvers, service):
@@ -372,9 +372,12 @@
dbc.close()
-def getAccountByID(uid, dbh):
+def get_account_by_uid(uid, dbh):
"""Search an Account by its UID.
+ This function returns a dict (keys: 'address', 'gid' and 'uid'), if an
+ Account with the given *uid* exists.
+
Argument:
`uid` : long