VirtualMailManager/serviceset.py
branchv0.6.x
changeset 443 e2b9e3de2b51
parent 440 1a08fe35b496
child 482 428ee9cdf1b2
equal deleted inserted replaced
442:abcd73f5e980 443:e2b9e3de2b51
    27       Boolean flag for service pop3
    27       Boolean flag for service pop3
    28     `imap` : bool
    28     `imap` : bool
    29       Boolean flag for service imap
    29       Boolean flag for service imap
    30     `sieve` : bool
    30     `sieve` : bool
    31       Boolean flag for service sieve
    31       Boolean flag for service sieve
       
    32     `services` : dict
       
    33       The four services above with boolean values
    32     """
    34     """
    33     __slots__ = ('_ssid', '_services', '_sieve_col', '_dbh')
    35     __slots__ = ('_ssid', '_services', '_sieve_col', '_dbh')
    34     _kwargs = (('ssid',) + SERVICES)
    36     _kwargs = (('ssid',) + SERVICES)
    35 
    37 
    36     def __init__(self, dbh, **kwargs):
    38     def __init__(self, dbh, **kwargs):
   150         dbc = self._dbh.cursor()
   152         dbc = self._dbh.cursor()
   151         dbc.execute("SELECT nextval('service_set_id')")
   153         dbc.execute("SELECT nextval('service_set_id')")
   152         self._ssid = dbc.fetchone()[0]
   154         self._ssid = dbc.fetchone()[0]
   153         dbc.close()
   155         dbc.close()
   154 
   156 
       
   157     @property
       
   158     def services(self):
       
   159         """A dictionary: Keys: `smtp`, `pop3`, `imap` and `sieve` with
       
   160         boolean values."""
       
   161         return self._services.copy()
       
   162 
   155 del cfg_dget
   163 del cfg_dget