Foppe Hemminga %!s(int64=6) %!d(string=hai) anos
pai
achega
aaefe71c63
Modificáronse 1 ficheiros con 14 adicións e 12 borrados
  1. 14 12
      main.py

+ 14 - 12
main.py

@@ -63,10 +63,11 @@ if __name__ == '__main__':
                         int(scratching.race) == int(row.race) and
                         scratching.horse == row.horse
                 ):
-                    message = 'Horse found: date = {}, venue = {}, race = {}, horse = {}'.format(scratching.date,
-                                                                                                 scratching.venue,
-                                                                                                 scratching.race,
-                                                                                                 scratching.horse)
+                    message_string = 'Horse found: date = {}, venue = {}, race = {}, horse = {}'
+                    message = message_string.format(scratching.date,
+                                                    scratching.venue,
+                                                    scratching.race,
+                                                    scratching.horse)
                     # print(message)
                     # print(row)
                     found_in_database = True
@@ -82,14 +83,15 @@ if __name__ == '__main__':
                 """
                 cursor.execute(query, (scratching.date, scratching.venue, scratching.race))
                 db_data = cursor.fetchone()
-                message = 'venue = {} {} {}-{} | race = {} starts at {} | {} UTC | horse = {}'.format(day_abbr,
-                                                                                                      scratching.date,
-                                                                                                      scratching.state,
-                                                                                                      scratching.venue,
-                                                                                                      scratching.race,
-                                                                                                      db_data.start_time,
-                                                                                                      db_data.utctime,
-                                                                                                      scratching.horse)
+                message_string = 'venue = {} {} {}-{} | race = {} starts at {} | {} UTC | horse = {}'
+                message = message_string.format(day_abbr,
+                                                scratching.date,
+                                                scratching.state,
+                                                scratching.venue,
+                                                scratching.race,
+                                                db_data.start_time,
+                                                db_data.utctime,
+                                                scratching.horse)
                 print(message)
                 if broadcast:
                     view.broadcast(message)