Created
June 1, 2012 09:55
-
-
Save shiweifu/2850877 to your computer and use it in GitHub Desktop.
down_page_callable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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