Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
qinxuye committed Jul 22, 2013
1 parent 2f68789 commit c2feee5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cola/worker/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 189,7 @@ def _execute_bundle(self, obj, opener=None):
bundle = self.job.unit_cls(obj)
urls = bundle.urls()

url = None
try:
while len(urls) > 0 and not self.stopped:
url = urls.pop(0)
Expand All @@ -215,6 216,8 @@ def _execute_bundle(self, obj, opener=None):
self.error(obj)
except Exception, e:
self.error_times = 1
if self.logger is not None and url is not None:
self.logger.error('Error when fetch url: %s' % url)
self._log_error(obj, e)
self.error(obj)

Expand Down
4 changes: 2 additions & 2 deletions contrib/weibo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 33,8 @@
from bundle import WeiboUserBundle

def login_hook(opener, **kw):
username = kw['username']
passwd = kw['password']
username = str(kw['username'])
passwd = str(kw['password'])

loginer = WeiboLogin(opener, username, passwd)
return loginer.login()
Expand Down
4 changes: 2 additions & 2 deletions contrib/weibo/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 199,9 @@ def parse(self, url=None):
weibo_user.save()

# if not has next page
#if len(divs) < count:
if len(divs) == 0:
weibo_user.newest_mid = params['end_id']
if 'end_id' in params:
weibo_user.newest_mid = params['end_id']
weibo_user.save()
return [], []

Expand Down

0 comments on commit c2feee5

Please sign in to comment.