diff --git a/ImportSchweizmobil.py b/ImportSchweizmobil.py index a963f88..ab2f0de 100644 --- a/ImportSchweizmobil.py +++ b/ImportSchweizmobil.py @@ -298,7 +298,7 @@ def Import_Schweizmobil(): if (latmin>float(Filter["MaxLat"]) or latmax1: - print (f"skipping track {iid} because of latitude filter"); + print (f"skipping track {iid} because of latitude filter") continue # prepare feature structure @@ -317,8 +317,8 @@ def Import_Schweizmobil(): }, 'properties': newprops } - - if (opo==1): + + if opo==1: feature={ 'type':'Feature', 'geometry': { diff --git a/main.py b/TrackMapper.pyw similarity index 91% rename from main.py rename to TrackMapper.pyw index 4080da8..9f09667 100644 --- a/main.py +++ b/TrackMapper.pyw @@ -1,3 +1,14 @@ +""" +schweizmobil.ch is a service to discover and plan (mostly) hiking/biking tracks in Switzerland. Viewing tracks does not require a paid subscription, drawing own tracks does. The schweizmobil.ch UI is great but unfortunately can only show one of the user-created tracks at a time. I have 300+ tracks and struggle to keep the overview of what I planned/did in a given region. + +So, this project .. + +- uses the schweizmobil.ch API described at https://github.com/JoeggiCH/schweizmobil.ch-API to download all tracks of a given user (with a paid subscription) +- allows users to filter tracks based on a number of criteria, such as the hike/bike length in kilometers, duration, meters uphill etc +- converts tracks into WGS84 coordinates and a GeoJSON FeatureCollection +- renders the FeatureCollection in a browser-viewable map (using python folium and leaflet.js) + +""" import PySimpleGUI as sg from datetime import datetime import ImportSchweizmobil as IS @@ -253,8 +264,11 @@ def showMain(): if event=="Publish": os.chdir(IS.outfp) script_dir = os.path.abspath( os.path.dirname( __file__ ) ) - os.system(f"{script_dir}\\update_web.bat {IS.outfp} >>{IS.outfp}update_web.log") - #os.system(IS.outfp+"update_web.bat >>update_web.log") + winpath=IS.outfp.replace("/","\\") + cmd=f"\"\"{script_dir}\\update web.bat\" \"{winpath}\" >>\"{winpath}update web.log\"\"" + if debug>0: print (cmd) + os.system(cmd) + continue if event=="OpenLocal": diff --git a/encryption.py b/encryption.py index 8c9894e..7c704ba 100644 --- a/encryption.py +++ b/encryption.py @@ -1,3 +1,9 @@ +""" +encryption.py uses the fernet module to encrypt the configuration file - including +the API passwords - in TrackMapper + +""" + # https://cryptography.io/en/latest/ # https://www.pythoninformer.com/python-libraries/cryptography/fernet/ diff --git a/update_web.bat b/update web.bat similarity index 76% rename from update_web.bat rename to update web.bat index 8db2b98..dd1793e 100644 --- a/update_web.bat +++ b/update web.bat @@ -2,6 +2,8 @@ REM this is an example of a batch to publish html\map.html on a webpage REM please adjust it to your needs! +echo =========================================================== +echo new pub request date /t time /t cd %1