Mercurial > sqlpython
changeset 198:b2d8bf5f89db
merged with changes from work
author | catherine@Elli.myhome.westell.com |
---|---|
date | Tue, 02 Dec 2008 11:00:21 -0500 |
parents | 3af1615e6ea8 |
children | 09592342a33d |
files | sqlpython/exampleSession.txt sqlpython/sqlpyPlus.py sqlpython/sqlpython.py |
diffstat | 3 files changed, 11 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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()
--- 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'))