wsme/wsmeext/tg15.py
Christophe de Vienne 8736089dc9 Moved non-core features to the wsmeext namespace package
--HG--
rename : wsme/cornice.py => wsmeext/cornice.py
rename : wsme/pecan.py => wsmeext/pecan.py
rename : wsme/sphinxext.py => wsmeext/sphinxext.py
rename : wsme/tg1.py => wsmeext/tg1.py
rename : wsme/tg11.py => wsmeext/tg11.py
rename : wsme/tg15.py => wsmeext/tg15.py
2013-01-17 13:15:25 +01:00

21 lines
481 B
Python

import cherrypy
from wsmeext.tg1 import wsexpose, wsvalidate
import wsmeext.tg1
__all__ = ['adapt', 'wsexpose', 'wsvalidate']
def scan_api(root=None):
for baseurl, instance in cherrypy.tree.apps.items():
path = [token for token in baseurl.split('/') if token]
for i in wsmeext.tg1._scan_api(instance.root, path):
yield i
def adapt(wsroot):
wsroot._scan_api = scan_api
controller = wsmeext.tg1.Controller(wsroot)
return controller