summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmd2.py11
-rwxr-xr-xsetup.py2
2 files changed, 9 insertions, 4 deletions
diff --git a/cmd2.py b/cmd2.py
index 84a0db8a..f7e22f9c 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -27,7 +27,7 @@ flagReader.py options are still supported for backward compatibility
import cmd, re, os, sys, optparse, subprocess, tempfile, pyparsing, doctest
import unittest, string, datetime
from optparse import make_option
-__version__ = '0.4.6'
+__version__ = '0.4.7'
class OptionParser(optparse.OptionParser):
def exit(self, status=0, msg=None):
@@ -199,6 +199,7 @@ class SkipToLast(pyparsing.SkipTo):
raise exc
def replace_with_file_contents(fname):
+ import pdb; pdb.set_trace()
if fname:
try:
result = open(os.path.expanduser(fname[0])).read()
@@ -468,9 +469,13 @@ class Cmd(cmd.Cmd):
inputMark = pyparsing.Literal('<')
inputMark.setParseAction(lambda x: '')
- inputFrom = pyparsing.Word(self.legalChars + '/\\')('inputFrom')
+ fileName = pyparsing.Word(self.legalChars + '/\\')
+ inputFrom = fileName('inputFrom')
inputFrom.setParseAction(replace_with_file_contents)
- self.inputParser = inputMark + pyparsing.Optional(inputFrom)
+ # a not-entirely-satisfactory way of distinguishing < as in "import from" from <
+ # as in "lesser than"
+ self.inputParser = inputMark + pyparsing.Optional(inputFrom) + pyparsing.Optional('>') + \
+ pyparsing.Optional(fileName) + (pyparsing.stringEnd | '|')
self.inputParser.ignore(pyparsing.quotedString).ignore(self.commentGrammars).ignore(self.commentInProgress)
def parsed(self, raw, **kwargs):
diff --git a/setup.py b/setup.py
index 83eea0cf..2fc9fe2e 100755
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name="cmd2",
- version="0.4.6",
+ version="0.4.7",
py_modules=["cmd2",],
# metadata for upload to PyPI