--- a/VirtualMailManager/Alias.py Mon Aug 18 01:56:31 2008 +0000
+++ b/VirtualMailManager/Alias.py Tue Aug 19 02:40:43 2008 +0000
@@ -21,9 +21,9 @@
"""Class to manage e-mail accounts."""
def __init__(self, dbh, address, destination=None):
if address == destination:
- raise VMMAliasException((
- _('Address and destination are identical.'),
- ERR.ALIAS_ADDR_DEST_IDENTICAL))
+ raise VMMAliasException(
+ _(u'Address and destination are identical.'),
+ ERR.ALIAS_ADDR_DEST_IDENTICAL)
self._dbh = dbh
self._addr = address
self._dest = destination
@@ -35,8 +35,8 @@
self._exists()
if self._isAccount():
raise VMMAliasException(
- (_(u"There is already an account with address '%s'") % self._addr,
- ERR.ACCOUNT_EXISTS))
+ _(u"There is already an account with address '%s'") % self._addr,
+ ERR.ACCOUNT_EXISTS)
def _exists(self):
dbc = self._dbh.cursor()
@@ -65,14 +65,14 @@
dom = Domain(self._dbh, d)
self._gid = dom.getID()
if self._gid == 0:
- raise VMMAliasException((_(u"Domain '%s' doesn't exist.") % d,
- ERR.NO_SUCH_DOMAIN))
+ raise VMMAliasException(_(u"Domain '%s' doesn't exist.") % d,
+ ERR.NO_SUCH_DOMAIN)
def save(self):
if self._dest is None:
- raise VMMAliasException((
+ raise VMMAliasException(
_('No destination address for alias denoted.'),
- ERR.ALIAS_MISSING_DEST))
+ ERR.ALIAS_MISSING_DEST)
if self._isNew:
dbc = self._dbh.cursor()
dbc.execute("INSERT INTO alias (gid, address, destination) VALUES\
@@ -80,8 +80,8 @@
self._dbh.commit()
dbc.close()
else:
- raise VMMAliasException((_("Alias already exists."),
- ERR.ALIAS_EXISTS))
+ raise VMMAliasException(_("Alias already exists."),
+ ERR.ALIAS_EXISTS)
def getInfo(self):
dbc = self._dbh.cursor()
@@ -95,8 +95,8 @@
targets.append(destination[0])
return targets
else:
- raise VMMAliasException((_("Alias doesn't exists"),
- ERR.NO_SUCH_ALIAS))
+ raise VMMAliasException(_("Alias doesn't exists"),
+ ERR.NO_SUCH_ALIAS)
def delete(self):
dbc = self._dbh.cursor()
@@ -111,6 +111,6 @@
if rowcount > 0:
self._dbh.commit()
else:
- raise VMMAliasException((_("Alias doesn't exists"),
- ERR.NO_SUCH_ALIAS))
+ raise VMMAliasException(_("Alias doesn't exists"),
+ ERR.NO_SUCH_ALIAS)