comparison sqlpython.py @ 124:2b42b7bc29cb 1.4.7

commit only if cursor
author catherine@localhost
date Wed, 30 Jul 2008 12:28:51 -0400
parents 898ed97bec38
children d0e071e19c26
comparison
equal deleted inserted replaced
123:898ed97bec38 124:2b42b7bc29cb
141 def do_commit(self, arg): 141 def do_commit(self, arg):
142 self.default('commit %s;' % (arg), do_everywhere=True) 142 self.default('commit %s;' % (arg), do_everywhere=True)
143 def do_rollback(self, arg): 143 def do_rollback(self, arg):
144 self.default('rollback %s;' % (arg), do_everywhere=True) 144 self.default('rollback %s;' % (arg), do_everywhere=True)
145 def do_quit(self, arg): 145 def do_quit(self, arg):
146 if self.commit_on_exit: 146 if self.commit_on_exit and hasattr(self, 'curs'):
147 self.default('commit;') 147 self.default('commit;')
148 cmd2.Cmd.do_quit() 148 cmd2.Cmd.do_quit()
149 do_exit = do_quit 149 do_exit = do_quit
150 do_q = do_quit 150 do_q = do_quit
151 151