'Called when a task is selected to fetch & process'

def on_select_task(self, task):

    logger.info('select    %(project)s:%(taskid)s    %(url)s', task)
    project_info = self.projects.get(task['project'])
    assert project_info, 'no    such    project'
    task['type'] = self.TASK_PACK
    task['group'] = project_info.group
    task['project_md5sum'] = project_info.md5sum
    task['project_updatetime'] = project_info.updatetime
    if getattr(project_info, 'crawl_config', None):
        task = BaseHandler.task_join_crawl_config(task, project_info.crawl_config)
    project_info.active_tasks.appendleft((time.time(), task))
    self.send_task(task)
    return task
