def register_api_routes(application, register):
 log.info('installing application routes:')
 methods = inspect.getmembers(application)
 methods = filter((lambda n: (not n[0].startswith('_'))), methods)
 for (method, func) in dict(methods).iteritems():
  pieces = method.split('_')
  (verb, path) = (pieces[0], pieces[1:])
  args = inspect.getargspec(func).args[1:]
  args = [('<%s>' % arg) for arg in args]
  args = '/'.join(args)
  args = ('' if (len(args) == 0) else ('/' + args))
  path.insert(0, application._namespace)
  path = ('/'.join(path) + args)
  log.info(('%6s: %s' % (verb, path)))
  register.route(path, method=verb, name=method)(func)

def register_api_routes ( application , register ) : log . info ( 'installing application routes:' ) methods = inspect . getmembers ( application ) methods = filter ( ( lambda n : ( not n [ 0 ] . startswith ( '_' ) ) ) , methods ) for ( method , func ) in dict ( methods ) . iteritems ( ) : pieces = method . split ( '_' ) ( verb , path ) = ( pieces [ 0 ] , pieces [ 1 : ] ) args = inspect . getargspec ( func ) . args [ 1 : ] args = [ ( '<%s>' % arg ) for arg in args ] args = '/' . join ( args ) args = ( '' if ( len ( args ) == 0 ) else ( '/' + args ) ) path . insert ( 0 , application . _namespace ) path = ( '/' . join ( path ) + args ) log . info ( ( '%6s: %s' % ( verb , path ) ) ) register . route ( path , method = verb , name = method ) ( func )
a helper method to register the routes of an application based on convention .