1) Dropbox API и сопутствующие изменения
[pyrungps.git] / parsegpx.py
index 5247c27d7ff7382966f67bbf2df36b8e3c41356c..5299fe0f1da253ea79826b75c0c8ac1247b67ce5 100644 (file)
@@ -10,6 +10,14 @@ import pyosmname
 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)