from datetime import date,datetime
from dateutil.parser import isoparse
from pyrungps.parsegpx import write_parsed_to_db,check_db_for_training
-import pyrungps.pygpx
+from pyrungps.pygpx import GPX
from tempfile import NamedTemporaryFile
from pprint import pprint
-import pyrungps.render_tiles
+from pyrungps.render_tiles import queue_render
-import pyrungps.generate_image
+from pyrungps.generate_image import render_all
def get_page(uname,year,month):
if attribute == "href":
if link.startswith("/trainings/"):
dummy, dummy, link = link.split('/')
- name, id = link.split('_')
+ name, id, *_ = link.split('_')
trainings.append([ unquote(name), id ])
return trainings
if verbose:
print("writing training %s" % (filename))
- gpx = pygpx.GPX()
+ gpx = GPX()
gpx.ReadTree(xml)
sport = training['sport']
f.close
write_parsed_to_db(db,gpx,filename)
try:
- render_tiles.queue_render(db,filename)
+ queue_render(db,filename)
except:
None
if verbose:
print("writing training %s" % (filename))
- gpx = pygpx.GPX()
+ gpx = GPX()
gpx.ReadTree(xml)
sport = training['sport']
f.close
write_parsed_to_db(db,gpx,filename)
try:
- render_tiles.queue_render(db,filename)
+ queue_render(db,filename)
except:
None
if verbose:
print("writing training %s" % (filename))
- gpx = pygpx.GPX()
+ gpx = GPX()
gpx.ReadTree(xml)
sport = tr[0]
f.close
write_parsed_to_db(db,gpx,filename)
try:
- render_tiles.queue_render(db,filename)
+ queue_render(db,filename)
except:
None
elif dbauth:
sync_db(dbx,pusername,current_year,current_month,outdir,options.verbose,options.force)
- generate_image.render_all(db,'/etc/mapnik-osm-carto-data/veloroad-imposm.xml',640,640)
+ render_all(db,'/etc/mapnik-osm-carto-data/veloroad-imposm.xml',640,640)
if __name__ == "__main__":