From cc4dd1cbf8ce958b6313d019a1b35c00ae24d63c Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Mon, 19 Sep 2011 22:14:37 +0200 Subject: [PATCH] rename WSRoot.debug to WSRoot._debug to avoid an infinite recursion when scanning the api (which will need a better implementation anyway) --- wsme/controller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wsme/controller.py b/wsme/controller.py index 2b2484b..5ab4dd2 100644 --- a/wsme/controller.py +++ b/wsme/controller.py @@ -17,6 +17,8 @@ def scan_api(controller, path=[]): if hasattr(a, '_wsme_definition'): yield path, a._wsme_definition else: + if len(path) < 10: + print path for i in scan_api(a, path + [name]): yield i @@ -83,7 +85,7 @@ class validate(object): class WSRoot(object): def __init__(self, protocols=None): - self.debug = True + self._debug = True if protocols is None: protocols = registered_protocols.keys() self.protocols = {} @@ -112,7 +114,7 @@ class WSRoot(object): else: r = dict(faultcode="Server", faultstring=str(excinfo[1])) - if self.debug: + if self._debug: r['debuginfo'] = ("Traceback:\n%s\n" % "\n".join(traceback.format_exception(*excinfo))) return r