Skip to content

Commit

Permalink
debug option erweitert
Browse files Browse the repository at this point in the history
  • Loading branch information
chriszero committed Sep 2, 2013
1 parent 6480138 commit 5973a11
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tvsp2xmltv/tvsGrabber.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,19 @@ def __grab_day(self, date, tvsp_id, channel_id):
data = self._get_category(date, [] + tvsp_id)
for s in data:
# Im Falle eines Fehlers beim grabben
try:
if not defaults.debug:
try:
progData = self._get_detail(s['sendungs_id'])
prog = model.Programme(progData, channel_id, self.pictures)
self.xmltv_doc.append_element(prog)
except Exception as e:
logger.log("Failed to fetch Details for " + s['sendungs_id'] + " on Channel " + tvsp_id, logger.MESSAGE)
logger.log("Pausing for 30 seconds.", logger.MESSAGE)
from time import sleep

sleep(30)

else:
progData = self._get_detail(s['sendungs_id'])
prog = model.Programme(progData, channel_id, self.pictures)
self.xmltv_doc.append_element(prog)
except Exception as e:
logger.log("Failed to fetch Details for " + s['sendungs_id'] + " on Channel " + tvsp_id, logger.MESSAGE)
logger.log("Pausing for 30 seconds.", logger.MESSAGE)
from time import sleep

sleep(30)

0 comments on commit 5973a11

Please sign in to comment.