8000 DRY · awesome-python/html5lib-python@ad50ce2 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit ad50ce2

Browse files
committed
DRY
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40818
1 parent 49b9091 commit ad50ce2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/html5lib/serializer/htmlserializer.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,9 @@ class HTMLSerializer(object):
7676
def __init__(self, **kwargs):
7777
if kwargs.has_key('quote_char'):
7878
self.use_best_quote_char = False
79-
for attr in ("quote_attr_values", "quote_char", "use_best_quote_char",
80-
"minimize_boolean_attributes", "use_trailing_solidus",
81-
"space_before_trailing_solidus", "omit_optional_tags",
82-
"strip_whitespace", "inject_meta_charset", "escape_lt_in_attrs",
83-
"escape_rcdata"):
84-
setattr(self, attr, kwargs.get(attr, getattr(self, attr)))
79+
for name,value in kwargs.items():
80+
if name in dir(self.__class__) and not name.startswith('_'):
81+
setattr(self, name, value)
8582
self.errors = []
8683
self.strict = False
8784

0 commit comments

Comments
 (0)
0