#NEWLINE# def scan_api( controller , path = [ ] , objects = [ ] ) : #NEWLINE# #INDENT# '\n    Recursively iterate a controller api entries.\n    ' #NEWLINE# for name in dir ( controller ) : #NEWLINE# #INDENT# if name . startswith ( '_' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# a = getattr ( controller , name ) #NEWLINE# if ( a in objects ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if inspect . ismethod ( a ) : #NEWLINE# #INDENT# if wsme . api . iswsmefunction ( a ) : #NEWLINE# #INDENT# ( yield ( ( path + [ name ] ) , a , [ ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if inspect . isclass ( a ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( path ) > APIPATH_MAXLEN ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Path is too long: ' + str ( path ) ) ) #NEWLINE# #UNINDENT# for i in scan_api ( a , ( path + [ name ] ) , ( objects + [ a ] ) ) : #NEWLINE# #INDENT# ( yield i )