changed to python2 for jnes

This commit is contained in:
2020-10-15 20:41:30 +02:00
parent f4eff5bcd0
commit 123f0fb8d6
3 changed files with 10 additions and 7 deletions

View File

@@ -10,4 +10,4 @@ gpxpy = "*"
pykml = "*"
[requires]
python_version = "3.8"
python_version = "2"

9
Pipfile.lock generated
View File

@@ -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": {

View File

@@ -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 = "<LineString><coordinates>"
@@ -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()