factorise

This commit is contained in:
Juke 2011-03-07 09:44:02 +01:00 committed by Romain Bignon
commit 397b5875f1
9 changed files with 59 additions and 54 deletions

View file

@ -45,11 +45,7 @@ class Newspaper20minutesBrowser(BaseBrowser):
url = id2url(_id)
except ValueError:
url = _id
try:
self.location(url)
except IndexError:
if _id == '':
raise ValueError("thread id is empty")
else:
raise
return self.page.get_article(_id)
self.location(url)
if self.page is not None:
return self.page.get_article(_id)