VirtualMailManager/VirtualMailManager.py
changeset 62 869de537a020
parent 55 15c873f94ba6
child 66 995d538a6eb5
equal deleted inserted replaced
61:d85482575349 62:869de537a020
   477         else:
   477         else:
   478             dom.delete()
   478             dom.delete()
   479         if self.__Cfg.getboolean('domdir', 'delete'):
   479         if self.__Cfg.getboolean('domdir', 'delete'):
   480             self.__domDirDelete(domdir, gid)
   480             self.__domDirDelete(domdir, gid)
   481 
   481 
   482     def domainInfo(self, domainname, detailed=None):
   482     def domainInfo(self, domainname, details=None):
       
   483         if details not in [None, 'accounts', 'aliasdomains', 'aliases', 'full',
       
   484                 'detailed']:
       
   485             raise VMMDomainException(_(u'Invalid argument: »%s«') % details,
       
   486                 ERR.INVALID_OPTION)
       
   487         if details == 'detailed':
       
   488             details = 'full'
       
   489             warning = _(u"""\
       
   490 The keyword »detailed« is deprecated and will be removed in a future release.
       
   491     Please use the keyword »full« to get full details.""")
       
   492             self.__warnings.append(warning)
   483         dom = self.__getDomain(domainname)
   493         dom = self.__getDomain(domainname)
   484         dominfo = dom.getInfo()
   494         dominfo = dom.getInfo()
   485         if dominfo['domainname'].startswith('xn--'):
   495         if dominfo['domainname'].startswith('xn--'):
   486             dominfo['domainname'] += ' (%s)'\
   496             dominfo['domainname'] += ' (%s)'\
   487                 % VirtualMailManager.ace2idna(dominfo['domainname'])
   497                 % VirtualMailManager.ace2idna(dominfo['domainname'])
   488         if dominfo['aliases'] is None:
   498         if dominfo['aliases'] is None:
   489             dominfo['aliases'] = 0
   499             dominfo['aliases'] = 0
   490         if detailed is None:
   500         if details is None:
   491             return dominfo
   501             return dominfo
   492         elif detailed == 'detailed':
   502         elif details == 'accounts':
       
   503             return (dominfo, dom.getAccounts())
       
   504         elif details == 'aliasdomains':
       
   505             return (dominfo, dom.getAliaseNames())
       
   506         elif details == 'aliases':
       
   507             return (dominfo, dom.getAliases())
       
   508         else:
   493             return (dominfo, dom.getAliaseNames(), dom.getAccounts(),
   509             return (dominfo, dom.getAliaseNames(), dom.getAccounts(),
   494                     dom.getAliases())
   510                     dom.getAliases())
   495         else:
       
   496             raise VMMDomainException(_(u'Invalid argument: »%s«') % detailed,
       
   497                 ERR.INVALID_OPTION)
       
   498 
   511 
   499     def aliasDomainAdd(self, aliasname, domainname):
   512     def aliasDomainAdd(self, aliasname, domainname):
   500         """Adds an alias domain to the domain.
   513         """Adds an alias domain to the domain.
   501 
   514 
   502         Keyword arguments:
   515         Keyword arguments: