From a373af2b0f9006d5dce2f8aa56ddc139ac817698 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 26 Oct 2023 19:42:18 +0200 Subject: [PATCH] Fixed mapview caching bugs --- sbapp/mapview/downloader.py | 2 ++ sbapp/mapview/view.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sbapp/mapview/downloader.py b/sbapp/mapview/downloader.py index ce3a94f..e888227 100644 --- a/sbapp/mapview/downloader.py +++ b/sbapp/mapview/downloader.py @@ -25,6 +25,7 @@ import logging # I tried it with a simpler one (just Mozilla/5.0) this also gets rejected USER_AGENT = 'Kivy-garden.mapview' +import RNS class Downloader: _instance = None @@ -51,6 +52,7 @@ class Downloader: self._futures = [] Clock.schedule_interval(self._check_executor, 1 / 60.0) if not exists(self.cache_dir): + RNS.log("Creating cache dir "+str(self.cache_dir), RNS.LOG_WARNING) makedirs(self.cache_dir) logging.getLogger("urllib3").setLevel(logging.WARNING) diff --git a/sbapp/mapview/view.py b/sbapp/mapview/view.py index 79b06fc..38bc67b 100644 --- a/sbapp/mapview/view.py +++ b/sbapp/mapview/view.py @@ -123,7 +123,7 @@ class Tile(Rectangle): cache_key=map_source.cache_key, **self.__dict__ ) - return join(self.cache_dir, fn) + return join(self.map_source.cache_dir, fn) def set_source(self, cache_fn): try: