projects
/
pyrungps.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Переход на UTF8.
[pyrungps.git]
/
parsegpx.py
diff --git
a/parsegpx.py
b/parsegpx.py
index 5247c27d7ff7382966f67bbf2df36b8e3c41356c..25161c8d761517d5d46122d777c71fe8efb022e3 100644
(file)
--- a/
parsegpx.py
+++ b/
parsegpx.py
@@
-6,10
+6,18
@@
import os
from lxml import etree
from urllib2 import unquote
import pygpx
from lxml import etree
from urllib2 import unquote
import pygpx
-import py
osmnam
e
+import py
geocod
e
import sqlite3
import datetime
import sqlite3
import datetime
+def check_db_for_training(db,sport,timestamp):
+
+ conn = sqlite3.connect(db)
+ cur = conn.cursor()
+
+ cur.execute ("select count(*) from tracks where sport=? and start_time=?" , (sport,timestamp))
+ return cur.fetchall()[0][0]
+
def write_parsed_to_db(db,gpx,filename):
conn = sqlite3.connect(db)
def write_parsed_to_db(db,gpx,filename):
conn = sqlite3.connect(db)
@@
-44,7
+52,7
@@
def write_parsed_to_db(db,gpx,filename):
print "processing..."
start = track.start()
if start:
print "processing..."
start = track.start()
if start:
- printable = py
osmnam
e.GeoName(start.lat,start.lon).printable
+ printable = py
geocod
e.GeoName(start.lat,start.lon).printable
start_time = track.start_time()
full_duration = track.full_duration().total_seconds()
distance = track.distance()
start_time = track.start_time()
full_duration = track.full_duration().total_seconds()
distance = track.distance()