#NEWLINE# def split( self ) : #NEWLINE# #INDENT# 'Return a two element tuple containing the parent route and\n        the last url bit as route. If this route is the root route, it returns\n        the root route and ``None``. ' #NEWLINE# rule = self . rule #NEWLINE# if ( not self . is_leaf ) : #NEWLINE# #INDENT# rule = rule [ : ( - 1 ) ] #NEWLINE# #UNINDENT# if ( not rule ) : #NEWLINE# #INDENT# return ( Route ( '/' ) , None ) #NEWLINE# #UNINDENT# bits = ( '/' + rule ) . split ( '/' ) #NEWLINE# last = Route ( ( bits [ ( - 1 ) ] if self . is_leaf else ( bits [ ( - 1 ) ] + '/' ) ) ) #NEWLINE# if ( len ( bits ) > 1 ) : #NEWLINE# #INDENT# return ( Route ( ( '/' . join ( bits [ : ( - 1 ) ] ) + '/' ) ) , last ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( last , None )