From 320bab01884d2c1e4716b23be9871a130b4c0db0 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 11 Aug 2020 11:58:51 +0200 Subject: [PATCH] Add sub folders as input sources --- gpx2html/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gpx2html/__init__.py b/gpx2html/__init__.py index 8f865ec..9d5d8b7 100755 --- a/gpx2html/__init__.py +++ b/gpx2html/__init__.py @@ -124,9 +124,10 @@ class Gpx2Html(object): self.update() def update(self): - infiles = glob.glob(os.path.join(self.infolder, '*.gpx')) - for filename in infiles: - self.tracks.add(filename) + for root, _, files in os.walk(self.infolder): + for name in files: + if name.endswith(".gpx"): + self.tracks.add(os.path.join(root, name)) self.logger.info("Begin update of png's/html...") distances = list()