Skip to content

Instantly share code, notes, and snippets.

@AstraLuma
Created March 12, 2013 06:23
Show Gist options
  • Save AstraLuma/5140758 to your computer and use it in GitHub Desktop.
Save AstraLuma/5140758 to your computer and use it in GitHub Desktop.
def __getattr__(self, name):
return lambda *p, **kw: self.callapi(name, *p, **kw)
def callapi(self, name, *p, **kw):
if 'context' in kw:
context = kw['context']
del kw['context']
else:
context = self.getContext()
# ... call modules
def context(self, context):
return WrappedWillie(context)
def __getattr__(self, name):
return lambda *p, **kw: self.callapi(name, *p, **kw)
def callapi(self, name, *p, **kw):
context = self.getContext()
# ... call modules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment