def getRoutes(app):
 for rule in app._url_map.iter_rules():
  methods = rule.methods.difference(['HEAD'])
  path = translate_werkzeug_rule(rule.rule)
  attributes = vars(app._endpoints[rule.endpoint]).copy()
  if ('segment_count' in attributes):
   del attributes['segment_count']
  (yield KleinRoute(methods=methods, path=path, endpoint=rule.endpoint, attributes=attributes))

def getRoutes ( app ) : for rule in app . _url_map . iter_rules ( ) : methods = rule . methods . difference ( [ 'HEAD' ] ) path = translate_werkzeug_rule ( rule . rule ) attributes = vars ( app . _endpoints [ rule . endpoint ] ) . copy ( ) if ( 'segment_count' in attributes ) : del attributes [ 'segment_count' ] ( yield KleinRoute ( methods = methods , path = path , endpoint = rule . endpoint , attributes = attributes ) )
get the routes assoicated with a l{klein} application .