|
@@ -74,12 +74,22 @@ if __name__ == '__main__':
|
|
|
# report new scratching
|
|
# report new scratching
|
|
|
date_object = datetime.datetime.strptime(scratching.date, "%Y-%m-%d").date()
|
|
date_object = datetime.datetime.strptime(scratching.date, "%Y-%m-%d").date()
|
|
|
day_abbr = date_object.strftime('%a')
|
|
day_abbr = date_object.strftime('%a')
|
|
|
- message = 'New scratching: venue = {} {} {}-{} | race = {} | horse = {}'.format(day_abbr,
|
|
|
|
|
- scratching.date,
|
|
|
|
|
- scratching.state,
|
|
|
|
|
- scratching.venue,
|
|
|
|
|
- scratching.race,
|
|
|
|
|
- scratching.horse)
|
|
|
|
|
|
|
+ query = """
|
|
|
|
|
+ SELECT start_time, utctime FROM race_program
|
|
|
|
|
+ WHERE race_date = %s AND
|
|
|
|
|
+ venue = %s AND
|
|
|
|
|
+ race = %s;
|
|
|
|
|
+ """
|
|
|
|
|
+ cursor.execute(query, (scratching.date, scratching.venue, scratching.race))
|
|
|
|
|
+ db_data = cursor.fetchone()
|
|
|
|
|
+ message = 'venue = {} {} {}-{} | race = {} {} | {} UTC | horse = {}'.format(day_abbr,
|
|
|
|
|
+ scratching.date,
|
|
|
|
|
+ scratching.state,
|
|
|
|
|
+ scratching.venue,
|
|
|
|
|
+ scratching.race,
|
|
|
|
|
+ db_data.start_time,
|
|
|
|
|
+ db_data.utctime,
|
|
|
|
|
+ scratching.horse)
|
|
|
print(message)
|
|
print(message)
|
|
|
if broadcast:
|
|
if broadcast:
|
|
|
view.broadcast(message)
|
|
view.broadcast(message)
|