Jakub Klinkovský 1 год назад
Родитель
Сommit
f3dd73d8a0
2 измененных файлов: 6 добавлений и 4 удалений
  1. +3
    -2
      src/mwparserfromhell/nodes/html_entity.py
  2. +3
    -2
      src/mwparserfromhell/nodes/template.py

+ 3
- 2
src/mwparserfromhell/nodes/html_entity.py Просмотреть файл

@@ -132,8 +132,9 @@ class HTMLEntity(Node):
int(self.value, 16) int(self.value, 16)
except ValueError as exc: except ValueError as exc:
raise ValueError( raise ValueError(
"current entity value {!r} is not a valid "
"Unicode codepoint".format(self.value)
"current entity value {!r} is not a valid Unicode codepoint".format(
self.value
)
) from exc ) from exc
self._named = newval self._named = newval




+ 3
- 2
src/mwparserfromhell/nodes/template.py Просмотреть файл

@@ -32,6 +32,7 @@ FLAGS = re.DOTALL | re.UNICODE
# Used to allow None as a valid fallback value # Used to allow None as a valid fallback value
_UNSET = object() _UNSET = object()



class Template(Node): class Template(Node):
"""Represents a template in wikicode, like ``{{foo}}``.""" """Represents a template in wikicode, like ``{{foo}}``."""


@@ -331,9 +332,9 @@ class Template(Node):
def update(self, params, **kwargs): def update(self, params, **kwargs):
"""Update the template with multiple parameters at once. """Update the template with multiple parameters at once.
Args: Args:
params: A dictionary mapping parameter names to values.
params: A dictionary mapping parameter names to values.
**kwargs: Optional arguments that will be applied to all parameters, **kwargs: Optional arguments that will be applied to all parameters,
matching the same arguments in :meth:`add` (showkey, before,
matching the same arguments in :meth:`add` (showkey, before,
after, preserve_spacing) after, preserve_spacing)
""" """
for name, value in params.items(): for name, value in params.items():


Загрузка…
Отмена
Сохранить