- Added ParserElement.split() generator method, similar to re.split(). Includes optional arguments maxsplit (to limit the number of splits), and includeSeparators (to include the separating matched text in the returned output, default=False). - Added a new parse action construction helper tokenMap, which will apply a function and optional arguments to each element in a ParseResults. So this parse action: def lowercase_all(tokens): return [str(t).lower() for t in tokens] OneOrMore(Word(alphas)).setParseAction(lowercase_all) can now be written: OneOrMore(Word(alphas)).setParseAction(tokenMap(str.lower)) Also simplifies writing conversion parse actions like: integer = Word(nums).setParseAction(lambda t: int(t[0])) to just: integer = Word(nums).setParseAction(tokenMap(int)) If additional arguments are necessary, they can be included in the call to tokenMap, as in: hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16)) - Added more expressions to pyparsing_common: . IPv4 and IPv6 addresses (including long, short, and mixed forms of IPv6) . MAC address . ISO8601 date and date time strings (with named fields for year, month, etc.) . UUID (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) . hex integer (returned as int) . fraction (integer '/' integer, returned as float) . mixed integer (integer '-' fraction, or just fraction, returned as float) . stripHTMLTags (parse action to remove tags from HTML source) . parse action helpers convertToDate and convertToDatetime to do custom parse time conversions of parsed ISO8601 strings - runTests now returns a two-tuple: success if all tests succeed, and an output list of each test and its output lines. - Added failureTests argument (default=False) to runTests, so that tests can be run that are expected failures, and runTests' success value will return True only if all tests *fail* as expected. Also, parseAll now defaults to True. - New example numerics.py, shows samples of parsing integer and real numbers using locale-dependent formats: 4.294.967.295,000 4 294 967 295,000 4,294,967,295.000 |
||
---|---|---|
.. | ||
README.md | ||
requirements-check-manifest.txt | ||
requirements-check-manifest.txt-raw | ||
requirements-codecov.txt | ||
requirements-codecov.txt-raw | ||
requirements-cxfreeze.txt | ||
requirements-cxfreeze.txt-raw | ||
requirements-flake8.txt | ||
requirements-flake8.txt-raw | ||
requirements-pip.txt | ||
requirements-pyinstaller.txt | ||
requirements-pyinstaller.txt-raw | ||
requirements-pylint-master.txt | ||
requirements-pylint-master.txt-raw | ||
requirements-pylint.txt | ||
requirements-pylint.txt-raw | ||
requirements-pyroma.txt | ||
requirements-pyroma.txt-raw | ||
requirements-qutebrowser.txt-raw | ||
requirements-tests.txt | ||
requirements-tests.txt-raw | ||
requirements-tox.txt | ||
requirements-tox.txt-raw | ||
requirements-vulture.txt | ||
requirements-vulture.txt-raw |
This directory contains various requirements
files which are used by tox
to
have reproducable tests with pinned versions.
The files are generated based on unpinned requirements in *.txt-raw
files.
Those files can also contain some special commands:
- Add an additional comment to a line:
#@ comment: <package> <comment here>
- Filter a line for requirements.io:
#@ filter: <package> <filter>
- Don't include a package in the output:
#@ ignore: <package>
(or multiple packages) - Replace a part of a frozen package specification with another:
#@ replace <regex> <replacement>
Some examples:
#@ comment: mypkg blah blub
#@ filter: mypkg != 1.0.0
#@ ignore: mypkg, otherpkg
#@ replace: foo bar