# HG changeset patch # User catherine@dellzilla # Date 1235601935 18000 # Node ID 52adb09094b3d6438e86b1f340610cbda4d4b227 # Parent 5728def6bdf5c9e61e735884159da8796a33d9e3 fixed bugs in VC introduced by sort-order options diff -r 5728def6bdf5 -r 52adb09094b3 sqlpython/exampleSession.txt --- a/sqlpython/exampleSession.txt Wed Feb 25 17:10:45 2009 -0500 +++ b/sqlpython/exampleSession.txt Wed Feb 25 17:45:35 2009 -0500 @@ -205,13 +205,13 @@ autobind: False commit_on_exit: True echo: False +editor: gedit +heading: True maxfetch: 1000 maxtselctrows: 10 +prompt: testschema@orcl> timeout: 30 -testschema@orcl> print -testschema@orcl> set autobind on -autobind - was: False -now: True +timing: False testschema@orcl> select * from play where author like 'A%'; TITLE AUTHOR diff -r 5728def6bdf5 -r 52adb09094b3 sqlpython/sqlpyPlus.py --- a/sqlpython/sqlpyPlus.py Wed Feb 25 17:10:45 2009 -0500 +++ b/sqlpython/sqlpyPlus.py Wed Feb 25 17:45:35 2009 -0500 @@ -978,7 +978,7 @@ def _ls_statement(self, arg, opts): if arg: target = arg.upper() - if opts.exact: + if hasattr(opts, 'exact') and opts.exact: where = """\nWHERE object_name = '%s' OR object_type || '/' || object_name = '%s'""" % \ (target, target) @@ -992,16 +992,16 @@ else: whose = 'user' objname = 'object_name' - if opts.long: + if hasattr(opts, 'long') and opts.long: moreColumns = ', status, last_ddl_time' else: moreColumns = '' # 'Normal' sort order is DATE DESC (maybe), object type ASC, object name ASC - sortdirection = ('DESC' if opts.reverse else 'ASC') + sortdirection = ('DESC' if hasattr(opts, 'reverse') and opts.reverse else 'ASC') orderby = 'object_type %s, object_name %s' % (sortdirection, sortdirection) - if opts.timesort: - orderby = 'last_ddl_time %s, %s' % (('ASC' if opts.reverse else 'DESC'), orderby) + if hasattr(opts, 'timesort') and opts.timesort: + orderby = 'last_ddl_time %s, %s' % (('ASC' if hasattr(opts, 'reverse') and opts.reverse else 'DESC'), orderby) return {'objname': objname, 'moreColumns': moreColumns, 'whose': whose, 'where': where, 'orderby': orderby}