#NEWLINE# def process_url( self , urlvars = False ) : #NEWLINE# #INDENT# url = self . url #NEWLINE# path_vars = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# url_vars = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# params = dict ( ( ( p [ 'name' ] , p ) for p in self . params ) ) #NEWLINE# params . update ( dict ( ( ( p [ 'name' ] , p ) for p in self . operation . get ( 'parameters' , [ ] ) ) ) ) #NEWLINE# if ( not params ) : #NEWLINE# #INDENT# return ( url , None ) #NEWLINE# #UNINDENT# for ( name , param ) in params . items ( ) : #NEWLINE# #INDENT# if ( param [ 'in' ] == 'path' ) : #NEWLINE# #INDENT# url = url . replace ( ( '{%s}' % name ) , ( ':%s' % name ) ) #NEWLINE# path_vars [ name ] = DEFAULT_VARS . get ( param [ 'type' ] , '' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( param [ 'in' ] == 'query' ) and urlvars ) : #NEWLINE# #INDENT# default = DEFAULT_VARS . get ( param [ 'type' ] , '' ) #NEWLINE# url_vars [ default ] = param . get ( 'default' , default ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if url_vars : #NEWLINE# #INDENT# url = '?' . join ( ( url , urlencode ( url_vars ) ) ) #NEWLINE# #UNINDENT# return ( url , path_vars )