comparison sqlpython/connections.py @ 473:d710a48e6fb7

connect problem unfixed
author catherine@dellzilla
date Fri, 05 Mar 2010 12:59:28 -0500
parents 0be350ab306c
children f29923ac1119
comparison
equal deleted inserted replaced
472:9f58d8f807d3 473:d710a48e6fb7
131 if cls.rdbms == rdbms_name: 131 if cls.rdbms == rdbms_name:
132 self.__class__ = cls 132 self.__class__ = cls
133 def uri(self): 133 def uri(self):
134 return '%s://%s:%s@%s:%s/%s' % (self.rdbms, self.username, self.password, 134 return '%s://%s:%s@%s:%s/%s' % (self.rdbms, self.username, self.password,
135 self.hostname, self.port, self.database) 135 self.hostname, self.port, self.database)
136 colon_between_username_passwd = re.compile(r':(?=[^/]+@)')
136 def gerald_uri(self): 137 def gerald_uri(self):
137 return self.uri().split('?mode=')[0] 138 result = self.uri().split('?mode=')[0]
139 result = self.colon_between_username_passwd.sub('/', result)
140 result = result.replace('://', ':/')
141 return result
138 def determine_rdbms(self): 142 def determine_rdbms(self):
139 if self.opts.mysql: 143 if self.opts.mysql:
140 self.__class__ = MySQLConnectionData 144 self.__class__ = MySQLConnectionData
141 elif self.opts.postgres: 145 elif self.opts.postgres:
142 self.__class__ = PostgresConnectionData 146 self.__class__ = PostgresConnectionData