From 514f927a5666e2dcda056f7bb4aadc920bc10cc9 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Fri, 10 Feb 2017 05:50:32 -0800 Subject: [PATCH] Revert removing call. This class likely needs to be callable. --- service/eveapi.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/service/eveapi.py b/service/eveapi.py index 11a837994..c4ac681a0 100644 --- a/service/eveapi.py +++ b/service/eveapi.py @@ -346,6 +346,19 @@ class _Context(object): # perform arcane attribute majick trick return _Context(self._root, self._path + "/" + this, self.parameters) + def __call__(self, **kw): + if kw: + # specified keywords override contextual ones + for k, v in self.parameters.iteritems(): + if k not in kw: + kw[k] = v + else: + # no keywords provided, just update with contextual ones. + kw.update(self.parameters) + + # now let the root context handle it further + return self._root(self._path, **kw) + class _AuthContext(_Context): def character(self, characterID):