Revision 29148653 snf-pithos-backend/pithos/backends/lib/sqlite/config.py
b/snf-pithos-backend/pithos/backends/lib/sqlite/config.py | ||
---|---|---|
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 | 34 |
# from collections import defaultdict |
35 |
#
|
|
35 |
# |
|
36 | 36 |
from dbworker import DBWorker |
37 | 37 |
|
38 | 38 |
|
... | ... | |
47 | 47 |
execute(""" create table if not exists config |
48 | 48 |
( key text primary key, |
49 | 49 |
value text ) """) |
50 |
|
|
51 | 50 |
|
52 | 51 |
def get_value(self, key): |
53 | 52 |
"""Return configuration value for key.""" |
... | ... | |
58 | 57 |
if r is not None: |
59 | 58 |
return r[0] |
60 | 59 |
return None |
61 |
|
|
60 |
|
|
62 | 61 |
def set_value(self, key, value): |
63 | 62 |
"""Set configuration entry. |
64 | 63 |
""" |
65 | 64 |
|
66 | 65 |
q = "insert into config (key, value) values (?, ?)" |
67 | 66 |
id = self.execute(q, (key, value)).lastrowid |
68 |
return id |
|
67 |
return id |
Also available in: Unified diff