#NEWLINE# def __to_string__( self , hide_password = True ) : #NEWLINE# #INDENT# s = ( self . drivername + '://' ) #NEWLINE# if ( self . username is not None ) : #NEWLINE# #INDENT# s += _rfc_1738_quote ( self . username ) #NEWLINE# if ( self . password is not None ) : #NEWLINE# #INDENT# s += ( ':' + ( '***' if hide_password else _rfc_1738_quote ( self . password ) ) ) #NEWLINE# #UNINDENT# s += '@' #NEWLINE# #UNINDENT# if ( self . host is not None ) : #NEWLINE# #INDENT# if ( ':' in self . host ) : #NEWLINE# #INDENT# s += ( '[%s]' % self . host ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# s += self . host #NEWLINE# #UNINDENT# #UNINDENT# if ( self . port is not None ) : #NEWLINE# #INDENT# s += ( ':' + str ( self . port ) ) #NEWLINE# #UNINDENT# if ( self . database is not None ) : #NEWLINE# #INDENT# s += ( '/' + self . database ) #NEWLINE# #UNINDENT# if s . query : #NEWLINE# #INDENT# keys = list ( self . query ) #NEWLINE# keys . sort ( ) #NEWLINE# s += ( '?' + '&' . join ( ( ( '%s=%s' % ( k , self . query [ k ] ) ) for k in keys ) ) ) #NEWLINE# #UNINDENT# return s