VirtualMailManager/Handler.py
branchv0.6.x
changeset 294 7d1bafc6fa30
parent 293 a77b67673aa6
child 309 d21423478803
equal deleted inserted replaced
293:a77b67673aa6 294:7d1bafc6fa30
    24 from VirtualMailManager.Account import Account
    24 from VirtualMailManager.Account import Account
    25 from VirtualMailManager.Alias import Alias
    25 from VirtualMailManager.Alias import Alias
    26 from VirtualMailManager.AliasDomain import AliasDomain
    26 from VirtualMailManager.AliasDomain import AliasDomain
    27 from VirtualMailManager.common import exec_ok
    27 from VirtualMailManager.common import exec_ok
    28 from VirtualMailManager.Config import Config as Cfg
    28 from VirtualMailManager.Config import Config as Cfg
    29 from VirtualMailManager.Domain import Domain, ace2idna, get_gid
    29 from VirtualMailManager.Domain import Domain, get_gid
    30 from VirtualMailManager.EmailAddress import EmailAddress
    30 from VirtualMailManager.EmailAddress import EmailAddress
    31 from VirtualMailManager.errors import \
    31 from VirtualMailManager.errors import \
    32      DomainError, NotRootError, PermissionError, VMMError
    32      DomainError, NotRootError, PermissionError, VMMError
    33 from VirtualMailManager.Relocated import Relocated
    33 from VirtualMailManager.Relocated import Relocated
    34 from VirtualMailManager.Transport import Transport
    34 from VirtualMailManager.Transport import Transport
   414             raise VMMError(_(u'Invalid argument: ā€œ%sā€') % details,
   414             raise VMMError(_(u'Invalid argument: ā€œ%sā€') % details,
   415                                ERR.INVALID_AGUMENT)
   415                                ERR.INVALID_AGUMENT)
   416         dom = self.__getDomain(domainname)
   416         dom = self.__getDomain(domainname)
   417         dominfo = dom.get_info()
   417         dominfo = dom.get_info()
   418         if dominfo['domainname'].startswith('xn--'):
   418         if dominfo['domainname'].startswith('xn--'):
   419             dominfo['domainname'] += ' (%s)' % ace2idna(dominfo['domainname'])
   419             dominfo['domainname'] += ' (%s)' % \
       
   420                                      dominfo['domainname'].decode('idna')
   420         if details is None:
   421         if details is None:
   421             return dominfo
   422             return dominfo
   422         elif details == 'accounts':
   423         elif details == 'accounts':
   423             return (dominfo, dom.get_accounts())
   424             return (dominfo, dom.get_accounts())
   424         elif details == 'aliasdomains':
   425         elif details == 'aliasdomains':