comparison cmd2.py @ 258:7a98d7f2da30

I get it - BASH line expansion of file names gets me
author Catherine Devlin <catherine.devlin@gmail.com>
date Thu, 02 Apr 2009 17:22:02 -0400
parents d62bb3dd58a0
children 5147fa4166b0
comparison
equal deleted inserted replaced
257:d62bb3dd58a0 258:7a98d7f2da30
26 import unittest, string, datetime, urllib, glob 26 import unittest, string, datetime, urllib, glob
27 from code import InteractiveConsole, InteractiveInterpreter, softspace 27 from code import InteractiveConsole, InteractiveInterpreter, softspace
28 from optparse import make_option 28 from optparse import make_option
29 __version__ = '0.5.1' 29 __version__ = '0.5.1'
30 import logging 30 import logging
31
32 logging.basicConfig(filename='log.txt')
33 31
34 class OptionParser(optparse.OptionParser): 32 class OptionParser(optparse.OptionParser):
35 def exit(self, status=0, msg=None): 33 def exit(self, status=0, msg=None):
36 self.values._exit = True 34 self.values._exit = True
37 if msg: 35 if msg:
1136 replace('\\ ', ' ') 1134 replace('\\ ', ' ')
1137 self.assert_(re.match(matchme, linegot.strip()), message) 1135 self.assert_(re.match(matchme, linegot.strip()), message)
1138 def testall(self): 1136 def testall(self):
1139 if self.CmdApp: 1137 if self.CmdApp:
1140 its = sorted(self.transcripts.items()) 1138 its = sorted(self.transcripts.items())
1141 logging.error(str(its))
1142 for (fname, transcript) in its: 1139 for (fname, transcript) in its:
1143 logging.error(fname)
1144 self._test_transcript(fname, transcript) 1140 self._test_transcript(fname, transcript)
1145 logging.error('finished')
1146 def _test_transcript(self, fname, transcript): 1141 def _test_transcript(self, fname, transcript):
1147 lineNum = 0 1142 lineNum = 0
1148 try: 1143 try:
1149 line = transcript.next() 1144 line = transcript.next()
1150 while True: 1145 while True: