comparison sqlpyPlus.py @ 34:d3b2f9c6e536

run
author devlinjs@FA7CZA6N1254998.wrightpatterson.afmc.ds.af.mil
date Fri, 21 Dec 2007 16:01:52 -0500
parents ca6f34be3397
children 5d29e6a21c6f
comparison
equal deleted inserted replaced
33:061f40299ed5 34:d3b2f9c6e536
678 self.write(query, fnames[n]) 678 self.write(query, fnames[n])
679 diffMergeSearcher.invoke(fnames[0], fnames[1]) 679 diffMergeSearcher.invoke(fnames[0], fnames[1])
680 680
681 bufferPosPattern = re.compile('\d+') 681 bufferPosPattern = re.compile('\d+')
682 rangeIndicators = ('-',':') 682 rangeIndicators = ('-',':')
683
684 def do_run(self, arg):
685 """run [arg]: re-runs an earlier command
686
687 no arg -> run most recent command
688 arg is integer -> run one history item, by index
689 arg is string -> run most recent command by string search
690 arg is /enclosed in forward-slashes/ -> run most recent by regex
691 """
692 'run [N]: runs the SQL that was run N commands ago'
693 runme = self.last_matching(arg)
694 print runme
695 self.onecmd_plus_hooks(runme)
696 do_r = do_run
697 683
698 def do_get(self, fname): 684 def do_get(self, fname):
699 'Brings SQL commands from a file to the in-memory SQL buffer.' 685 'Brings SQL commands from a file to the in-memory SQL buffer.'
700 numCommandsLoaded = self.load(fname) 686 numCommandsLoaded = self.load(fname)
701 if numCommandsLoaded: 687 if numCommandsLoaded: