#NEWLINE# def wrap_urls( self , urlpatterns ) : #NEWLINE# #INDENT# new_patterns = list ( ) #NEWLINE# for entry in urlpatterns : #NEWLINE# #INDENT# entry = copy ( entry ) #NEWLINE# if ( hasattr ( entry , '_callback' ) and hasattr ( entry . _callback , 'endpoint' ) ) : #NEWLINE# #INDENT# endpoint = entry . _callback . endpoint #NEWLINE# kwargs = self . get_view_kwargs ( endpoint ) #NEWLINE# new_endpoint = endpoint . fork ( ** kwargs ) #NEWLINE# entry . _callback = new_endpoint . get_view ( ) #NEWLINE# assert ( entry . _callback . endpoint . site == self . site ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( entry , 'url_patterns' ) : #NEWLINE# #INDENT# entry . _urlconf_module = self . wrap_urls ( entry . url_patterns ) #NEWLINE# #UNINDENT# #UNINDENT# new_patterns . append ( entry ) #NEWLINE# #UNINDENT# return patterns ( '' , * new_patterns )