Pārlūkot izejas kodu

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

Afwas [1337627 6 gadi atpakaļ
vecāks
revīzija
0fed96c031
2 mainītis faili ar 5 papildinājumiem un 4 dzēšanām
  1. 2 2
      _bs.py
  2. 3 2
      main.py

+ 2 - 2
_bs.py

@@ -54,7 +54,7 @@ def get_today_row(this_text, this_row):
             venue_text = cell.find('p').getText().strip()
             if len(venue_text) > 0:
                 # Cell is not empty
-                print(venue_text)
+                # print(venue_text)
                 this_a = cell.findAll('a')  # .get('href')
                 for a in this_a:
                     # There may be several links in a cell (which represents a state)
@@ -167,5 +167,5 @@ def process_scratchings(this_data, this_venue):
             scratchings.append(temp_list)
     assert len(scratchings) == int(scratchings_count), 'len(scratchings) {} == scratchings_count {}'.format(
         len(scratchings), scratchings_count)
-    pprint(scratchings)
+    # pprint(scratchings)
     return scratchings

+ 3 - 2
main.py

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