#NEWLINE# def _get_sorted( self , resources ) : #NEWLINE# #INDENT# 'Order the resources by priority - the most specific paths come\n        first.\n\n        :param resources: List of :class:`wsgiservice.resource.Resource`\n                          classes to be served by this application.\n        ' #NEWLINE# tmp = [ ] #NEWLINE# for resource in resources : #NEWLINE# #INDENT# path = resource . _path #NEWLINE# priority = ( ( path . count ( '/' ) * 10 ) - path . count ( '{' ) ) #NEWLINE# tmp . append ( ( priority , resource ) ) #NEWLINE# #UNINDENT# return [ resource for ( prio , resource ) in reversed ( sorted ( tmp ) ) ]