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

Commit0a885c6

Browse files
committed
Clean up the constants imports in html5parser
1 parent29f0512 commit0a885c6

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

‎html5lib/html5parser.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
from .treebuilders._baseimportMarker
1111

1212
from .importutils
13-
from .importconstants
14-
from .constantsimportspaceCharacters,asciiUpper2Lower
15-
from .constantsimportspecialElements
16-
from .constantsimportheadingElements
17-
from .constantsimportcdataElements,rcdataElements
18-
from .constantsimporttokenTypes,ReparseException,namespaces
19-
from .constantsimporthtmlIntegrationPointElements,mathmlTextIntegrationPointElements
20-
from .constantsimportadjustForeignAttributesasadjustForeignAttributesMap
21-
from .constantsimportE
13+
from .constantsimport (
14+
spaceCharacters,asciiUpper2Lower,
15+
specialElements,headingElements,cdataElements,rcdataElements,
16+
tokenTypes,tagTokenTypes,
17+
namespaces,
18+
htmlIntegrationPointElements,mathmlTextIntegrationPointElements,
19+
adjustForeignAttributesasadjustForeignAttributesMap,
20+
E,
21+
ReparseException
22+
)
2223

2324

2425
defparse(doc,treebuilder="etree",encoding=None,
@@ -434,7 +435,7 @@ def getPhases(debug):
434435
deflog(function):
435436
"""Logger that records which phase processes each token"""
436437
type_names=dict((value,key)forkey,valuein
437-
constants.tokenTypes.items())
438+
tokenTypes.items())
438439

439440
defwrapped(self,*args,**kwargs):
440441
iffunction.__name__.startswith("process")andlen(args)>0:
@@ -443,7 +444,7 @@ def wrapped(self, *args, **kwargs):
443444
info= {"type":type_names[token['type']]}
444445
except:
445446
raise
446-
iftoken['type']inconstants.tagTokenTypes:
447+
iftoken['type']intagTokenTypes:
447448
info["name"]=token['name']
448449

449450
self.parser.log.append((self.parser.tokenizer.state.__name__,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp