Skip to content

Commit a8ba43e

Browse files
authored
Merge pull request #270 from gsnedders/rename_stuff
2 parents 945911b + 8cb144b commit a8ba43e

40 files changed

+219
-275
lines changed

CHANGES.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ Released on XXX
5050
with a set of keyword arguments: override_encoding, transport_encoding,
5151
same_origin_parent_encoding, likely_encoding, and default_encoding.**
5252

53+
* **Move filters._base, treebuilder._base, and treewalkers._base to .base
54+
to clarify their status as public.**
55+
56+
* **Get rid of the sanitizer package. Merge sanitizer.sanitize into the
57+
sanitizer.htmlsanitizer module and move that to saniziter. This means
58+
anyone who used sanitizer.sanitize or sanitizer.HTMLSanitizer needs no
59+
code changes.**
60+
61+
* **Rename treewalkers.lxmletree to .etree_lxml and
62+
treewalkers.genshistream to .genshi to have a consistent API.**
63+
64+
* Move a whole load of stuff (inputstream, ihatexml, trie, tokenizer,
65+
utils) to be underscore prefixed to clarify their status as private.
66+
5367

5468
0.9999999/1.0b8
5569
~~~~~~~~~~~~~~~

doc/html5lib.filters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
filters Package
22
===============
33

4-
:mod:`_base` Module
4+
:mod:`base` Module
55
-------------------
66

7-
.. automodule:: html5lib.filters._base
7+
.. automodule:: html5lib.filters.base
88
:members:
99
:undoc-members:
1010
:show-inheritance:

doc/html5lib.rst

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -25,42 +25,10 @@ html5lib Package
2525
:undoc-members:
2626
:show-inheritance:
2727

28-
:mod:`ihatexml` Module
28+
:mod:`serializer` Module
2929
----------------------
3030

31-
.. automodule:: html5lib.ihatexml
32-
:members:
33-
:undoc-members:
34-
:show-inheritance:
35-
36-
:mod:`inputstream` Module
37-
-------------------------
38-
39-
.. automodule:: html5lib.inputstream
40-
:members:
41-
:undoc-members:
42-
:show-inheritance:
43-
44-
:mod:`sanitizer` Module
45-
-----------------------
46-
47-
.. automodule:: html5lib.sanitizer
48-
:members:
49-
:undoc-members:
50-
:show-inheritance:
51-
52-
:mod:`tokenizer` Module
53-
-----------------------
54-
55-
.. automodule:: html5lib.tokenizer
56-
:members:
57-
:undoc-members:
58-
:show-inheritance:
59-
60-
:mod:`utils` Module
61-
-------------------
62-
63-
.. automodule:: html5lib.utils
31+
.. automodule:: html5lib.serializer
6432
:members:
6533
:undoc-members:
6634
:show-inheritance:
@@ -71,7 +39,6 @@ Subpackages
7139
.. toctree::
7240

7341
html5lib.filters
74-
html5lib.serializer
7542
html5lib.treebuilders
7643
html5lib.treewalkers
7744

doc/html5lib.serializer.rst

Lines changed: 0 additions & 19 deletions
This file was deleted.

doc/html5lib.treebuilders.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ treebuilders Package
99
:undoc-members:
1010
:show-inheritance:
1111

12-
:mod:`_base` Module
12+
:mod:`base` Module
1313
-------------------
1414

15-
.. automodule:: html5lib.treebuilders._base
15+
.. automodule:: html5lib.treebuilders.base
1616
:members:
1717
:undoc-members:
1818
:show-inheritance:

doc/html5lib.treewalkers.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ treewalkers Package
99
:undoc-members:
1010
:show-inheritance:
1111

12-
:mod:`_base` Module
12+
:mod:`base` Module
1313
-------------------
1414

15-
.. automodule:: html5lib.treewalkers._base
15+
.. automodule:: html5lib.treewalkers.base
1616
:members:
1717
:undoc-members:
1818
:show-inheritance:
@@ -33,18 +33,19 @@ treewalkers Package
3333
:undoc-members:
3434
:show-inheritance:
3535

36-
:mod:`genshistream` Module
37-
--------------------------
36+
:mod:`etree_lxml` Module
37+
-----------------------
3838

39-
.. automodule:: html5lib.treewalkers.genshistream
39+
.. automodule:: html5lib.treewalkers.etree_lxml
4040
:members:
4141
:undoc-members:
4242
:show-inheritance:
4343

44-
:mod:`lxmletree` Module
45-
-----------------------
4644

47-
.. automodule:: html5lib.treewalkers.lxmletree
45+
:mod:`genshi` Module
46+
--------------------------
47+
48+
.. automodule:: html5lib.treewalkers.genshi
4849
:members:
4950
:undoc-members:
50-
:show-inheritance:
51+
:show-inheritance:
File renamed without changes.

html5lib/inputstream.py renamed to html5lib/_inputstream.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
1212
from .constants import ReparseException
13-
from . import utils
13+
from . import _utils
1414

1515
from io import StringIO
1616

@@ -28,7 +28,7 @@
2828

2929
invalid_unicode_no_surrogate = "[\u0001-\u0008\u000B\u000E-\u001F\u007F-\u009F\uFDD0-\uFDEF\uFFFE\uFFFF\U0001FFFE\U0001FFFF\U0002FFFE\U0002FFFF\U0003FFFE\U0003FFFF\U0004FFFE\U0004FFFF\U0005FFFE\U0005FFFF\U0006FFFE\U0006FFFF\U0007FFFE\U0007FFFF\U0008FFFE\U0008FFFF\U0009FFFE\U0009FFFF\U000AFFFE\U000AFFFF\U000BFFFE\U000BFFFF\U000CFFFE\U000CFFFF\U000DFFFE\U000DFFFF\U000EFFFE\U000EFFFF\U000FFFFE\U000FFFFF\U0010FFFE\U0010FFFF]" # noqa
3030

31-
if utils.supports_lone_surrogates:
31+
if _utils.supports_lone_surrogates:
3232
# Use one extra step of indirection and create surrogates with
3333
# eval. Not using this indirection would introduce an illegal
3434
# unicode literal on platforms not supporting such lone
@@ -176,7 +176,7 @@ def __init__(self, source):
176176
177177
"""
178178

179-
if not utils.supports_lone_surrogates:
179+
if not _utils.supports_lone_surrogates:
180180
# Such platforms will have already checked for such
181181
# surrogate errors, so no need to do this checking.
182182
self.reportCharacterErrors = None
@@ -304,9 +304,9 @@ def characterErrorsUCS2(self, data):
304304
codepoint = ord(match.group())
305305
pos = match.start()
306306
# Pretty sure there should be endianness issues here
307-
if utils.isSurrogatePair(data[pos:pos + 2]):
307+
if _utils.isSurrogatePair(data[pos:pos + 2]):
308308
# We have a surrogate pair!
309-
char_val = utils.surrogatePairToCodepoint(data[pos:pos + 2])
309+
char_val = _utils.surrogatePairToCodepoint(data[pos:pos + 2])
310310
if char_val in non_bmp_invalid_codepoints:
311311
self.errors.append("invalid-codepoint")
312312
skip = True

html5lib/tokenizer.py renamed to html5lib/_tokenizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
from .constants import tokenTypes, tagTokenTypes
1212
from .constants import replacementCharacters
1313

14-
from .inputstream import HTMLInputStream
14+
from ._inputstream import HTMLInputStream
1515

16-
from .trie import Trie
16+
from ._trie import Trie
1717

1818
entitiesTrie = Trie(entities)
1919

File renamed without changes.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy