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
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)
def http(): return ContextHttp(context())
def http(): return ContextHttp(get_context())