summaryrefslogtreecommitdiff
path: root/cherrypy/lib/cptools.py
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2006-04-19 18:31:43 +0000
committerRobert Brewer <fumanchu@aminus.org>2006-04-19 18:31:43 +0000
commitd7326545c186da9a78723d9d09509edcd5d7818b (patch)
treed991d0244d1011774692a1310ff84bd07f0d1497 /cherrypy/lib/cptools.py
parent2b6e4338e734d240967af20d088f53ca95daa247 (diff)
downloadcherrypy-git-d7326545c186da9a78723d9d09509edcd5d7818b.tar.gz
Added CallFunc and NoneType to unrepr. This allows object instantiation in config files.
Diffstat (limited to 'cherrypy/lib/cptools.py')
-rw-r--r--cherrypy/lib/cptools.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/cherrypy/lib/cptools.py b/cherrypy/lib/cptools.py
index c059fac7..0ebd5689 100644
--- a/cherrypy/lib/cptools.py
+++ b/cherrypy/lib/cptools.py
@@ -269,6 +269,10 @@ class Builder:
raise UnknownType(o.__class__.__name__)
return m(o)
+ def build_CallFunc(self, o):
+ callee, args, starargs, kwargs = map(self.build, o.getChildren())
+ return callee(args, *(starargs or ()), **(kwargs or {}))
+
def build_List(self, o):
return map(self.build, o.getChildren())
@@ -314,6 +318,9 @@ class Builder:
def build_Getattr(self, o):
parent = self.build(o.expr)
return getattr(parent, o.attrname)
+
+ def build_NoneType(self, o):
+ return None
def unrepr(s):