|
|
@@ -1,6 +1,6 @@
|
|
|
import psycopg2.extras
|
|
|
import model
|
|
|
-from pprint import pprint
|
|
|
+#from pprint import pprint
|
|
|
import time
|
|
|
import database
|
|
|
import sys
|
|
|
@@ -32,7 +32,7 @@ if __name__ == '__main__':
|
|
|
raw_data_dict[race_day.name] = raw_data
|
|
|
interim = time.time()
|
|
|
print('interim 2 {}'.format(interim - start))
|
|
|
- pprint(race_days)
|
|
|
+ # pprint(race_days)
|
|
|
cursor = db.cursor(cursor_factory=psycopg2.extras.NamedTupleCursor)
|
|
|
for race_day in race_days:
|
|
|
if not raw_data_dict or not race_day:
|
|
|
@@ -70,6 +70,7 @@ if __name__ == '__main__':
|
|
|
# report new scratching
|
|
|
message = 'New scratching: {} {} race {} horse {}'.format(scratching.date, scratching.venue,
|
|
|
scratching.race, scratching.horse)
|
|
|
+ print(message)
|
|
|
view.broadcast(message)
|
|
|
# store new scratching
|
|
|
query = "INSERT INTO horses(venue, race_date, race, horse) VALUES(%s, %s, %s, %s)"
|