# HG changeset patch # User catherine@Elli.myhome.westell.com # Date 1228233621 18000 # Node ID b2d8bf5f89db29b1fcab42bf8a92ee1dc09ea903 # Parent 3af1615e6ea80c6e7ec899a4f91417df30fb76f1 merged with changes from work diff -r 3af1615e6ea8 -r b2d8bf5f89db sqlpython/exampleSession.txt --- a/sqlpython/exampleSession.txt Mon Dec 01 16:19:44 2008 -0500 +++ b/sqlpython/exampleSession.txt Tue Dec 02 11:00:21 2008 -0500 @@ -43,12 +43,6 @@ 2 rows selected. -testschema@orcl> ls --all - -NAME --------------- -INDEX/XPK_PLAY -TABLE/PLAY testschema@orcl> ls table NAME diff -r 3af1615e6ea8 -r b2d8bf5f89db sqlpython/sqlpyPlus.py --- a/sqlpython/sqlpyPlus.py Mon Dec 01 16:19:44 2008 -0500 +++ b/sqlpython/sqlpyPlus.py Tue Dec 02 11:00:21 2008 -0500 @@ -29,7 +29,7 @@ from plothandler import Plot try: import pylab -except: +except (RuntimeError, ImportError): pass descQueries = { @@ -980,3 +980,6 @@ if __name__ == "__main__": "Silent return implies that all unit tests succeeded. Use -v to see details." _test() +if __name__ == "__main__": + "Silent return implies that all unit tests succeeded. Use -v to see details." + _test() diff -r 3af1615e6ea8 -r b2d8bf5f89db sqlpython/sqlpython.py --- a/sqlpython/sqlpython.py Mon Dec 01 16:19:44 2008 -0500 +++ b/sqlpython/sqlpython.py Tue Dec 02 11:00:21 2008 -0500 @@ -94,16 +94,14 @@ terminatorSearchString = '|'.join('\\' + d.split()[0] for d in do_terminators.__doc__.splitlines()) def default(self, arg): - stmt = '%s %s' % (arg.parsed.command, arg.parsed.args) - self.varsUsed = sqlpyPlus.findBinds(stmt, self.binds, givenBindVars={}) - self.curs.execute(stmt, self.varsUsed) + self.varsUsed = sqlpyPlus.findBinds(arg, self.binds, givenBindVars={}) + self.curs.execute('%s %s' % (arg.parsed.command, arg.parsed.args), self.varsUsed) print '\nExecuted%s\n' % ((self.curs.rowcount > 0) and ' (%d rows)' % self.curs.rowcount or '') - - ''' - def do_commit(self, arg): - self.default('commit %s' % (arg)) - def do_rollback(self, arg): - self.default('rollback %s;' % (arg)) ''' + + def do_commit(self, arg=''): + self.default(self.parsed('commit %s;' % (arg))) + def do_rollback(self, arg=''): + self.default(self.parsed('rollback %s;' % (arg))) def do_quit(self, arg): if self.commit_on_exit and hasattr(self, 'curs'): self.default(self.parsed('commit'))