|
From: Andy T. <an...@us...> - 2005-09-18 03:59:37
|
Update of /cvsroot/pythoncard/PythonCard/samples/dbBrowser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9735/samples/dbBrowser Modified Files: dbBrowser2.py dbLogin.py readme.txt Log Message: Making blanket except clauses more specific Index: dbLogin.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/dbLogin.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dbLogin.py 17 May 2005 20:33:53 -0000 1.12 --- dbLogin.py 18 Sep 2005 03:59:22 -0000 1.13 *************** *** 37,56 **** dbHandler = __import__(dbHandlers[self.components.choice.stringSelection]) dbClass = dbHandler.browse ! if self.components.choice.stringSelection == 'Gadfly': ! self.parent.connection={'databasename':self.components["txtUsername"].text, ! 'directory':self.components["txtPassword"].text} ! elif self.components.choice.stringSelection == 'MetaKit': ! self.parent.connection={'databasename':self.components["txtUsername"].text, ! 'directory':self.components["txtPassword"].text} ! elif self.components.choice.stringSelection == 'PySQLite' or self.components.choice.stringSelection == 'PySQLite2': ! self.parent.connection={'databasename':self.components["txtUsername"].text, ! 'directory':self.components["txtPassword"].text} ! elif self.components.choice.stringSelection == 'CSV': ! self.parent.connection={'databasename':self.components["txtUsername"].text, ! 'directory':self.components["txtPassword"].text} else: ! self.parent.connection={'username':self.components["txtUsername"].text, ! 'password':self.components["txtPassword"].text, ! 'database':self.components["txtDatabase"].text} # Get the choice widget and add the available database tables to it self.parent._database=dbClass(self.parent.connection) --- 37,50 ---- dbHandler = __import__(dbHandlers[self.components.choice.stringSelection]) dbClass = dbHandler.browse ! selection = self.components.choice.stringSelection ! connection = {} ! if selection in ('Gadfly', 'Metakit', 'PySQLite', 'PySQLite2', 'CSV'): ! connection['databasename'] = self.components['txtUsername'].text ! connection['directory'] = self.components['txtPassword'].text else: ! connection['username'] = self.components['txtUsername'].text ! connection['password'] = self.components['txtPassword'].text ! connection['database'] = self.components['txtDatabase'].text ! self.parent.connection = connection # Get the choice widget and add the available database tables to it self.parent._database=dbClass(self.parent.connection) *************** *** 68,74 **** event.skip() - #def on_btnCancel_mouseClick(self, event): - # event.skip() - def on_btnFile_mouseClick(self, event): if self.components.choice.stringSelection == 'Gadfly': --- 62,65 ---- *************** *** 77,81 **** elif self.components.choice.stringSelection == 'CSV': wildcard = "CSV files (*.csv)|*.csv" - ## wildcard = "*.csv" result = dialog.openFileDialog(wildcard=wildcard) else: --- 68,71 ---- *************** *** 89,93 **** def on_choice_select(self, event): ! "When we select 'Gadfly' change the available widgets'" if self.components.choice.stringSelection in ('Gadfly', 'MetaKit', 'PySQLite', 'PySQLite2'): self.components.lblUsername.text = 'DB Name' --- 79,83 ---- def on_choice_select(self, event): ! "Display the appropriate widgets for the selected database" if self.components.choice.stringSelection in ('Gadfly', 'MetaKit', 'PySQLite', 'PySQLite2'): self.components.lblUsername.text = 'DB Name' *************** *** 108,116 **** self.components.txtDatabase.visible = True self.components.btnFile.visible = False - - # KEA 2004-04-24 - # what is this supposed to do? - # historical cruft that should go away? - def OnCloseWindow(self, event): - self.close() event.skip() --- 98,100 ---- Index: dbBrowser2.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/dbBrowser2.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dbBrowser2.py 24 Apr 2004 21:09:18 -0000 1.8 --- dbBrowser2.py 18 Sep 2005 03:59:22 -0000 1.9 *************** *** 25,29 **** from PythonCard import model, dialog - # dont need config import os import dbLogin --- 25,28 ---- Index: readme.txt =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/dbBrowser/readme.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** readme.txt 17 May 2005 20:33:53 -0000 1.15 --- readme.txt 18 Sep 2005 03:59:22 -0000 1.16 *************** *** 6,10 **** dbBrowser is a client for viewing data from relational databases. Once you connect to a database, select a table and the rows of data from it are available for you to view. ! The current version of dbBrowser works with MySQL, Gadfly, SQLite, Metakit, PySQLite, PySQLite2, PostgreSQL and Oracle. The code is stable but thi is still an alpha release so if you are not already using any of these databases it is probably best to give this a miss until it is more stable. The current distribution includes an alternative version of dbBrowser (called dbBrowser2) which uses a wxGrid to display the results of your queries rather than the row at a time of dbBrowser. --- 6,10 ---- dbBrowser is a client for viewing data from relational databases. Once you connect to a database, select a table and the rows of data from it are available for you to view. ! The current version of dbBrowser works with MySQL, Gadfly, SQLite, Metakit, PySQLite, PySQLite2, PostgreSQL and Oracle. The code is stable but this is still an alpha release so if you are not already using any of these databases it is probably best to give this a miss until it is more stable. The current distribution includes an alternative version of dbBrowser (called dbBrowser2) which uses a wxGrid to display the results of your queries rather than the row at a time of dbBrowser. *************** *** 56,59 **** --- 56,60 ---- Change Notices -------------- + 16.08.2005 - Clean up and re-factoring 17.05.2005 - Added PySQLite2 support, including script to create a test database from a csv file. ??.09.2004 - Added CSV support, including a testfile.csv test sample. |