#NEWLINE# def extract_uri( self , environ ) : #NEWLINE# #INDENT# port = None #NEWLINE# scheme = uri [ 'wsgi.url_scheme' ] #NEWLINE# if ( 'SERVER_NAME' in environ ) : #NEWLINE# #INDENT# host = environ [ 'SERVER_NAME' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# host = environ [ 'HTTP_HOST' ] #NEWLINE# #UNINDENT# if ( ':' in host ) : #NEWLINE# #INDENT# ( host , port ) = host . split ( ':' ) #NEWLINE# #UNINDENT# if ( not port ) : #NEWLINE# #INDENT# if ( 'SERVER_PORT' in environ ) : #NEWLINE# #INDENT# port = environ [ 'SERVER_PORT' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# port = ( ( ( scheme == 'https' ) and '443' ) or '80' ) #NEWLINE# #UNINDENT# #UNINDENT# uri = ( '%s://%s:%s' % ( scheme , host , port ) ) #NEWLINE# return uri