Przeglądaj źródła

Remove debug prints

Toni Fadjukoff 8 lat temu
rodzic
commit
63770c92b3
2 zmienionych plików z 3 dodań i 13 usunięć
  1. 3 4
      campusravita.py
  2. 0 9
      food.py

+ 3 - 4
campusravita.py Wyświetl plik

@@ -113,10 +113,10 @@ class CampusravitaHTMLParser(html.parser.HTMLParser):
113 113
             self.lunch_type_match = bool(lunch_match)
114 114
 
115 115
     def handle_menu_start(self):
116
-        print("*********** menu start")
116
+        pass
117 117
 
118 118
     def handle_menu_end(self):
119
-        print("*********** menu end")
119
+        pass
120 120
 
121 121
     def handle_allergy(self, data):
122 122
         data = data.strip()
@@ -136,12 +136,11 @@ class CampusravitaHTMLParser(html.parser.HTMLParser):
136 136
 
137 137
     def handle_lunch_start(self):
138 138
         if self.lunch_type_match:
139
-            print("lunch start")
140 139
             self.lunch = {"food": [], "allergies": []}
141 140
 
142 141
     def handle_lunch_end(self):
143 142
         if self.lunch:
144
-            print(repr(self.lunch).encode("cp1252", "ignore"))
143
+            #print(repr(self.lunch).encode("cp1252", "ignore"))
145 144
             menu = "{menu} ({allergies})".format(menu=self.lunch["food"][0], allergies=", ".join(self.lunch["allergies"]))
146 145
             self.current_day.append(menu)
147 146
             self.lunch = None

+ 0 - 9
food.py Wyświetl plik

@@ -148,15 +148,6 @@ def write_prefix_header(fout, prefix, day, resources_prefix):
148 148
 def write_day(day, header, outfname, last_day, restaurants, prefix, resources_prefix):
149 149
     with open(outfname, "w", encoding="utf-8") as fout:
150 150
 
151
-
152
-        import types
153
-        def write(self, writable):
154
-            #print("Writing {}: {}".format(type(writable), writable))
155
-            self.write_orig(writable)
156
-        fout.write_orig = fout.write
157
-        fout.write = types.MethodType(write, fout)
158
-
159
-
160 151
         fout.write(file_header.format(resources_prefix=resources_prefix))
161 152
         fout.write("<h1>{header}</h1>\n".format(header=header))
162 153
         # print weekday links