From 8e359801ab8ec6c38c4579ecbf993d06ddc0b215 Mon Sep 17 00:00:00 2001 From: Matt Kubilus Date: Sat, 19 Aug 2023 12:03:00 -0400 Subject: [PATCH 1/2] Fix log handler being overridden --- autoortho/__main__.py | 5 ++++- autoortho/downloader.py | 6 +----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/autoortho/__main__.py b/autoortho/__main__.py index 39f5c9c2..1429058b 100644 --- a/autoortho/__main__.py +++ b/autoortho/__main__.py @@ -11,9 +11,10 @@ def setuplogs(): if not os.path.isdir(log_dir): os.makedirs(log_dir) + log_level=logging.DEBUG if os.environ.get('AO_DEBUG') or CFG.general.debug else logging.INFO logging.basicConfig( #filename=os.path.join(log_dir, "autoortho.log"), - level=logging.DEBUG if os.environ.get('AO_DEBUG') or CFG.general.debug else logging.INFO, + level=log_level, handlers=[ #logging.FileHandler(filename=os.path.join(log_dir, "autoortho.log")), logging.handlers.RotatingFileHandler( @@ -24,6 +25,8 @@ def setuplogs(): logging.StreamHandler() ] ) + log = logging.getLogger(__name__) + log.info(f"Setup logs: {log_dir}, level: {log_level}") import autoortho diff --git a/autoortho/downloader.py b/autoortho/downloader.py index ee1d9c0d..fbb6aa2f 100644 --- a/autoortho/downloader.py +++ b/autoortho/downloader.py @@ -21,13 +21,8 @@ from aoconfig import CFG import logging -logging.basicConfig(level=logging.INFO, stream=sys.stdout) log = logging.getLogger(__name__) -if not log: - print("NO LOG") -print(log) - TESTMODE=os.environ.get('AO_TESTMODE', False) @@ -720,6 +715,7 @@ def find_regions(self): if __name__ == "__main__": + logging.basicConfig(level=logging.INFO, stream=sys.stdout) parser = argparse.ArgumentParser( description = "AutoOrtho Scenery Downloader" From 1d81117311ab2507e57943b1cd6168ab74891956 Mon Sep 17 00:00:00 2001 From: Matt Kubilus Date: Sat, 19 Aug 2023 12:06:33 -0400 Subject: [PATCH 2/2] Update URL to latest --- autoortho/getortho.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoortho/getortho.py b/autoortho/getortho.py index a9e4e22a..965ff1c8 100644 --- a/autoortho/getortho.py +++ b/autoortho/getortho.py @@ -271,7 +271,7 @@ def get(self, idx=0): MAPTYPES = { "EOX": f"https://{server}.s2maps-tiles.eu/wmts/?layer={MAPID}&style=default&tilematrixset={MATRIXSET}&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix={self.zoom}&TileCol={self.col}&TileRow={self.row}", - "BI": f"http://ecn.t{server_num}.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=13716", + "BI": f"http://ecn.t{server_num}.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=13816", "GO2": f"http://khms{server_num}.google.com/kh/v=934?x={self.col}&y={self.row}&z={self.zoom}", "ARC": f"http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{self.zoom}/{self.row}/{self.col}", "NAIP": f"http://naip.maptiles.arcgis.com/arcgis/rest/services/NAIP/MapServer/tile/{self.zoom}/{self.row}/{self.col}",