From: brian z. <bz...@us...> - 2002-01-26 15:45:03
|
Update of /cvsroot/jython/jython/Lib In directory usw-pr-cvs1:/tmp/cvs-serv5053 Modified Files: isql.py Log Message: quit from within the interpreter no longer dumps a stacktrace; use connects with the same dbexts class Index: isql.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/isql.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** isql.py 2002/01/09 18:18:55 1.3 --- isql.py 2002/01/26 15:44:58 1.4 *************** *** 65,69 **** def do_use(self, arg): """\nUse a new database connection.\n""" ! self.db = dbexts.dbexts(arg.strip()) return None --- 65,70 ---- def do_use(self, arg): """\nUse a new database connection.\n""" ! # this allows custom dbexts ! self.db = self.db.__class__(arg.strip()) return None *************** *** 143,147 **** --- 144,150 ---- except: self.sqlbuffer = [] + print print sys.exc_info()[1] + print return None *************** *** 152,155 **** --- 155,170 ---- raise IsqlExit() + def cmdloop(self, intro=None): + while 1: + try: + cmd.Cmd.cmdloop(self, intro) + except IsqlExit, e: + break + except Exception, e: + print + print e + print + intro = None + if __name__ == '__main__': import getopt *************** *** 171,182 **** isql = IsqlCmd(dbname) ! while 1: ! try: ! isql.cmdloop(intro) ! except IsqlExit, e: ! break ! except Exception, e: ! print ! print e ! print ! intro = "" --- 186,188 ---- isql = IsqlCmd(dbname) ! isql.cmdloop() |