def GetXMLDescr(lat,lon):
- req = urllib2.Request("http://nominatim.openstreetmap.org/reverse?lat=%s&lon=%s&accept-language=ru,en" %(lat,lon), None, {'User-agent': 'Mozilla/5.0'})
+ req = urllib2.Request("http://nominatim.openstreetmap.org/reverse?lat=%s&lon=%s&accept-language=ru,en" %(lat,lon), None)
page = urllib2.urlopen(req).read()
return etree.fromstring(page)
for tr in training_list:
filename = "%s/%04d/%02d/%s_%s.gpx" % (dir,year,(month+1),tr[0],tr[1])
+ dirname = "%s/%04d/%02d" % (dir,year,(month+1))
if os.path.exists(filename) and not force:
print "training %s exists, skipping" % (filename)
else:
-
+
+ try:
+ os.mkdir(dirname)
+ except:
+ None
+
xml=get_gpx_track(tr[1],tr[0])
if verbose: