2 # Copyright (c) 2008 - 2010, Pascal Volk |
2 # Copyright (c) 2008 - 2010, Pascal Volk |
3 # See COPYING for distribution information. |
3 # See COPYING for distribution information. |
4 |
4 |
5 """Virtual Mail Manager's AliasDomain class to manage alias domains.""" |
5 """Virtual Mail Manager's AliasDomain class to manage alias domains.""" |
6 |
6 |
7 from __main__ import ERR |
7 import VirtualMailManager.constants.ERROR as ERR |
8 from Exceptions import VMMAliasDomainException as VADE |
8 from VirtualMailManager import chk_domainname |
9 import VirtualMailManager as VMM |
9 from VirtualMailManager.Exceptions import VMMAliasDomainException as VADE |
10 |
10 |
11 class AliasDomain(object): |
11 class AliasDomain(object): |
12 """Class to manage e-mail alias domains.""" |
12 """Class to manage e-mail alias domains.""" |
13 __slots__ = ('__gid', '__name', '_domain', '_dbh') |
13 __slots__ = ('__gid', '__name', '_domain', '_dbh') |
14 def __init__(self, dbh, domainname, targetDomain=None): |
14 def __init__(self, dbh, domainname, targetDomain=None): |
15 self._dbh = dbh |
15 self._dbh = dbh |
16 self.__name = VMM.VirtualMailManager.chkDomainname(domainname) |
16 self.__name = chk_domainname(domainname) |
17 self.__gid = 0 |
17 self.__gid = 0 |
18 self._domain = targetDomain |
18 self._domain = targetDomain |
19 self._exists() |
19 self._exists() |
20 |
20 |
21 def _exists(self): |
21 def _exists(self): |