#NEWLINE# def secure( self , secure = True , port = None ) : #NEWLINE# #INDENT# "Modify the scheme to https/http and return the new URL.\n\n        @param secure: choose between https and http, default to True (https)\n        @param port: port, override the scheme's normal port\n        " #NEWLINE# if secure : #NEWLINE# #INDENT# ( scheme , defaultPort ) = ( 'https' , 443 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( scheme , defaultPort ) = ( 'http' , 80 ) #NEWLINE# #UNINDENT# netloc = self . netloc . split ( ':' , 1 ) [ 0 ] #NEWLINE# if ( ( port is not None ) and ( port != defaultPort ) ) : #NEWLINE# #INDENT# netloc = ( '%s:%d' % ( netloc , port ) ) #NEWLINE# #UNINDENT# return self . cloneURL ( scheme , netloc , self . _qpathlist , self . _querylist , self . fragment )