Skip to content

Commit cc88100

Browse files
authored
Merge pull request gpiozero#673 from ricksbt/master
Minor fixes for Python 3.7
2 parents 6afb676 + 94ec903 commit cc88100

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

gpiozero/boards.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class ButtonBoard(HoldMixin, CompositeDevice):
100100
Extends :class:`CompositeDevice` and represents a generic button board or
101101
collection of buttons.
102102
103-
:param int \*pins:
103+
:param int \\*pins:
104104
Specify the GPIO pins that the buttons of the board are attached to.
105105
You can designate as many pins as necessary.
106106
@@ -133,7 +133,7 @@ class ButtonBoard(HoldMixin, CompositeDevice):
133133
See :doc:`api_pins` for more information (this is an advanced feature
134134
which most users can ignore).
135135
136-
:param \*\*named_pins:
136+
:param \\*\\*named_pins:
137137
Specify GPIO pins that buttons of the board are attached to,
138138
associating each button with a property name. You can designate as
139139
many pins as necessary and use any names, provided they're not already
@@ -280,7 +280,7 @@ class LEDBoard(LEDCollection):
280280
leds = LEDBoard(2, 3, 4, 5, 6)
281281
leds.on()
282282
283-
:param int \*pins:
283+
:param int \\*pins:
284284
Specify the GPIO pins that the LEDs of the board are attached to. You
285285
can designate as many pins as necessary. You can also specify
286286
:class:`LEDBoard` instances to create trees of LEDs.
@@ -307,7 +307,7 @@ class LEDBoard(LEDCollection):
307307
See :doc:`api_pins` for more information (this is an advanced feature
308308
which most users can ignore).
309309
310-
:param \*\*named_pins:
310+
:param \\*\\*named_pins:
311311
Specify GPIO pins that LEDs of the board are attached to, associating
312312
each LED with a property name. You can designate as many pins as
313313
necessary and use any names, provided they're not already in use by
@@ -497,7 +497,7 @@ class LEDBarGraph(LEDCollection):
497497
498498
pause()
499499
500-
:param int \*pins:
500+
:param int \\*pins:
501501
Specify the GPIO pins that the LEDs of the bar graph are attached to.
502502
You can designate as many pins as necessary.
503503
@@ -896,7 +896,7 @@ class StatusZero(LEDBoard):
896896
status.wifi.green.on()
897897
status.raining.red.on()
898898
899-
:param str \*labels:
899+
:param str \\*labels:
900900
Specify the names of the labels you wish to designate the strips to.
901901
You can list up to three labels. If no labels are given, three strips
902902
will be initialised with names 'one', 'two', and 'three'. If some, but
@@ -952,7 +952,7 @@ class StatusBoard(CompositeOutputDevice):
952952
status.wifi.lights.green.on()
953953
status.wifi.button.when_pressed = status.wifi.lights.toggle
954954
955-
:param str \*labels:
955+
:param str \\*labels:
956956
Specify the names of the labels you wish to designate the strips to.
957957
You can list up to five labels. If no labels are given, five strips
958958
will be initialised with names 'one' to 'five'. If some, but not all

gpiozero/compat.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@
1010

1111
import cmath
1212
import weakref
13-
import collections
1413
import operator
1514
import functools
1615

16+
# Handles pre 3.3 versions of Python withoout collections.abc
17+
try:
18+
from collections.abc import Mapping
19+
except ImportError:
20+
from collections import Mapping
1721

1822
# Back-ported from python 3.5; see
1923
# github.com/PythonCHB/close_pep/blob/master/is_close.py for original
@@ -57,7 +61,7 @@ def median(data):
5761

5862

5963
# Copied from the MIT-licensed https://github.com/slezica/python-frozendict
60-
class frozendict(collections.Mapping):
64+
class frozendict(Mapping):
6165
def __init__(self, *args, **kwargs):
6266
self.__dict = dict(*args, **kwargs)
6367
self.__hash = None

gpiozero/pins/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,9 @@ def clock_phase(self):
522522
----' `---' `---' `---' `---' `---' `---' `-------
523523
: : : : : : :
524524
MISO---. ,---. ,---. ,---. ,---. ,---. ,---.
525-
/ \ / \ / \ / \ / \ / \ / \\
525+
/ \\ / \\ / \\ / \\ / \\ / \\ / \\
526526
-{ Bit X Bit X Bit X Bit X Bit X Bit X Bit }------
527-
\ / \ / \ / \ / \ / \ / \ /
527+
\\ / \\ / \\ / \\ / \\ / \\ / \\ /
528528
`---' `---' `---' `---' `---' `---' `---'
529529
530530
The following diagram indicates when data is read when
@@ -539,9 +539,9 @@ def clock_phase(self):
539539
----' `---' `---' `---' `---' `---' `---' `-------
540540
: : : : : : :
541541
MISO ,---. ,---. ,---. ,---. ,---. ,---. ,---.
542-
/ \ / \ / \ / \ / \ / \ / \\
542+
/ \\ / \\ / \\ / \\ / \\ / \\ / \\
543543
-----{ Bit X Bit X Bit X Bit X Bit X Bit X Bit }--
544-
\ / \ / \ / \ / \ / \ / \ /
544+
\\ / \\ / \\ / \\ / \\ / \\ / \\ /
545545
`---' `---' `---' `---' `---' `---' `---'
546546
"""
547547
return bool(self.clock_mode & 1)

0 commit comments

Comments
 (0)