#NEWLINE# def _init_from_url( self , url ) : #NEWLINE# #INDENT# parsed_url = urlparse . urlsplit ( url ) #NEWLINE# ( host , port ) = parsed_url . netloc . split ( ':' ) #NEWLINE# if ( not port ) : #NEWLINE# #INDENT# if ( parsed_url . scheme == 'https' ) : #NEWLINE# #INDENT# port = 443 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# port = 80 #NEWLINE# #UNINDENT# #UNINDENT# path = parsed_url . path #NEWLINE# if ( ( path == '/' ) or ( not path ) ) : #NEWLINE# #INDENT# self . script_name = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . script_name = path #NEWLINE# #UNINDENT# self . host = url #NEWLINE# self . port = int ( port )