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