Mercurial > sqlpython
comparison sqlpython/schemagroup.py @ 389:53ee70e9417e
oops, one more change propagated from hg messup
author | catherine@DellZilla |
---|---|
date | Tue, 06 Oct 2009 15:16:47 -0400 |
parents | e3dd9e4467d1 |
children | 3905ef976608 |
comparison
equal
deleted
inserted
replaced
388:841573c48676 | 389:53ee70e9417e |
---|---|
1 import gerald, re, datetime, threading | 1 import gerald, re, datetime, threading |
2 | |
3 def get_schemagroup(rdbms, connstr, connection, user): | |
4 gerald_connstring = connstr.split('/?mode=')[0].replace('//','/') | |
5 if rdbms == 'oracle': | |
6 childtype = OracleSchemaGroup | |
7 grp = childtype(gerald_connstring, connection, user) | |
8 return grp | |
9 | 2 |
10 def gerald_connection_string(sqlalchemy_connection_string): | 3 def gerald_connection_string(sqlalchemy_connection_string): |
11 return sqlalchemy_connection_string.split('/?mode=')[0].replace('//','/') | 4 return sqlalchemy_connection_string.split('/?mode=')[0].replace('//','/') |
12 | 5 |
13 class RefreshThread(threading.Thread): | 6 class RefreshThread(threading.Thread): |
40 self.connection = connection | 33 self.connection = connection |
41 self.gerald_connection_string = gerald_connection_string(connection_string) | 34 self.gerald_connection_string = gerald_connection_string(connection_string) |
42 self.refresh_thread = RefreshGroupThread(self) | 35 self.refresh_thread = RefreshGroupThread(self) |
43 self.complete = False | 36 self.complete = False |
44 # do we need a second thread for a second run? | 37 # do we need a second thread for a second run? |
38 def refresh_asynch(self): | |
39 self.refresh_thread.start() | |
45 def refresh(self): | 40 def refresh(self): |
46 curs = self.connection.cursor() | 41 curs = self.connection.cursor() |
47 curs.execute('SELECT sysdate FROM dual') | 42 curs.execute('SELECT sysdate FROM dual') |
48 current_database_time = curs.fetchone()[0] | 43 current_database_time = curs.fetchone()[0] |
49 curs.execute('''SELECT owner, MAX(last_ddl_time) | 44 curs.execute('''SELECT owner, MAX(last_ddl_time) |