Browse Source

Remove debug prints

Toni Fadjukoff 8 years ago
parent
commit
63770c92b3
2 changed files with 3 additions and 13 deletions
  1. 3 4
      campusravita.py
  2. 0 9
      food.py

+ 3 - 4
campusravita.py View File

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

+ 0 - 9
food.py View File

148
 def write_day(day, header, outfname, last_day, restaurants, prefix, resources_prefix):
148
 def write_day(day, header, outfname, last_day, restaurants, prefix, resources_prefix):
149
     with open(outfname, "w", encoding="utf-8") as fout:
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
         fout.write(file_header.format(resources_prefix=resources_prefix))
151
         fout.write(file_header.format(resources_prefix=resources_prefix))
161
         fout.write("<h1>{header}</h1>\n".format(header=header))
152
         fout.write("<h1>{header}</h1>\n".format(header=header))
162
         # print weekday links
153
         # print weekday links