ソースを参照

Refactor this_venue.date and remove debug prints

Foppe Hemminga 6 年 前
コミット
2e85f6fe65
1 ファイル変更2 行追加30 行削除
  1. 2 30
      _bs.py

+ 2 - 30
_bs.py

@@ -114,42 +114,14 @@ def get_meta_data(this_data, this_venue):
             times[1] = model.convert_to_unixtime(aest.localize(l_time))
             # print(times[1])
         match = close_regex.search(this_meta_data)
-        utctime = datetime.datetime.utcnow()
-        if (utctime.hour in (15, 16, 17, 18) and utctime.minute > 49) or \
-                (utctime.hour in (16, 17, 18, 19) and utctime.minute < 11):
-            print_it = True
-            print('utctime: {}'.format(utctime))
-
         if match:
-            print_it = False
-            if '-19 ' not in match.group(1):
-                print_it = True
-            if print_it or not match.group(1):
-                print_it = True
-                print('match.group(1): {}'.format(match.group(1)))
             times[2] = match.group(1)[:-5]
             l_time = datetime.datetime.strptime(times[2], time_format)
-            if print_it:
-                print('match.group(1)[:5], {}'.format(match.group(1)[:5]))
-                print('l_time: {}'.format(l_time))
-                print('aest.localize(l_time); {}'.format(aest.localize(l_time)))
             times[3] = model.convert_to_unixtime(aest.localize(l_time))
-            if print_it or times[3] < 1e6:
-                print('times[3]: {}'.format(times[3]))
-                print_it = True
-            # print(times[3])
-            if print_it or times[3] < 1e6:
-                print_it = True
-                print('datetime.date.fromtimestamp(times[3]+12*60*60): {}'.format(
-                    datetime.date.fromtimestamp(times[3] + 12 * 60 * 60)))
-        elif print_it:
-            print('this_meta_data: {}'.format(this_meta_data))
-            print('No match for regex: {}'.format(close_regex))
-            pprint(times)
     # The RaceDAy namedTuple is created and filled
     race_day = RaceDay(this_venue.state, this_venue.name, this_venue.date_string,
-                       datetime.date.fromtimestamp(times[3] + 12 * 60 * 60),
-                       this_venue.scratchings_url, times[0], times[1], times[2], times[3])
+                       this_venue.date,  this_venue.scratchings_url,
+                       times[0], times[1], times[2], times[3])
     return race_day