Skip to content

Commit

Permalink
allow pipes access to option arguments as args
Browse files Browse the repository at this point in the history
  • Loading branch information
leifj committed Jan 9, 2018
1 parent d646e09 commit 6850f2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pyff/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def fetch(self, store=None):
if self.t is not None:
self.last_seen = datetime.now()
if self.post is not None:
self.t = self.post(self.t)
self.t = self.post(self.t, **self.opts)

if self.is_expired():
info['Expired'] = True
Expand Down
6 changes: 3 additions & 3 deletions src/pyff/pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __call__(self, *args, **kwargs):
if t is None:
raise ValueError("PipelineCallback must be called with a parse-tree argument")
try:
return self.plumbing.process(self.req.md, store=self.store, state={self.entry_point: True}, t=t)
return self.plumbing.process(self.req.md, args=kwargs, store=self.store, state={self.entry_point: True}, t=t)
except Exception as ex:
traceback.print_exc(ex)
raise ex
Expand Down Expand Up @@ -227,7 +227,7 @@ def process(self, pl):
break
return self.t

def process(self, md, state=None, t=None, store=None):
def process(self, md, args=None, state=None, t=None, store=None):
"""
The main entrypoint for processing a request pipeline. Calls the inner processor.
Expand All @@ -241,7 +241,7 @@ def process(self, md, state=None, t=None, store=None):
if not state:
state = dict()

return Plumbing.Request(self, md, t, state=state, store=store).process(self)
return Plumbing.Request(self, md, t, args=args, state=state, store=store).process(self)

def iprocess(self, req):
"""The inner request pipeline processor.
Expand Down

0 comments on commit 6850f2e

Please sign in to comment.