Skip to content

Commit e5bc1c1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 982e265 commit e5bc1c1

7 files changed

Lines changed: 41 additions & 41 deletions

File tree

doc-source/api/bases.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ from :class:`NamedList` rather than from :func:`~.namedlist`. For example, do th
6363
.. code-block:: python
6464
6565
>>> class ShoppingList(NamedList):
66-
... pass
66+
... pass
6767
>>>
6868
6969
and not this:

domdf_python_tools/doctools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def sphinxify_docstring() -> Callable[[_F], _F]:
216216
.. code-block:: python
217217
218218
intersphinx_mapping = {
219-
"python": ("https://docs.python.org/3/", None),
220-
}
219+
"python": ("https://docs.python.org/3/", None),
220+
}
221221
"""
222222

223223
def wrapper(target: _F) -> _F:

domdf_python_tools/getters.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ class attrgetter:
5555
.. code-block:: python
5656
5757
>>> from pathlib import Path
58-
>>> attrgetter(0, 'name')([Path("dir/code.py")])
58+
>>> attrgetter(0, "name")([Path("dir/code.py")])
5959
'code.py'
60-
>>> attrgetter(2, 'parent.name')([Path("dir/coincidence.py"), Path("dir/wheel.py"), Path("dir/operator.py")])
60+
>>> attrgetter(2, "parent.name")([Path("dir/coincidence.py"), Path("dir/wheel.py"), Path("dir/operator.py")])
6161
'dir'
6262
6363
.. seealso:: :func:`operator.attrgetter` and :func:`operator.itemgetter`
@@ -110,14 +110,14 @@ class itemgetter:
110110
111111
.. code-block:: python
112112
113-
>>> itemgetter(0, 1)(['ABCDEFG'])
113+
>>> itemgetter(0, 1)(["ABCDEFG"])
114114
'B'
115-
>>> itemgetter(1, 2)(['ABC', 'DEF'])
115+
>>> itemgetter(1, 2)(["ABC", "DEF"])
116116
'F'
117-
>>> itemgetter(0, slice(2, None))(['ABCDEFG'])
117+
>>> itemgetter(0, slice(2, None))(["ABCDEFG"])
118118
'CDEFG'
119-
>>> army = [dict(rank='captain', name='Blackadder'), dict(rank='Private', name='Baldrick')]
120-
>>> itemgetter(0, 'rank')(army)
119+
>>> army = [dict(rank="captain", name="Blackadder"), dict(rank="Private", name="Baldrick")]
120+
>>> itemgetter(0, "rank")(army)
121121
'captain'
122122
123123
.. seealso:: :func:`operator.itemgetter`
@@ -158,11 +158,11 @@ class methodcaller:
158158
.. code-block:: python
159159
160160
>>> from datetime import date
161-
>>> methodcaller(0, 'upper')(["hello", "world"])
161+
>>> methodcaller(0, "upper")(["hello", "world"])
162162
'HELLO'
163-
>>> methodcaller(1, 'center', 9, "=")(["hello", "world"])
163+
>>> methodcaller(1, "center", 9, '=')(["hello", "world"])
164164
'==world=='
165-
>>> methodcaller(0, 'replace', year=2019)([date(2021, 7, 6)])
165+
>>> methodcaller(0, "replace", year=2019)([date(2021, 7, 6)])
166166
datetime.date(2019, 7, 6)
167167
168168
.. seealso:: :func:`operator.methodcaller` and :func:`operator.itemgetter`

domdf_python_tools/iterative.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ def groupfloats(
306306
.. code-block:: python
307307
308308
>>> list(groupfloats(
309-
... [170.0, 170.05, 170.1, 170.15, 171.05, 171.1, 171.15, 171.2],
310-
... step=0.05,
311-
... ))
309+
... [170.0, 170.05, 170.1, 170.15, 171.05, 171.1, 171.15, 171.2],
310+
... step=0.05,
311+
... ))
312312
[(170.0, 170.05, 170.1, 170.15), (171.05, 171.1, 171.15, 171.2)]
313313
>>> list(groupfloats([1, 2, 3, 4, 5, 7, 8, 9, 10]))
314314
[(1, 2, 3, 4, 5), (7, 8, 9, 10)]

domdf_python_tools/pagesizes/units.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,26 +80,26 @@ class Unit(float):
8080
8181
.. code-block:: python
8282
83-
>>> (3*mm) + (7*mm)
83+
>>> (3 * mm) + (7 * mm)
8484
<Unit '10.000 mm': 28.346pt>
8585
8686
When adding different :class:`~domdf_python_tools.pagesizes.units.Unit` objects,
8787
the result has the type of the former unit:
8888
8989
.. code-block:: python
9090
91-
>>> (2.54*cm) + inch
91+
>>> (2.54 * cm) + inch
9292
<Unit '5.080 cm': 144.000pt>
93-
>>> inch + (2.54*cm)
93+
>>> inch + (2.54 * cm)
9494
<Unit '2.000 inch': 144.000pt>
9595
9696
:class:`~domdf_python_tools.pagesizes.units.Unit` objects can also be added to :class:`float` and :class:`int` objects:
9797
9898
.. code-block:: python
9999
100-
>>> (3*cm) + 7
100+
>>> (3 * cm) + 7
101101
<Unit '10.000 cm': 283.465pt>
102-
>>> 7 + (3*cm)
102+
>>> 7 + (3 * cm)
103103
<Unit '10.000 cm': 283.465pt>
104104
105105
@@ -109,15 +109,15 @@ class Unit(float):
109109
110110
.. code-block:: python
111111
112-
>>> (17*mm) - (7*mm)
112+
>>> (17 * mm) - (7 * mm)
113113
<Unit '10.000 mm': 28.346pt>
114-
>>> (2.54*cm) - inch
114+
>>> (2.54 * cm) - inch
115115
<Unit '0.000 cm': 0.000pt>
116-
>>> inch - (2.54*cm)
116+
>>> inch - (2.54 * cm)
117117
<Unit '0.000 inch': 0.000pt>
118-
>>> (17*cm) - 7
118+
>>> (17 * cm) - 7
119119
<Unit '10.000 cm': 283.465pt>
120-
>>> 17 - (7*cm)
120+
>>> 17 - (7 * cm)
121121
<Unit '10.000 cm': 283.465pt>
122122
123123
@@ -128,11 +128,11 @@ class Unit(float):
128128
129129
.. code-block:: python
130130
131-
>>> (3*mm) * 3
131+
>>> (3 * mm) * 3
132132
<Unit '9.000 mm': 25.512pt>
133-
>>> 3 * (3*mm)
133+
>>> 3 * (3 * mm)
134134
<Unit '9.000 mm': 25.512pt>
135-
>>> 3.5 * (3*mm)
135+
>>> 3.5 * (3 * mm)
136136
<Unit '10.500 mm': 29.764pt>
137137
138138
Multiplication works either way round.
@@ -142,7 +142,7 @@ class Unit(float):
142142
143143
.. code-block:: python
144144
145-
>>> inch * (7*cm)
145+
>>> inch * (7 * cm)
146146
Traceback (most recent call last):
147147
NotImplementedError: Multiplying a unit by another unit is not allowed.
148148
@@ -153,16 +153,16 @@ class Unit(float):
153153
154154
.. code-block:: python
155155
156-
>>> (3*mm) / 3
156+
>>> (3 * mm) / 3
157157
<Unit '1.000 mm': 2.835pt>
158-
>>> (10*mm) / 2.5
158+
>>> (10 * mm) / 2.5
159159
<Unit '4.000 mm': 11.339pt>
160160
161161
Dividing by another unit results in a :exc:`NotImplementedError`:
162162
163163
.. code-block:: python
164164
165-
>>> inch / (7*cm)
165+
>>> inch / (7 * cm)
166166
Traceback (most recent call last):
167167
NotImplementedError: Dividing a unit by another unit is not allowed.
168168
@@ -171,7 +171,7 @@ class Unit(float):
171171
172172
.. code-block:: python
173173
174-
>>> 3 / (3*mm)
174+
>>> 3 / (3 * mm)
175175
Traceback (most recent call last):
176176
NotImplementedError: Dividing by a unit is not allowed.
177177
@@ -188,7 +188,7 @@ class Unit(float):
188188
189189
.. code-block:: python
190190
191-
>>> (3*mm) % 2.5
191+
>>> (3 * mm) % 2.5
192192
<Unit '0.500 mm': 1.417pt>
193193
194194
Dividing by a unit, or modulo division of two units, is not officially supported.

domdf_python_tools/stringlist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def with_indent(self, indent: Union[String, Indent], size: int = 0):
405405
406406
>>> sl = StringList()
407407
>>> with sl.with_indent(" ", 1):
408-
... sl.append("Hello World")
408+
... sl.append("Hello World")
409409
410410
:param indent: The :class:`~.Indent` to use within the ``with`` block, or the indent type.
411411
:param size: If ``indent`` is an indent type, the indent size to use within the ``with`` block.
@@ -428,7 +428,7 @@ def with_indent_size(self, size: int = 0):
428428
429429
>>> sl = StringList()
430430
>>> with sl.with_indent_size(1):
431-
... sl.append("Hello World")
431+
... sl.append("Hello World")
432432
433433
:param size: The indent size to use within the ``with`` block.
434434
"""
@@ -450,7 +450,7 @@ def with_indent_type(self, indent_type: str = '\t'):
450450
451451
>>> sl = StringList()
452452
>>> with sl.with_indent_type(" "):
453-
... sl.append("Hello World")
453+
... sl.append("Hello World")
454454
455455
:param indent_type: The type of indent to use within the ``with`` block.
456456
"""

domdf_python_tools/words.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,9 @@ class PluralPhrase(NamedTuple):
653653
.. code-block:: python
654654
655655
>>> phrase = PluralPhrase(
656-
... "The proposed {} {} to ...",
657-
... (Plural("change", "changes"), Plural("is", "are"))
658-
... )
656+
... "The proposed {} {} to ...",
657+
... (Plural("change", "changes"), Plural("is", "are")),
658+
... )
659659
>>> phrase(1)
660660
'The proposed change is to ...'
661661
>>> phrase(2)

0 commit comments

Comments
 (0)