瀏覽代碼

Properly add if statements for _debug

Foppe Hemminga 6 年之前
父節點
當前提交
ab625e2b91
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      model.py

+ 4 - 2
model.py

@@ -115,7 +115,8 @@ def extract_hospital_time(this_message_text, _debug=False):
     seconds_plus = 0
     if 'hospital' in this_message_text[0]:
         time_text = this_message_text[0][15:]
-        print(time_text)
+        if _debug:
+            print(time_text)
         m = re.match(regex, time_text)
         if m:
             if m.group('hours'):
@@ -124,7 +125,8 @@ def extract_hospital_time(this_message_text, _debug=False):
                 minutes_plus = m.group('minutes')
             if m.group('seconds'):
                 seconds_plus = m.group('seconds')
-        print(f'Extracted {hours_plus} hrs and {minutes_plus} mins and {seconds_plus} secs')
+        if _debug:
+            print(f'Extracted {hours_plus} hrs and {minutes_plus} mins and {seconds_plus} secs')
     try:
         hours += int(hours_plus)
         minutes += int(minutes_plus)