Ben Kurtovic
b7b3b2e33e
Update changelog; minor tweak to file headers
há 3 anos
Ben Kurtovic
1c983d3738
Assorted cleanup, linter fixes, and improvements for Python 3
há 3 anos
AntiCompositeNumber
f241829d37
Make nodes.template.Template a bit more dict-like ( #252 )
* nodes: add a `default` param to Template.get
Similar to dict.get, Template.get with a default param supplied will
return that value instead of raising an exception. If default is unset,
Template.get will keep its previous behavior and raise an exception.
* nodes: Add __getitem__, __setitem__, and __delitem__ to Template
These are just aliases for existing methods, without the ability to
specifiy additional parameters. However, including them makes Template
more dict-like, so it's a good idea to have them.
* nodes: Use def instead of assignment of a lambda in Template
Per PEP8, there is no benefit to using a lambda here, and some
downsides. It's the same number of SLOC either way, so might as well
change it.
há 3 anos
Kunal Mehta
7e5297fbe6
Drop Python 2 support
Fixes #221 .
há 4 anos
Ben Kurtovic
83bcb902b8
Support manual construction of Node objects ( fixes #214 )
há 5 anos
Ben Kurtovic
7a30e47f76
Some improvements to whitespace recognition; unit tests ( #185 ).
há 6 anos
Ben Kurtovic
7308c8055e
Not perfect, but slightly better template param space guessing ( #155 )
há 6 anos
Ben Kurtovic
68ded2f890
Add keep_template_params to Wikicode.strip_code ( #175 )
há 7 anos
Ben Kurtovic
6159171e04
Make Template.remove(keep_field=True) slightly more reasonable.
há 7 anos
Ben Kurtovic
aaffb7f66b
Update copyright for 2016.
há 8 anos
Ben Kurtovic
699d0638f6
Fix param blanking logic by Template.remove() ( #109 )
há 8 anos
Ben Kurtovic
4c2540060b
Fix preserve_spacing behavior in Template.add() on hidden keys ( #109 )
há 8 anos
Ben Kurtovic
e71e7b4ece
Update copyright years for 2015; fix whitespace in docs.
há 9 anos
Ben Kurtovic
87e0079512
Take proper advantage of Sphinx's default domains.
há 9 anos
Ben Kurtovic
8bc7ea669d
Improve test coverage; fix some node-related bugs.
* Parameters with non-integer keys can no longer be created with
showkey=False, nor have the value of this attribute be set to False
later.
* Calling Template.remove() with a Parameter object that is not part of
the template now raises ValueError instead of doing nothing.
* Added tests for HTMLEntity._unichr() being called with out-of-range
codepoints.
* Added tests for Tag.__children__() and Tag.__showtree__() involving
attributes that have no values.
há 9 anos
Ricordisamoa
9108d49d68
fix some typos: occurance → occurrence, parasable → parsable
há 10 anos
Ben Kurtovic
e5f17eea00
Update copyright notices for 2014.
há 10 anos
Ben Kurtovic
45aec31629
Move range/xrange compatibility code to compat.py.
há 10 anos
Ben Kurtovic
99d433c2d5
Change protocol for Node iteration; rename __iternodes__ to __children__.
há 10 anos
Ben Kurtovic
066049b46a
Update email address.
há 10 anos
Ben Kurtovic
cf90557229
Template.has() should be passed ignore_empty=False by default.
**Breaking change**; closes #51 .
há 10 anos
Ben Kurtovic
40b92358b4
Simplify parameter removal.
há 10 anos
Ben Kurtovic
f2442906db
Implement support for Template.remove() taking Parameters as arguments.
há 10 anos
Ben Kurtovic
53c26589ee
Some node fixes; attributes with empty values now display correctly.
há 10 anos
Ben Kurtovic
a7dda77474
Template.has_param() -> Template.has()
há 10 anos
Ben Kurtovic
3fb8f3214c
Fix StringMixIn.maketrans() on Py3k.
- Make a test in Py3k actually use StringMixIn instead of str.
- Minor cosmetic fix.
há 11 anos
Ben Kurtovic
81849013bc
Finishing tests for Templates; some fixes.
há 11 anos
Ben Kurtovic
2ca3b2805e
Implement 'before' parameter for Template.add() ( closes #21 )
há 11 anos
Ben Kurtovic
b46c98b012
Clean up template.add(); add a before param but do not implement yet.
há 11 anos
Ben Kurtovic
786d619274
Drop force_no_field in template.remove(); implement test_remove().
- Also add tests for spacing in param names.
há 11 anos
Ben Kurtovic
6a385b3921
TestParameter and a fair chunk of TestTemplate.
há 11 anos
Ben Kurtovic
cd5cc6a7d0
Update copyright notices for 2013.
há 11 anos
Ben Kurtovic
76b299e4fa
Sync from upstream ( 6413ae21da
); some doc updates.
há 11 anos
Ben Kurtovic
6413ae21da
Should have used the param's name here instead of its value.
há 11 anos
Ben Kurtovic
816207bb5a
Simplify docs massively.
há 11 anos
Ben Kurtovic
1caeb2d570
Build the actual Sphinx documentation, plus a number of typo fixes.
há 11 anos
Ben Kurtovic
b0418189d6
Document all of Template, plus some other fixes.
há 11 anos
Ben Kurtovic
90b18e3abc
Finish updating all to compat except for the parser.
há 11 anos
Ben Kurtovic
e6fa7b2b2d
Support changing a template's name, plus a couple of typos and docs.
há 11 anos
Riamse
2eb76e7de0
Adding Python 3 support
há 11 anos
Ben Kurtovic
fc66ce0654
Update remove() for when a templates has the same key multiple times.
há 11 anos
Ben Kurtovic
e57b6bdd93
Support Headings in tokenizer; handle tokens backwards in builder.
* Some other fixes, additions.
há 11 anos
Ben Kurtovic
6fefc28cba
Handle integers as MediaWiki does.
há 11 anos
Ben Kurtovic
69b236ee8d
Handle template parameter key dependents more intelligently.
há 11 anos
Ben Kurtovic
934b1ef016
Fixes and improvements.
há 11 anos
Ben Kurtovic
81e5ce30af
Working on the framework for the tokenizer, plus some cleanup, fixes.
há 11 anos
Ben Kurtovic
137b9fc68f
Fix some bugs; satisfy PyLint on certain inheritance things.
há 11 anos
Ben Kurtovic
3633f31633
Relaive imports because they are awesome; more stuff in SmartList.
há 11 anos
Ben Kurtovic
9355f22d22
Implement interface for __showtree__.
Some cleanup and import fixes.
há 11 anos
Ben Kurtovic
c3ee6c919d
Implementing __iternodes__ protocol.
há 11 anos