Commits

Frederic De Groef committed f3d6c69

exception handling is back

Comments (0)

Files changed (2)

src/gehol/coursecalendar.py

 
 
     def _load_events(self):
-        #try:
-        self.metadata = self._extract_header(self.html_content)
-        self.events = self._extract_table(self.html_content)
-        #except AttributeError, e:
-        #    raise e
-            #self._guess_query_error(self.html_content)
+        try:
+            self.metadata = self._extract_header(self.html_content)
+            self.events = self._extract_table(self.html_content)
+        except AttributeError, e:
+            self._guess_query_error(self.html_content)
 
 
 

src/gehol/studentsetcalendar.py

 
 
     def _load_content_from_soup(self, soup):
-        #try:
-        top_level_tables = soup.html.body.findAll(name="table", recursive=False)
-        # Take only the first 3 top-level tables. Sometimes the html is
-        # broken and we don't get the 4th.
-        # We also don't get the closing tags. This piece of software is
-        # pretty brilliant
-        header, event_grid, footer = top_level_tables[:3]
+        try:
+            top_level_tables = soup.html.body.findAll(name="table", recursive=False)
+            # Take only the first 3 top-level tables. Sometimes the html is
+            # broken and we don't get the 4th.
+            # We also don't get the closing tags. This piece of software is
+            # pretty brilliant
+            header, event_grid, footer = top_level_tables[:3]
 
-        self._load_header_data(header)
-        self._load_events(event_grid)
-        #except AttributeError,e:
-        #    self._guess_query_error(self.html_content)
-        #except ValueError,e:
-        #    self._guess_query_error(self.html_content)
+            self._load_header_data(header)
+            self._load_events(event_grid)
+        except AttributeError,e:
+            self._guess_query_error(self.html_content)
+        except ValueError,e:
+            self._guess_query_error(self.html_content)
             
     def _load_header_data(self, header):
         all_entries = header.findAll(name='table')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.