use logger instead of print in modules
This commit is contained in:
parent
d576fd19c8
commit
ca7fd3c7f2
4 changed files with 5 additions and 8 deletions
|
|
@ -33,10 +33,8 @@ class LoginPage(BasePage):
|
|||
success_p = self.document.xpath(
|
||||
'//p[text() = "Login Successful. You will be returned momentarily."]')
|
||||
if len(success_p):
|
||||
print 'logged on'
|
||||
return True
|
||||
else:
|
||||
print 'not logged on'
|
||||
return False
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ class LoginPage(BasePage):
|
|||
msga = ''.join(msgb)
|
||||
msg = msga.strip("\n")
|
||||
|
||||
if "maintenance" in msg:
|
||||
print "Fortuneo: "+msg
|
||||
if "maintenance" in msg:
|
||||
raise BrowserUnavailable(msg)
|
||||
|
||||
self.browser.select_form(nr=3)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class IndexPage(BasePage):
|
|||
url = title.attrib['href']
|
||||
m = re.match('^http://www.pluzz.fr/([^/]+)\.html$', url)
|
||||
if not m:
|
||||
print ':( %s' % url
|
||||
self.logger.debug('url %s does not match' % url)
|
||||
continue
|
||||
_id = m.group(1)
|
||||
video = PluzzVideo(_id)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class IndexPage(BasePage):
|
|||
url = a.attrib['href']
|
||||
m = re.match('/video-(.*)', url)
|
||||
if not m:
|
||||
print ':( %s' % url
|
||||
self.logger.debug('url %s does not match' % url)
|
||||
continue
|
||||
_id = m.group(1)
|
||||
video = TricTracTVVideo(_id)
|
||||
|
|
@ -51,7 +51,7 @@ class IndexPage(BasePage):
|
|||
video.rating_max = 5
|
||||
|
||||
video.thumbnail = Thumbnail ( unicode ( 'http://www.trictrac.tv/%s' % url ) )
|
||||
|
||||
|
||||
yield video
|
||||
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ class VideoPage(BasePage):
|
|||
months = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]
|
||||
words = string.split ( ' ' )
|
||||
month_no = months.index ( words [ 1 ] ) + 1
|
||||
return datetime.datetime.strptime ( ( '%s %s %s %s' %
|
||||
return datetime.datetime.strptime ( ( '%s %s %s %s' %
|
||||
( words [ 0 ], month_no, words [ 2 ], words [ 3 ] ) ),
|
||||
'%d %m %Y, %H:%M:%S')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue