|
|
@@ -6,7 +6,6 @@ import database
|
|
|
import sys
|
|
|
import view
|
|
|
|
|
|
-
|
|
|
if __name__ == '__main__':
|
|
|
row = -1
|
|
|
if len(sys.argv) > 1:
|
|
|
@@ -68,18 +67,18 @@ if __name__ == '__main__':
|
|
|
found_in_database = True
|
|
|
if not found_in_database:
|
|
|
# report new scratching
|
|
|
- message = 'New scratching: date = {} | venue = {}-{} | race = {} | horse = {}'.format(scratching.date,
|
|
|
- scratching.state,
|
|
|
- scratching.venue,
|
|
|
- scratching.race,
|
|
|
- scratching.horse)
|
|
|
+ message = 'New scratching: venue = {} {}-{} | race = {} | horse = {}'.format(scratching.date,
|
|
|
+ scratching.state,
|
|
|
+ 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)"
|
|
|
cursor.execute(query, (scratching.venue, scratching.date,
|
|
|
scratching.race, scratching.horse))
|
|
|
- db.commit()
|
|
|
+ db.commit()
|
|
|
cursor.close()
|
|
|
db.close()
|
|
|
|