Skip to content

Commit 0a885c6

Browse files
committed
Clean up the constants imports in html5parser
1 parent 29f0512 commit 0a885c6

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

html5lib/html5parser.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
from .treebuilders._base import Marker
1111

1212
from . import utils
13-
from . import constants
14-
from .constants import spaceCharacters, asciiUpper2Lower
15-
from .constants import specialElements
16-
from .constants import headingElements
17-
from .constants import cdataElements, rcdataElements
18-
from .constants import tokenTypes, ReparseException, namespaces
19-
from .constants import htmlIntegrationPointElements, mathmlTextIntegrationPointElements
20-
from .constants import adjustForeignAttributes as adjustForeignAttributesMap
21-
from .constants import E
13+
from .constants import (
14+
spaceCharacters, asciiUpper2Lower,
15+
specialElements, headingElements, cdataElements, rcdataElements,
16+
tokenTypes, tagTokenTypes,
17+
namespaces,
18+
htmlIntegrationPointElements, mathmlTextIntegrationPointElements,
19+
adjustForeignAttributes as adjustForeignAttributesMap,
20+
E,
21+
ReparseException
22+
)
2223

2324

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

439440
def wrapped(self, *args, **kwargs):
440441
if function.__name__.startswith("process") and len(args) > 0:
@@ -443,7 +444,7 @@ def wrapped(self, *args, **kwargs):
443444
info = {"type": type_names[token['type']]}
444445
except:
445446
raise
446-
if token['type'] in constants.tagTokenTypes:
447+
if token['type'] in tagTokenTypes:
447448
info["name"] = token['name']
448449

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

0 commit comments

Comments
 (0)