b099f64efa
- 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
30 lines
637 B
Plaintext
30 lines
637 B
Plaintext
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
|
|
|
ebb-lint==0.4.4
|
|
flake8==2.5.4
|
|
flake8-copyright==0.1
|
|
flake8-debugger==1.4.0
|
|
flake8-deprecated==1.0
|
|
flake8-docstrings==0.2.6
|
|
flake8-future-import==0.4.1
|
|
flake8-mock==0.2
|
|
flake8-pep3101==0.3
|
|
flake8-putty==0.3.2
|
|
flake8-string-format==0.2.2
|
|
flake8-tidy-imports==1.0.0
|
|
flake8-tuple==0.2.9
|
|
hacking==0.11.0
|
|
intervaltree==2.1.0
|
|
mccabe==0.5.0
|
|
packaging==16.7
|
|
pbr==1.10.0
|
|
pep257==0.7.0 # still needed by flake8-docstrings but ignored
|
|
pep8==1.7.0
|
|
pep8-naming==0.3.3
|
|
pydocstyle==1.0.0
|
|
pyflakes==1.2.3
|
|
pyparsing==2.1.5
|
|
six==1.10.0
|
|
sortedcontainers==1.5.3
|
|
venusian==1.0
|