Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc4dd677

Browse files
committed
Move a whole bunch of private modules to be underscore prefixed
This moves: html5lib.ihatexml -> html5lib._ihatexml html5lib.inputstream -> html5lib._inputstream html5lib.tokenizer -> html5lib._tokenizer html5lib.trie -> html5lib._trie html5lib.utils -> html5lib._utils
1 parent8db5828 commitc4dd677

21 files changed

+82
-82
lines changed
File renamed without changes.

‎html5lib/inputstream.pyrenamed 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 .constantsimportEOF,spaceCharacters,asciiLetters,asciiUppercase
1212
from .constantsimportReparseException
13-
from .importutils
13+
from .import_utils
1414

1515
fromioimportStringIO
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-
ifutils.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-
ifnotutils.supports_lone_surrogates:
179+
ifnot_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-
ifutils.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
ifchar_valinnon_bmp_invalid_codepoints:
311311
self.errors.append("invalid-codepoint")
312312
skip=True

‎html5lib/tokenizer.pyrenamed to ‎html5lib/_tokenizer.py

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

14-
from .inputstreamimportHTMLInputStream
14+
from ._inputstreamimportHTMLInputStream
1515

16-
from .trieimportTrie
16+
from ._trieimportTrie
1717

1818
entitiesTrie=Trie(entities)
1919

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎html5lib/html5parser.py

Lines changed: 45 additions & 45 deletions
Large diffs are not rendered by default.

‎html5lib/serializer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from .constantsimportvoidElements,booleanAttributes,spaceCharacters
99
from .constantsimportrcdataElements,entities,xmlEntities
10-
from .importtreewalkers,utils
10+
from .importtreewalkers,_utils
1111
fromxml.sax.saxutilsimportescape
1212

1313
spaceCharacters="".join(spaceCharacters)
@@ -33,7 +33,7 @@
3333
continue
3434
ifv!="&":
3535
iflen(v)==2:
36-
v=utils.surrogatePairToCodepoint(v)
36+
v=_utils.surrogatePairToCodepoint(v)
3737
else:
3838
v=ord(v)
3939
ifvnotinencode_entity_mapork.islower():
@@ -51,8 +51,8 @@ def htmlentityreplace_errors(exc):
5151
skip=False
5252
continue
5353
index=i+exc.start
54-
ifutils.isSurrogatePair(exc.object[index:min([exc.end,index+2])]):
55-
codepoint=utils.surrogatePairToCodepoint(exc.object[index:index+2])
54+
if_utils.isSurrogatePair(exc.object[index:min([exc.end,index+2])]):
55+
codepoint=_utils.surrogatePairToCodepoint(exc.object[index:index+2])
5656
skip=True
5757
else:
5858
codepoint=ord(c)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp