changeset 482:8cf08822207b

beginning move to Gerald 0.4
author catherine.devlin@gmail.com
date Thu, 05 Aug 2010 07:06:48 -0400
parents 7e72a5f6a94b
children c5c1786cdee2
files setup.py sqlpython/connections.py sqlpython/pgSession.txt
diffstat 3 files changed, 27 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Wed Jun 30 00:15:35 2010 -0400
+++ b/setup.py	Thu Aug 05 07:06:48 2010 -0400
@@ -22,7 +22,7 @@
       url="http://packages.python.org/sqlpython",
       packages=find_packages(),
       include_package_data=True,    
-      install_requires=['pyparsing','cmd2>=0.6.1','gerald>=0.3.6',
+      install_requires=['pyparsing','cmd2>=0.6.1','gerald>=0.4.0',
                         'genshi>=0.5'],
       extras_require = {
         'oracle':  ['cx_Oracle>=5.0.2'],
--- a/sqlpython/connections.py	Wed Jun 30 00:15:35 2010 -0400
+++ b/sqlpython/connections.py	Thu Aug 05 07:06:48 2010 -0400
@@ -147,7 +147,6 @@
     colon_between_username_passwd = re.compile(r':(?=[^/]+@)')
     def gerald_uri(self):
         result = self.uri().split('?mode=')[0]    
-        result = result.replace('://', ':/')
         return result
     def determine_rdbms(self):
         if self.opts.mysql:
@@ -161,6 +160,31 @@
     def set_corrections(self):
         pass
 
+
+parser = optparse.OptionParser()
+parser.add_option('--postgres', action='store_true', help='Connect to postgreSQL: `connect --postgres [DBNAME [USERNAME]]`')
+parser.add_option('--oracle', action='store_true', help='Connect to an Oracle database')
+parser.add_option('--mysql', action='store_true', help='Connect to a MySQL database')
+parser.add_option('-H', '--hostname', type='string',
+                                    help='Machine where database is hosted')
+parser.add_option('-p', '--port', type='int',
+                                    help='Port to connect to')
+parser.add_option('--password', type='string',
+                                    help='Password')
+parser.add_option('-d', '--database', type='string',
+                                    help='Database name to connect to')
+parser.add_option('-U', '--username', type='string',
+                                    help='Database user name to connect as')
+
+def connect(connstr):
+    (options, args) = parser.parse_args(connstr)
+    print options
+    print args
+
+
+
+
+
 class MySQLConnectionData(ConnectionData):
     rdbms = 'mysql'
     default_port = 3306
--- a/sqlpython/pgSession.txt	Wed Jun 30 00:15:35 2010 -0400
+++ b/sqlpython/pgSession.txt	Thu Aug 05 07:06:48 2010 -0400
@@ -8,7 +8,7 @@
 /.*/
 SQL.No_Connection> set colors off
 /.*/
-SQL.No_Connection> connect --postgres --password=testpass00word testplatform testuser
+SQL.No_Connection> connect --postgres --password=testpassword testplatform testuser
 0:testuser@testplatform> drop table play;
 /.*/