|
13 | 13 |
|
14 | 14 |
|
15 | 15 | __all__ = ["HsdParser", |
16 | | - "SYNTAX_ERROR", "UNCLOSED_TAG_ERROR", "UNCLOSED_OPTION_ERROR", |
| 16 | + "SYNTAX_ERROR", "UNCLOSED_TAG_ERROR", "UNCLOSED_ATTRIB_ERROR", |
17 | 17 | "UNCLOSED_QUOTATION_ERROR", "ORPHAN_TEXT_ERROR"] |
18 | 18 |
|
19 | 19 | SYNTAX_ERROR = 1 |
@@ -99,15 +99,15 @@ def __init__(self, eventhandler=None): |
99 | 99 | else: |
100 | 100 | self._eventhandler = eventhandler |
101 | 101 |
|
102 | | - self._fname = "" # Name of file being processed |
103 | | - self._checkstr = _GENERAL_SPECIALS # special characters to look for |
| 102 | + self._fname = "" # name of file being processed |
| 103 | + self._checkstr = _GENERAL_SPECIALS # special characters to look for |
104 | 104 | self._oldcheckstr = "" # buffer fo checkstr |
105 | 105 | self._opened_tags = [] # info about opened tags |
106 | 106 | self._buffer = [] # buffering plain text between lines |
107 | 107 | self._attrib = None # attribute for current tag |
108 | 108 | self._hsdoptions = OrderedDict() # hsd-options for current tag |
109 | 109 | self._currline = 0 # nr. of current line in file |
110 | | - self._after_equal_sign = False # last tag was opened with equal sign |
| 110 | + self._after_equal_sign = False # last tag was opened with equal sign |
111 | 111 | self._inside_attrib = False # parser inside attrib specification |
112 | 112 | self._inside_quote = False # parser inside quotation |
113 | 113 | self._has_child = False |
@@ -233,7 +233,7 @@ def _parse(self, line): |
233 | 233 | self._checkstr = _GENERAL_SPECIALS |
234 | 234 |
|
235 | 235 | # Quoting strings |
236 | | - elif sign == "'" or sign == '"': |
| 236 | + elif sign in ("'", '"'): |
237 | 237 | if self._inside_quote: |
238 | 238 | self._checkstr = self._oldcheckstr |
239 | 239 | self._inside_quote = False |
@@ -311,8 +311,7 @@ def _closetag(self): |
311 | 311 |
|
312 | 312 | def _include_hsd(self, fname): |
313 | 313 | fname = common.unquote(fname.strip()) |
314 | | - parser = HsdParser(defattrib=self._defattrib, |
315 | | - eventhandler=self._eventhandler) |
| 314 | + parser = HsdParser(eventhandler=self._eventhandler) |
316 | 315 | parser.feed(fname) |
317 | 316 |
|
318 | 317 |
|
|
0 commit comments