aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2022-11-16 13:37:55 +0100
committerMatěj Cepl <mcepl@cepl.eu>2022-11-16 14:01:40 +0100
commite16d9c087976fde03a885edac501991ffa8e00b8 (patch)
tree7ab1fd19c8428e7874365cda9a71fc585c87bafb /src
parent4bc653217f44221306a907fcce917477e931a8e6 (diff)
downloadosm_where-e16d9c087976fde03a885edac501991ffa8e00b8.tar.gz
Cache to the subdirectory of the standard XDG Caching tree.0.1.0
Fixes: https://todo.sr.ht/~mcepl/osm_where/1
Diffstat (limited to 'src')
-rwxr-xr-xsrc/osm_where.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/osm_where.py b/src/osm_where.py
index e0b7022..52e7b9b 100755
--- a/src/osm_where.py
+++ b/src/osm_where.py
@@ -1,7 +1,13 @@
#!/usr/bin/env python3
import argparse
+
+import xdg.BaseDirectory
+
+from OSMPythonTools.cachingStrategy import CachingStrategy, JSON
from OSMPythonTools.overpass import Overpass
+CachingStrategy.use(JSON, cacheDir=xdg.BaseDirectory.save_cache_path('osm_where'))
+
import logging
logging.getLogger("OSMPythonTools").setLevel(logging.ERROR)