Quellcode durchsuchen

Merge pull request #75 from ricordisamoa/patch-1

fix some typos in documentation: occurance → occurrence, parasable → parsable
tags/v0.4
Ben Kurtovic vor 10 Jahren
Ursprung
Commit
1749dbc819
3 geänderte Dateien mit 9 neuen und 9 gelöschten Zeilen
  1. +1
    -1
      mwparserfromhell/nodes/tag.py
  2. +3
    -3
      mwparserfromhell/nodes/template.py
  3. +5
    -5
      mwparserfromhell/wikicode.py

+ 1
- 1
mwparserfromhell/nodes/tag.py Datei anzeigen

@@ -240,7 +240,7 @@ class Tag(Node):
pad_before_eq="", pad_after_eq=""):
"""Add an attribute with the given *name* and *value*.

*name* and *value* can be anything parasable by
*name* and *value* can be anything parsable by
:py:func:`.utils.parse_anything`; *value* can be omitted if the
attribute is valueless. *quoted* is a bool telling whether to wrap the
*value* in double quotes (this is recommended). *pad_first*,


+ 3
- 3
mwparserfromhell/nodes/template.py Datei anzeigen

@@ -95,7 +95,7 @@ class Template(Node):
def _select_theory(self, theories):
"""Return the most likely spacing convention given different options.

Given a dictionary of convention options as keys and their occurance as
Given a dictionary of convention options as keys and their occurrence as
values, return the convention that occurs the most, or ``None`` if
there is no clear preferred style.
"""
@@ -208,7 +208,7 @@ class Template(Node):
preserve_spacing=True):
"""Add a parameter to the template with a given *name* and *value*.

*name* and *value* can be anything parasable by
*name* and *value* can be anything parsable by
:py:func:`.utils.parse_anything`; pipes and equal signs are
automatically escaped from *value* when appropriate.

@@ -226,7 +226,7 @@ class Template(Node):
name), then we will place the parameter immediately before this one.
Otherwise, it will be added at the end. If *before* is a name and
exists multiple times in the template, we will place it before the last
occurance. If *before* is not in the template, :py:exc:`ValueError` is
occurrence. If *before* is not in the template, :py:exc:`ValueError` is
raised. The argument is ignored if the new parameter already exists.

If *preserve_spacing* is ``False``, we will avoid preserving spacing


+ 5
- 5
mwparserfromhell/wikicode.py Datei anzeigen

@@ -294,7 +294,7 @@ class Wikicode(StringMixIn):
def insert(self, index, value):
"""Insert *value* at *index* in the list of nodes.

*value* can be anything parasable by :py:func:`.parse_anything`, which
*value* can be anything parsable by :py:func:`.parse_anything`, which
includes strings or other :py:class:`~.Wikicode` or :py:class:`~.Node`
objects.
"""
@@ -309,7 +309,7 @@ class Wikicode(StringMixIn):
:py:class:`~.Wikicode` object (as created by :py:meth:`get_sections`,
for example). If *obj* is a string, we will operate on all instances
of that string within the code, otherwise only on the specific instance
given. *value* can be anything parasable by :py:func:`.parse_anything`.
given. *value* can be anything parsable by :py:func:`.parse_anything`.
If *recursive* is ``True``, we will try to find *obj* within our child
nodes even if it is not a direct descendant of this
:py:class:`~.Wikicode` object. If *obj* is not found,
@@ -333,7 +333,7 @@ class Wikicode(StringMixIn):
:py:class:`~.Wikicode` object (as created by :py:meth:`get_sections`,
for example). If *obj* is a string, we will operate on all instances
of that string within the code, otherwise only on the specific instance
given. *value* can be anything parasable by :py:func:`.parse_anything`.
given. *value* can be anything parsable by :py:func:`.parse_anything`.
If *recursive* is ``True``, we will try to find *obj* within our child
nodes even if it is not a direct descendant of this
:py:class:`~.Wikicode` object. If *obj* is not found,
@@ -357,7 +357,7 @@ class Wikicode(StringMixIn):
:py:class:`~.Wikicode` object (as created by :py:meth:`get_sections`,
for example). If *obj* is a string, we will operate on all instances
of that string within the code, otherwise only on the specific instance
given. *value* can be anything parasable by :py:func:`.parse_anything`.
given. *value* can be anything parsable by :py:func:`.parse_anything`.
If *recursive* is ``True``, we will try to find *obj* within our child
nodes even if it is not a direct descendant of this
:py:class:`~.Wikicode` object. If *obj* is not found,
@@ -380,7 +380,7 @@ class Wikicode(StringMixIn):
def append(self, value):
"""Insert *value* at the end of the list of nodes.

*value* can be anything parasable by :py:func:`.parse_anything`.
*value* can be anything parsable by :py:func:`.parse_anything`.
"""
nodes = parse_anything(value).nodes
for node in nodes:


Laden…
Abbrechen
Speichern