fix date string and introduce HTTP argument parsing

This commit is contained in:
fordprefect
2020-03-25 21:57:23 +01:00
parent cbc9f47a17
commit 5cf3361b57

View File

@@ -4,9 +4,10 @@ them as GPX Waypoints to a given output file in GPX format.
""" """
__author__ = "fordprefect" __author__ = "fordprefect"
__date__ = "2020-03-2 __date__ = "2020-03-25"
__version__ = "0.1" __version__ = "0.1"
import cgi
import gpxpy import gpxpy
import requests import requests
import os import os
@@ -44,6 +45,13 @@ verbosity = 0
######## end of configuration ######## end of configuration
##################################### #####################################
def get_arguments():
"""Wrapper for cgi-environment.
Takes no options, returns dict of arguments
"""
with cgi.FieldStorage() as args:
return {i: args.getvalue(i) for i in args}
## initialize gpx file ## initialize gpx file
if os.path.isfile(gpxfilename): if os.path.isfile(gpxfilename):
# open file and parse # open file and parse