Skip to content

Commit 164ed17

Browse files
authored
Merge pull request #217 from python-cmd2/update_changelog
Updated CHANGELOG text regarding recent enhancements to transcript regexes
2 parents 319e66b + 6676d23 commit 164ed17

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
* For ``edit`` command, both **editor** and **filename** can now have spaces in the name/path
77
* Enhancements
88
* ``feedback_to_output`` now defaults to ``False`` so info like command timing won't redirect
9+
* Transcript regular expressions now have predictable, tested, and documented behavior
10+
* This makes a breaking change to the format and expectations of transcript testing
11+
* The prior behavior removed whitespace before making the comparison, now whitespace must match exactly
12+
* Prior version did not allow regexes with whitespace, new version allows any regex
913

1014
## 0.7.6 (August 11, 2017)
1115

cmd2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
else:
9999
BROKEN_PIPE_ERROR = IOError
100100

101-
__version__ = '0.7.7a'
101+
__version__ = '0.7.7'
102102

103103
# Pyparsing enablePackrat() can greatly speed up parsing, but problems have been seen in Python 3 in the past
104104
pyparsing.ParserElement.enablePackrat()
@@ -2305,7 +2305,7 @@ def _test_transcript(self, fname, transcript):
23052305
break
23062306
line_num += 1
23072307
expected = ''.join(expected)
2308-
2308+
23092309
# transform the expected text into a valid regular expression
23102310
expected = self._transform_transcript_expected(expected)
23112311
message = '\nFile {}, line {}\nCommand was:\n{}\nExpected:\n{}\nGot:\n{}\n'.format(
@@ -2318,7 +2318,7 @@ def _transform_transcript_expected(self, s):
23182318
backslash = '\\'
23192319
regex = ''
23202320
start = 0
2321-
2321+
23222322
while True:
23232323
(regex, first_slash_pos, start) = self._escaped_find(regex, s, start, False)
23242324
if first_slash_pos == -1:
@@ -2349,12 +2349,12 @@ def _transform_transcript_expected(self, s):
23492349
def _escaped_find(self, regex, s, start, in_regex):
23502350
"""
23512351
Find the next slash in {s} after {start} that is not preceded by a backslash.
2352-
2352+
23532353
If we find an escaped slash, add everything up to and including it to regex,
23542354
updating {start}. {start} therefore serves two purposes, tells us where to start
23552355
looking for the next thing, and also tells us where in {s} we have already
23562356
added things to {regex}
2357-
2357+
23582358
{in_regex} specifies whether we are currently searching in a regex, we behave
23592359
differently if we are or if we aren't.
23602360
"""

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
# The short X.Y version.
6363
version = '0.7'
6464
# The full version, including alpha/beta/rc tags.
65-
release = '0.7.7a'
65+
release = '0.7.7'
6666

6767
# The language for content autogenerated by Sphinx. Refer to documentation
6868
# for a list of supported languages.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66
from setuptools import setup
77

8-
VERSION = '0.7.7a'
8+
VERSION = '0.7.7'
99
DESCRIPTION = "cmd2 - a tool for building interactive command line applications in Python"
1010
LONG_DESCRIPTION = """cmd2 is a tool for building interactive command line applications in Python. Its goal is to make
1111
it quick and easy for developers to build feature-rich and user-friendly interactive command line applications. It

tests/test_cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
def test_ver():
26-
assert cmd2.__version__ == '0.7.7a'
26+
assert cmd2.__version__ == '0.7.7'
2727

2828

2929
def test_empty_statement(base_app):

0 commit comments

Comments
 (0)