VirtualMailManager/handler.py
branchv0.7.x
changeset 653 cf07e4468934
parent 649 08837f3fbced
child 670 f374ef062c94
equal deleted inserted replaced
652:68d715ce6e1c 653:cf07e4468934
   281         `directory` : basestring
   281         `directory` : basestring
   282           The directory to summarize recursively disk usage for
   282           The directory to summarize recursively disk usage for
   283         """
   283         """
   284         if lisdir(directory):
   284         if lisdir(directory):
   285             return Popen([self._cfg.dget('bin.du'), "-hs", directory],
   285             return Popen([self._cfg.dget('bin.du'), "-hs", directory],
   286                          stdout=PIPE).communicate()[0].split('\t')[0]
   286                          stdout=PIPE).communicate()[0].decode().split('\t')[0]
   287         else:
   287         else:
   288             self._warnings.append(_('No such directory: %s') % directory)
   288             self._warnings.append(_('No such directory: %s') % directory)
   289             return 0
   289             return 0
   290 
   290 
   291     def _make_domain_dir(self, domain):
   291     def _make_domain_dir(self, domain):
   523                            INVALID_ARGUMENT)
   523                            INVALID_ARGUMENT)
   524         dom = self._get_domain(domainname)
   524         dom = self._get_domain(domainname)
   525         dominfo = dom.get_info()
   525         dominfo = dom.get_info()
   526         if dominfo['domain name'].startswith('xn--'):
   526         if dominfo['domain name'].startswith('xn--'):
   527             dominfo['domain name'] += ' (%s)' % \
   527             dominfo['domain name'] += ' (%s)' % \
   528                                       dominfo['domain name'].decode('idna')
   528                          dominfo['domain name'].encode('utf-8').decode('idna')
   529         if details is None:
   529         if details is None:
   530             return dominfo
   530             return dominfo
   531         elif details == 'accounts':
   531         elif details == 'accounts':
   532             return (dominfo, dom.get_accounts())
   532             return (dominfo, dom.get_accounts())
   533         elif details == 'aliasdomains':
   533         elif details == 'aliasdomains':