#NEWLINE# def _minkeys( self , routelist ) : #NEWLINE# #INDENT# "Utility function to walk the route backwards\n\n        Will also determine the minimum keys we can handle to generate\n        a working route.\n\n        routelist is a list of the '/' split route path\n        defaults is a dict of all the defaults provided for the route\n\n        " #NEWLINE# minkeys = [ ] #NEWLINE# backcheck = routelist [ : ] #NEWLINE# if ( not self . minimization ) : #NEWLINE# #INDENT# for part in backcheck : #NEWLINE# #INDENT# if isinstance ( part , dict ) : #NEWLINE# #INDENT# minkeys . append ( part [ 'name' ] ) #NEWLINE# #UNINDENT# #UNINDENT# return ( frozenset ( minkeys ) , backcheck ) #NEWLINE# #UNINDENT# gaps = False #NEWLINE# backcheck . reverse ( ) #NEWLINE# for part in backcheck : #NEWLINE# #INDENT# if ( ( not isinstance ( part , dict ) ) and ( part not in self . done_chars ) ) : #NEWLINE# #INDENT# gaps = True #NEWLINE# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not isinstance ( part , dict ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# key = part [ 'name' ] #NEWLINE# if ( ( key in self . defaults ) and ( not gaps ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# minkeys . append ( key ) #NEWLINE# gaps = True #NEWLINE# #UNINDENT# return ( frozenset ( minkeys ) , backcheck )