# HG changeset patch # User catherine@dellzilla # Date 1229113768 18000 # Node ID 645467c0d3f90bdb05582df995989c8acd067ed0 # Parent 72de7d8566e2ebbd854ed4cc3924abce0a923d7e cleanup unused code diff -r 72de7d8566e2 -r 645467c0d3f9 cmd2.py --- a/cmd2.py Fri Dec 12 15:27:42 2008 -0500 +++ b/cmd2.py Fri Dec 12 15:29:28 2008 -0500 @@ -874,16 +874,6 @@ def tearDown(self): sys.stdout = self.old_stdout -class Transcript(object): - def __init__(self, cmdapp, filename='test_cmd2.txt'): - self.cmdapp = cmdapp - try: - tfile = open(filename) - self.transcript = tfile.readlines() - tfile.close() - except IOError: - self.transcript = [] - class Cmd2TestCase(unittest.TestCase): '''Subclass this, setting CmdApp and transcriptFileName, to make a unittest.TestCase class that will execute the commands in transcriptFileName and expect the results shown. @@ -903,25 +893,6 @@ def divideTranscript(self): self.dialogue = [] commandStart = None - responseStart = None - prompt = self.cmdapp.prompt.rstrip() - continuationPrompt = self.cmdapp.continuationPrompt.rstrip() - for (lineNum, line) in enumerate(self.transcript): - if line.startswith(prompt): - if commandStart == lineNum - 1: - responseStart = lineNum - if responseStart is not None: - self.dialogue.append((commandStart, ''.join(command), ''.join(self.transcript[responseStart:lineNum]))) - command = [line[len(prompt)+1:]] - commandStart = lineNum - elif line.startswith(continuationPrompt): - command.append(line[len(continuationPrompt)+1:]) - else: - if responseStart < commandStart: - responseStart = lineNum - def divideTranscript(self): - self.dialogue = [] - commandStart = None response = [] command = [] prompt = self.cmdapp.prompt.rstrip()