Skip to content

Instantly share code, notes, and snippets.

@shiweifu
Created June 1, 2012 09:55
Show Gist options
  • Save shiweifu/2850877 to your computer and use it in GitHub Desktop.
Save shiweifu/2850877 to your computer and use it in GitHub Desktop.
down_page_callable
def down_page_callable(**kw):
try:
_task_queue = kw["task_queue"]
_url_list = kw["url_list"]
_log_queue = kw["log_queue"]
_deeph = kw["deeph"]
_filter_exts = kw["filter_exts"],
_root = kw["root"]
except KeyError, ke:
raise ParamsError
try:
task = _task_queue.get(timeout=3)
except Queue.Empty:
return
page = _get_page(task)
if page == None:
_task_queue.task_done()
return
_parse_page(page, task, _task_queue, _url_list)
_task_queue.task_done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment