From 123f0fb8d6eb1690aa775defa36c8c5fc645399a Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 15 Oct 2020 20:41:30 +0200 Subject: [PATCH] changed to python2 for jnes --- Pipfile | 2 +- Pipfile.lock | 9 +++++---- coordinates_from_gpx_to_txt.py | 6 ++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Pipfile b/Pipfile index 333eb86..6d01d28 100644 --- a/Pipfile +++ b/Pipfile @@ -10,4 +10,4 @@ gpxpy = "*" pykml = "*" [requires] -python_version = "3.8" +python_version = "2" diff --git a/Pipfile.lock b/Pipfile.lock index 4f6d3d1..286887b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "e7873caaf0610728fd1dc747926f29729da4eedc84d5bd30b9b3826e794c7955" + "sha256": "a925c1eb278671d6afc5297751c941521a902a8dbe83c7ec3edcf49a96a24cea" }, "pipfile-spec": 6, "requires": { - "python_version": "3.8" + "python_version": "2" }, "sources": [ { @@ -18,10 +18,10 @@ "default": { "gpxpy": { "hashes": [ - "sha256:0832041899cdfdc5a607291bbef3d73042e16ffcecc3f2cb9631b699db0bb53f" + "sha256:b09e3212c9af83188d308214428c20c57b4ec1d45c3a3fc40f4b3d49c758aebf" ], "index": "pypi", - "version": "==1.4.2" + "version": "==1.3.5" }, "lxml": { "hashes": [ @@ -57,6 +57,7 @@ "sha256:ecc930ae559ea8a43377e8b60ca6f8d61ac532fc57efb915d899de4a67928efd", "sha256:f161af26f596131b63b236372e4ce40f3167c1b5b5d459b29d2514bd8c9dc9ee" ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==4.5.2" }, "pykml": { diff --git a/coordinates_from_gpx_to_txt.py b/coordinates_from_gpx_to_txt.py index 6400267..db388de 100644 --- a/coordinates_from_gpx_to_txt.py +++ b/coordinates_from_gpx_to_txt.py @@ -6,7 +6,7 @@ import logging def export_coordinates_gpx_file_as_string(file, prepend_file_name=False): gpx_file = open(file, "r") - logging.info(f"opening {gpx_file}") + logging.info("opening {}".format(gpx_file)) gpx = gpxpy.parse(gpx_file) str = "" @@ -46,14 +46,16 @@ def insert_coordinates_into_kml_file(kml_file, search_string, coordinate_string, for filename in os.listdir(os.getcwd()): if filename.lower().endswith(".xml") or filename.lower().endswith(".gpx"): + print("handling >{}<".format(filename)) coords_string = export_coordinates_gpx_file_as_string(filename) + print("inserting into europa_testkarte.kml") insert_coordinates_into_kml_file("europa_testkarte.kml", filename.split('.', 1)[0], coords_string) exit() def export_coordinates_gpx_file(file): gpx_file = open(file, "r") - logging.info(f"opening {gpx_file}") + logging.info("opening {}".format(gpx_file)) gpx = gpxpy.parse(gpx_file) coords = list()