#NEWLINE# def get_variables_and_parameters( self , variables , extra_parameters ) : #NEWLINE# #INDENT# 'Get converted variables and parameters.\n\n        :param variables: dict of variables to use in the path.\n        :param extra_parameters: dict of additional parameters to use.\n        :return: ``variables, parameters`` tuple with dicts of converted\n          path variables and converted URL parameters.\n        ' #NEWLINE# converters = self . converters #NEWLINE# parameter_names = self . parameter_names #NEWLINE# path_variables = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# parameters = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( name , value ) in variables . items ( ) : #NEWLINE# #INDENT# if ( name not in path_variables ) : #NEWLINE# #INDENT# if ( value is None ) : #NEWLINE# #INDENT# raise LinkError ( ( 'Path variable %s for path %s is None' % ( name , self . path ) ) ) #NEWLINE# #UNINDENT# path_variables [ name ] = converters . get ( name , IDENTITY_CONVERTER ) . encode ( value ) [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( value is None ) or ( value == [ ] ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# parameters [ name ] = converters . get ( name , IDENTITY_CONVERTER ) . encode ( value ) #NEWLINE# #UNINDENT# #UNINDENT# if extra_parameters : #NEWLINE# #INDENT# for ( name , value ) in extra_parameters . items ( ) : #NEWLINE# #INDENT# parameters [ name ] = converters . get ( name , IDENTITY_CONVERTER ) . encode ( value ) #NEWLINE# #UNINDENT# #UNINDENT# return ( path_variables , parameters )