# HG changeset patch # User Catherine Devlin # Date 1238707322 14400 # Node ID 7a98d7f2da30390febbbf8d29c99272d41122362 # Parent d62bb3dd58a0764209c74cf7d0f42e6c2097f6a2 I get it - BASH line expansion of file names gets me diff -r d62bb3dd58a0 -r 7a98d7f2da30 cmd2.py --- a/cmd2.py Thu Apr 02 15:55:33 2009 -0400 +++ b/cmd2.py Thu Apr 02 17:22:02 2009 -0400 @@ -29,8 +29,6 @@ __version__ = '0.5.1' import logging -logging.basicConfig(filename='log.txt') - class OptionParser(optparse.OptionParser): def exit(self, status=0, msg=None): self.values._exit = True @@ -1138,11 +1136,8 @@ def testall(self): if self.CmdApp: its = sorted(self.transcripts.items()) - logging.error(str(its)) for (fname, transcript) in its: - logging.error(fname) self._test_transcript(fname, transcript) - logging.error('finished') def _test_transcript(self, fname, transcript): lineNum = 0 try: diff -r d62bb3dd58a0 -r 7a98d7f2da30 example/example.py --- a/example/example.py Thu Apr 02 15:55:33 2009 -0400 +++ b/example/example.py Thu Apr 02 17:22:02 2009 -0400 @@ -32,13 +32,18 @@ class TestMyAppCase(Cmd2TestCase): CmdApp = CmdLineApp - +import logging +logging.basicConfig(level=logging.DEBUG, + filename='exlog.txt', + filemode='w') parser = optparse.OptionParser() parser.add_option('-t', '--test', dest='test', metavar='FILE', help='''Test against transcript(s) in FILE (wildcards OK)''') (callopts, callargs) = parser.parse_args() +logging.error(callopts) if callopts.test: CmdLineApp.testfile = callopts.test + logging.error(CmdLineApp.testfile) sys.argv = [sys.argv[0]] # the --test argument upsets unittest.main() unittest.main() else: