Mercurial > sqlpython
comparison sqlpython.py @ 16:2776755a3a7e
beginning separation of cmd2
author | devlinjs@FA7CZA6N1254998.wrightpatterson.afmc.ds.af.mil |
---|---|
date | Wed, 19 Dec 2007 10:28:01 -0500 |
parents | f70cc3be6377 |
children | 1fb9f7dee7d8 |
comparison
equal
deleted
inserted
replaced
15:9c7df9f825a1 | 16:2776755a3a7e |
---|---|
6 # A python module to reproduce Oracle's command line 'sqlplus-like' within python | 6 # A python module to reproduce Oracle's command line 'sqlplus-like' within python |
7 # Intended to allow easy customizations and extentions | 7 # Intended to allow easy customizations and extentions |
8 # Best used with the companion modules sqlpyPlus and mysqlpy | 8 # Best used with the companion modules sqlpyPlus and mysqlpy |
9 # See also http://twiki.cern.ch/twiki/bin/view/PSSGroup/SqlPython | 9 # See also http://twiki.cern.ch/twiki/bin/view/PSSGroup/SqlPython |
10 | 10 |
11 import cmd,getpass,binascii,cx_Oracle,re | 11 import cmd2,getpass,binascii,cx_Oracle,re |
12 import pexpecter | 12 import pexpecter |
13 | 13 |
14 # complication! separate sessions -> | 14 # complication! separate sessions -> |
15 # separate transactions !!!!! | 15 # separate transactions !!!!! |
16 # also: timeouts, other session failures | 16 # also: timeouts, other session failures |
17 | 17 |
18 class sqlpython(cmd.Cmd): | 18 class sqlpython(cmd2.Cmd): |
19 '''A python module to reproduce Oracle's command line with focus on customization and extention''' | 19 '''A python module to reproduce Oracle's command line with focus on customization and extention''' |
20 | 20 |
21 def __init__(self): | 21 def __init__(self): |
22 cmd.Cmd.__init__(self) | 22 cmd2.Cmd.__init__(self) |
23 self.prompt = 'SQL.No_Connection> ' | 23 self.prompt = 'SQL.No_Connection> ' |
24 self.maxfetch = 1000 | 24 self.maxfetch = 1000 |
25 self.failoverSessions = [] | 25 self.failoverSessions = [] |
26 self.terminator = ';' | 26 self.terminator = ';' |
27 self.timeout = 30 | 27 self.timeout = 30 |