aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dbstore/dbm_store.py')
-rw-r--r--dbstore/dbm_store.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/dbstore/dbm_store.py b/dbstore/dbm_store.py
deleted file mode 100644
index fedb505..0000000
--- a/dbstore/dbm_store.py
+++ /dev/null
@@ -1,34 +0,0 @@
1import dbm
2
3db = None
4store_file = "fsq_poi.db"
5
6
7def get_loc(fsq_id):
8 global db
9 if db is None:
10 db = dbm.open(store_file, 'c')
11 if fsq_id in db:
12 res = db[fsq_id].decode("utf-8").split("|")
13 return {
14 "name": res[0],
15 "locality": res[1],
16 "region": res[2],
17 "latitude": res[3],
18 "longitude": res[4],
19 "osm_url": res[5],
20 }
21 else:
22 return None
23
24
25def store_loc(loc):
26 global db
27 if db is None:
28 db = dbm.open(store_file, 'c')
29 db[loc["fsq_id"]] = "{}|{}|{}|{}|{}|{}".format(loc["name"],
30 loc["locality"],
31 loc["region"],
32 loc["latitude"],
33 loc["longitude"],
34 loc["osm_url"])
Powered by cgit v1.2.3 (git 2.41.0)