VirtualMailManager/domain.py
branchv0.6.x
changeset 447 c31d604e26d3
parent 441 1af5fe0683ce
child 453 f2934105181b
equal deleted inserted replaced
446:18b75e6a39d5 447:c31d604e26d3
   345 
   345 
   346     def get_info(self):
   346     def get_info(self):
   347         """Returns a dictionary with information about the domain."""
   347         """Returns a dictionary with information about the domain."""
   348         self._chk_state()
   348         self._chk_state()
   349         dbc = self._dbh.cursor()
   349         dbc = self._dbh.cursor()
   350         dbc.execute('SELECT aliasdomains, accounts, aliases, relocated '
   350         dbc.execute('SELECT aliasdomains "alias domains", accounts, aliases, '
   351                     'FROM vmm_domain_info WHERE gid = %s', (self._gid,))
   351                     'relocated FROM vmm_domain_info WHERE gid = %s',
       
   352                     (self._gid,))
   352         info = dbc.fetchone()
   353         info = dbc.fetchone()
   353         dbc.close()
   354         dbc.close()
   354         keys = ('aliasdomains', 'accounts', 'aliases', 'relocated')
   355         keys = ('alias domains', 'accounts', 'aliases', 'relocated')
   355         info = dict(zip(keys, info))
   356         info = dict(zip(keys, info))
   356         info['gid'] = self._gid
   357         info['gid'] = self._gid
   357         info['domainname'] = self._name
   358         info['domain name'] = self._name
   358         info['transport'] = self._transport.transport
   359         info['transport'] = self._transport.transport
   359         info['domaindir'] = self._directory
   360         info['domain directory'] = self._directory
   360         info['bytes'] = self._qlimit.bytes
   361         info['bytes'] = self._qlimit.bytes
   361         info['messages'] = self._qlimit.messages
   362         info['messages'] = self._qlimit.messages
       
   363         services = self._services.services
       
   364         services = [s.upper() for s in services if services[s]]
       
   365         if services:
       
   366             services.sort()
       
   367         else:
       
   368             services.append('None')
       
   369         info['active services'] = ' '.join(services)
   362         return info
   370         return info
   363 
   371 
   364     def get_accounts(self):
   372     def get_accounts(self):
   365         """Returns a list with all accounts of the domain."""
   373         """Returns a list with all accounts of the domain."""
   366         self._chk_state()
   374         self._chk_state()