Skip to content

Commit 97c5915

Browse files
committed
Using same __init__ as the repo
1 parent aeea65e commit 97c5915

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

adafruit_display_text/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ class LabelBase(Group):
160160
161161
Subclasses should implement ``_set_text``, ``_set_font``, and ``_set_line_spacing`` to
162162
have the correct behavior for that type of label.
163+
163164
:param Font font: A font class that has ``get_bounding_box`` and ``get_glyph``.
164165
Must include a capital M for measuring character size.
165166
:param str text: Text to display
@@ -189,8 +190,7 @@ class LabelBase(Group):
189190
tab character
190191
:param str label_direction: string defining the label text orientation. There are 5
191192
configurations possibles ``LTR``-Left-To-Right ``RTL``-Right-To-Left
192-
``TTB``-Top-To-Bottom ``UPR``-Upwards ``DWR``-Downwards``DWR``-Downwards and
193-
``UPD``-Upside-Down only avalaible for bitmap_label. It defaults to ``LTR``"""
193+
``TTB``-Top-To-Bottom ``UPR``-Upwards ``DWR``-Downwards. It defaults to ``LTR``"""
194194

195195
# pylint: disable=unused-argument, too-many-instance-attributes, too-many-locals, too-many-arguments
196196
def __init__(
@@ -235,7 +235,7 @@ def __init__(
235235

236236
self._text = text
237237

238-
if label_direction not in ["LTR", "RTL", "UPR", "DWR", "TTB", "UPD"]:
238+
if label_direction not in ["LTR", "RTL", "UPR", "DWR", "TTB"]:
239239
raise RuntimeError("Please provide a valid text direction")
240240
self._label_direction = label_direction
241241

@@ -410,6 +410,6 @@ def _set_label_direction(self, new_label_direction: str) -> None:
410410
@label_direction.setter
411411
def label_direction(self, new_label_direction: str) -> None:
412412
"""Set the text direction of the label"""
413-
if new_label_direction not in ["LTR", "RTL", "UPR", "DWR", "TTB", "UPD"]:
413+
if new_label_direction not in ["LTR", "RTL", "UPR", "DWR", "TTB"]:
414414
raise RuntimeError("Please provide a valid text direction")
415415
self._set_label_direction(new_label_direction)

docs/examples.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,30 @@ Ensure your device works with this simple test.
66
.. literalinclude:: ../examples/display_text_simpletest.py
77
:caption: examples/display_text_simpletest.py
88
:linenos:
9+
10+
Bitmap_label Simple test
11+
------------------------
12+
13+
Simple test using bitmap_label to display text
14+
15+
.. literalinclude:: ../examples/display_text_bitmap_label_simpletest.py
16+
:caption: examples/display_text_bitmap_label_simpletest.py
17+
:linenos:
18+
19+
Label vs Bitmap_label Comparison
20+
--------------------------------
21+
22+
Example to compare Label and Bitmap_Label characteristics
23+
24+
.. literalinclude:: ../examples/display_text_label_vs_bitmap_label_comparison.py
25+
:caption: examples/display_text_label_vs_bitmap_label_comparison.py
26+
:linenos:
27+
28+
Label vs Bitmap_label Comparison
29+
--------------------------------
30+
31+
Example to compare Label and Bitmap_Label characteristics
32+
33+
.. literalinclude:: ../examples/display_text_label_vs_bitmap_label_comparison.py
34+
:caption: examples/display_text_label_vs_bitmap_label_comparison.py
35+
:linenos:

0 commit comments

Comments
 (0)