equal
deleted
inserted
replaced
127 result = dbc.fetchone() |
127 result = dbc.fetchone() |
128 dbc.close() |
128 dbc.close() |
129 if not result: |
129 if not result: |
130 raise ValueError('Unknown service_set id specified: %r' % ssid) |
130 raise ValueError('Unknown service_set id specified: %r' % ssid) |
131 self._ssid = result[0] |
131 self._ssid = result[0] |
132 self._services.update(zip(SERVICES, result[1:])) |
132 #self._services.update(zip(SERVICES, result[1:])) |
|
133 for key, value in zip(SERVICES, result[1:]): # pyPgSQL compatible |
|
134 if value: |
|
135 self._services[key] = True |
|
136 else: |
|
137 self._services[key] = False |
133 |
138 |
134 def _save(self): |
139 def _save(self): |
135 """Store a new service_set in the database.""" |
140 """Store a new service_set in the database.""" |
136 sql = ('INSERT INTO service_set (ssid, smtp, pop3, imap, %s) ' % |
141 sql = ('INSERT INTO service_set (ssid, smtp, pop3, imap, %s) ' % |
137 (self._sieve_col,) + |
142 (self._sieve_col,) + |