#NEWLINE# def __connect( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# dsn = self . __db #NEWLINE# if self . __host : #NEWLINE# #INDENT# dsn = self . __driver . makedsn ( self . __host , self . __port , self . __db ) #NEWLINE# #UNINDENT# return self . __driver . connect ( dsn = dsn , user = e . __user , password = self . __passwd ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# raise Exception ( ( 'could not connect to database: %s' % e ) )