From 67e616dad7fe16b708b56bf694942de4700f51da Mon Sep 17 00:00:00 2001 From: Shane Sutro Date: Tue, 9 Feb 2021 10:27:21 -0700 Subject: [PATCH] Adjust readme --- README.md | 12 ++++++------ tests/test_formatting.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ecb1639..baa2c05 100644 --- a/README.md +++ b/README.md @@ -117,10 +117,10 @@ import vestaboard characters = [ [63, 64, 65, 66, 67, 68, 69, 63, 64, 65, 66, 67, 68, 69, 63, 64, 65, 66, 67, 68, 69, 63], - [64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64], - [65, 0, 0, 0, 8, 1, 16, 16, 25, 0, 2, 9 18, 20, 8, 4, 1, 25, 0, 0, 0, 65], - [66, 0, 0, 0, 0, 0, 0, 0, 13, 9, 14, 1, 20, 15, 37, 0, 0, 0, 0, 0, 0, 66], - [67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67], + [64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64], + [65, 0, 0, 0, 8, 1, 16, 16, 25, 0, 2, 9, 18, 20, 8, 4, 1, 25, 0, 0, 0, 65], + [66, 0, 0, 0, 0, 0, 0, 0, 13, 9, 14, 1, 20, 15, 37, 0, 0, 0, 0, 0, 0, 66], + [67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67], [68, 69, 63, 64, 65, 66, 67, 68, 69, 63, 64, 65, 66, 67, 68, 69, 63, 64, 65, 66, 67, 68] ] @@ -137,7 +137,7 @@ The `Formatter` has two public helper options: - `.convert()` - `.convertLine()` -#### Convert +### Convert If converting a string, use the `.convert()` method. By default, `.convert()` will split by letter and return an array of character codes corresponding to the string you passed in: ```python @@ -156,7 +156,7 @@ Formatter.convert('Oh hi!', byWord=True) # Returns [[15, 8], [8, 9, 37]] ``` -#### Convert Line +### Convert Line If you'd like to convert an entire line at once, use the `.convertLine()` method. `.convertLine()` centers text by default. To left justify or right justify, pass `left=True` or `right=True`. ```python diff --git a/tests/test_formatting.py b/tests/test_formatting.py index 4447296..8c8047f 100644 --- a/tests/test_formatting.py +++ b/tests/test_formatting.py @@ -35,7 +35,7 @@ def test_convert_line_with_centering(): def test_convert_line_left_justified(): assert len(Formatter.convertLine('Oh hi!', left=True)) == 22, 'Should return a list with 22 elements' assert Formatter.convertLine('Oh hi!', left=True) == [15, 8, 0, 8, 9, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'Should left justify up to 22 characters' - + def test_convert_line_right_justified(): assert len(Formatter.convertLine('Oh hi!', right=True)) == 22, 'Should return a list with 22 elements' assert Formatter.convertLine('Oh hi!', right=True) == [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 8, 0, 8, 9, 37], 'Should left justify up to 22 characters'