Ejemplo n.º 1
0
 def __init__(self, crawler, stage, state):
     self.crawler = crawler
     self.stage = stage
     self.state = state
     self.params = stage.params
     self.incremental = state.get('incremental')
     self.run_id = state.get('run_id') or uuid.uuid1().hex
     self.operation_id = None
     self.log = logging.getLogger('%s.%s' % (crawler.name, stage.name))
     self.http = ContextHttp(self)
     self.datastore = datastore
Ejemplo n.º 2
0
 def __init__(self, crawler, stage, state):
     self.crawler = crawler
     self.stage = stage
     self.state = state
     self.params = stage.params
     self.incremental = state.get("incremental")
     self.run_id = state.get("run_id") or uuid.uuid1().hex
     self.work_path = mkdtemp()
     self.log = logging.getLogger("%s.%s" % (crawler.name, stage.name))
     self.http = ContextHttp(self)
     self.datastore = datastore
     self.check = ContextCheck(self)
Ejemplo n.º 3
0
def http():
    return ContextHttp(context())
Ejemplo n.º 4
0
def http():
    return ContextHttp(get_context())