#NEWLINE# def set_ok_port( self , cookie , request ) : #NEWLINE# #INDENT# if cookie . port_specified : #NEWLINE# #INDENT# req_port = request_port ( request ) #NEWLINE# if ( req_port is None ) : #NEWLINE# #INDENT# req_port = '80' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# req_port = str ( req_port ) #NEWLINE# #UNINDENT# for p in cookie . port . split ( ',' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# int ( p ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# _debug ( '   bad port %s (not numeric)' , p ) #NEWLINE# return False #NEWLINE# #UNINDENT# if ( p == req_port ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# _debug ( '   request port (%s) not found in %s' , req_port , cookie . port ) #NEWLINE# return False #NEWLINE# #UNINDENT# #UNINDENT# return True