# HG changeset patch # User catherine@dellzilla # Date 1224881685 14400 # Node ID 78c4db4c204568abee8561ab0bf5327129fbbbec # Parent f7b0152c57f97e6f772c6b59ca89092269eb11b2 all done but the proper packaging diff -r f7b0152c57f9 -r 78c4db4c2045 cmd2/cmd2.py --- a/cmd2/cmd2.py Fri Oct 24 16:38:25 2008 -0400 +++ b/cmd2/cmd2.py Fri Oct 24 16:54:45 2008 -0400 @@ -24,7 +24,7 @@ """ import cmd, re, os, sys, optparse, subprocess, tempfile, pyparsing, doctest, unittest from optparse import make_option -__version__ = '0.3.7' +__version__ = '0.4' class OptionParser(optparse.OptionParser): def exit(self, status=0, msg=None): @@ -728,8 +728,6 @@ continuationPrompt = pyparsing.Suppress(pyparsing.lineStart + self.cmdapp.continuationPrompt) self.cmdtxtPattern = (prompt + pyparsing.restOfLine + pyparsing.ZeroOrMore( pyparsing.lineEnd + continuationPrompt + pyparsing.restOfLine))("command") - - pass def inputGenerator(self): while True: self.refreshCommandFinder() @@ -749,7 +747,8 @@ 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.''' + that will execute the commands in transcriptFileName and expect the results shown. + See example.py''' # problem: this (raw) case gets called by unittest.main - we don't want it to be. hmm CmdApp = None transcriptFileName = '' diff -r f7b0152c57f9 -r 78c4db4c2045 cmd2/exampleSession.txt --- a/cmd2/exampleSession.txt Fri Oct 24 16:38:25 2008 -0400 +++ b/cmd2/exampleSession.txt Fri Oct 24 16:54:45 2008 -0400 @@ -1,3 +1,7 @@ +This is cut-and-pasted from an interactive example.py session. +Calling `example.py -t` runs it as a series of unit tests, +verifying that the same output is still returned. + (Cmd) say goodnight, Gracie goodnight, Gracie (Cmd) say -p goodnight, Gracie diff -r f7b0152c57f9 -r 78c4db4c2045 setup.py --- a/setup.py Fri Oct 24 16:38:25 2008 -0400 +++ b/setup.py Fri Oct 24 16:54:45 2008 -0400 @@ -4,7 +4,7 @@ setup( name="cmd2", packages=["cmd2",], - version="0.3.7", + version="0.4", #py_modules = ['cmd2','flagReader','bootstrap'], # metadata for upload to PyPI @@ -29,7 +29,8 @@ * Parsing commands with flags * > (filename), >> (filename) redirect output to file * < (filename) gets input from file - * bare >, >>, < redirect to/from paste buffer + * bare >, >>, < redirect to/from paste buffer + * test apps against sample session transcript (see example.py in source directory) Useable without modification anywhere cmd is used; simply import cmd2.Cmd in place of cmd.Cmd.