# HG changeset patch # User catherine@Elli.myhome.westell.com # Date 1236859122 14400 # Node ID aec778ef82b67f46d5174ac172a7f29bcba7a692 # Parent 9e3e49c95abf9b756158b3454ba110a05ba6fa5a print full help on -h diff -r 9e3e49c95abf -r aec778ef82b6 setup.py --- a/setup.py Wed Mar 11 12:49:02 2009 -0400 +++ b/setup.py Thu Mar 12 07:58:42 2009 -0400 @@ -9,7 +9,7 @@ Operating System :: OS Independent""".splitlines() setup(name="sqlpython", - version="1.6.0", + version="1.6.1", description="Command-line interface to Oracle", long_description="Customizable alternative to Oracle's SQL*PLUS command-line interface", author="Luca Canali", @@ -17,7 +17,7 @@ url="https://twiki.cern.ch/twiki/bin/view/PSSGroup/SqlPython", packages=find_packages(), include_package_data=True, - install_requires=['pyparsing','cmd2>=0.4.7','cx_Oracle','genshi>=0.5'], + install_requires=['pyparsing','cmd2>=0.4.8','cx_Oracle','genshi>=0.5'], keywords = 'client oracle database', license = 'MIT', platforms = ['any'], diff -r 9e3e49c95abf -r aec778ef82b6 sqlpython/mysqlpy.py --- a/sqlpython/mysqlpy.py Wed Mar 11 12:49:02 2009 -0400 +++ b/sqlpython/mysqlpy.py Thu Mar 12 07:58:42 2009 -0400 @@ -1,5 +1,5 @@ #!/usr/bin/python -# MySqlPy V1.6.0 +# MySqlPy V1.6.1 # Author: Luca.Canali@cern.ch # # @@ -13,9 +13,9 @@ class mysqlpy(sqlpyPlus): ''' -MySqlPy V1.6.0 - 'sqlplus in python' +MySqlPy V1.6.1 - 'sqlplus in python' Author: Luca.Canali@cern.ch -Rev: 1.6.0, 02-Mar-09 +Rev: 1.6.1, 15-Mar-09 Companion of SqlPython, a python module that reproduces Oracle's command line within python and sqlpyPlus. Major contributions by Catherine Devlin, http://catherinedevlin.blogspot.com @@ -106,6 +106,21 @@ which get and run SQL scripts from disk.''' self.onecmd(self.query_load10g) + @options([make_option('-u', '--uppercase', action='store_true', + help='use ALL CAPS')]) + def do_greet(self, args, opts): + ''' + Documentation for the command goes into this string + at the beginning of the method. + ''' + result = 'Hello' + for name in args.split(): + result += ',' + name + result += '!\n' + if opts.uppercase: + result = result.upper() + self.stdout.write(result) + def do_db(self,args,filepath='pass.txt'): '''Exec do_connect to db_alias in args (credentials form the file pass.txt) ''' f = open(filepath,'r') diff -r 9e3e49c95abf -r aec778ef82b6 sqlpython/sqlpyPlus.py --- a/sqlpython/sqlpyPlus.py Wed Mar 11 12:49:02 2009 -0400 +++ b/sqlpython/sqlpyPlus.py Thu Mar 12 07:58:42 2009 -0400 @@ -1034,7 +1034,7 @@ except KeyError: self.stdout.write('No bind variable %s\n' % arg) else: - for (var, val) in self.binds.items(): + for (var, val) in sorted(self.binds.items()): print ':%s = %s' % (var, val) assignmentScanner = Parser(pyparsing.Literal(':=') ^ '=') diff -r 9e3e49c95abf -r aec778ef82b6 sqlpython/sqlpython.py --- a/sqlpython/sqlpython.py Wed Mar 11 12:49:02 2009 -0400 +++ b/sqlpython/sqlpython.py Thu Mar 12 07:58:42 2009 -0400 @@ -1,5 +1,5 @@ # -# SqlPython V1.6.0 +# SqlPython V1.6.1 # Author: Luca.Canali@cern.ch, Apr 2006 # Rev 25-Feb-09 # @@ -10,7 +10,7 @@ import cmd2,getpass,binascii,cx_Oracle,re,os import sqlpyPlus -__version__ = '1.6.0' +__version__ = '1.6.1' class sqlpython(cmd2.Cmd): '''A python module to reproduce Oracle's command line with focus on customization and extention'''