Bladeren bron

Merge branch 'master' of https://git.fop.pe/Foppe/scratchings

Afwas [1337627 6 jaren geleden
bovenliggende
commit
0349d5626b
1 gewijzigde bestanden met toevoegingen van 6 en 7 verwijderingen
  1. 6 7
      main.py

+ 6 - 7
main.py

@@ -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()