Skip to content

Commit f9e8b56

Browse files
authored
Merge pull request #8 from adafruit/pylint-update
Ran black, updated to pylint 2.x
2 parents baca8cc + 8df1e1e commit f9e8b56

File tree

4 files changed

+86
-63
lines changed

4 files changed

+86
-63
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
source actions-ci/install.sh
4141
- name: Pip install pylint, black, & Sphinx
4242
run: |
43-
pip install --force-reinstall pylint==1.9.2 black==19.10b0 Sphinx sphinx-rtd-theme
43+
pip install pylint black==19.10b0 Sphinx sphinx-rtd-theme
4444
- name: Library version
4545
run: git describe --dirty --always --tags
4646
- name: PyLint

adafruit_ssd1331.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SSD1331.git"
5050

5151
_INIT_SEQUENCE = (
52-
b"\xAE\x00" # _DISPLAYOFF
52+
b"\xAE\x00" # _DISPLAYOFF
5353
b"\xA0\x01\x72" # _SETREMAP (RGB)
5454
b"\xA1\x01\x00" # _STARTLINE
5555
b"\xA2\x01\x00" # _DISPLAYOFFSET
56-
b"\xA4\x00" # _NORMALDISPLAY
56+
b"\xA4\x00" # _NORMALDISPLAY
5757
b"\xA8\x01\x3F" # _SETMULTIPLEX (1/64 duty)
5858
b"\xAD\x01\x8E" # _SETMASTER
5959
b"\xB0\x01\x0B" # _POWERMODE
@@ -68,13 +68,20 @@
6868
b"\x81\x01\x91" # _CONTRASTA
6969
b"\x82\x01\x50" # _CONTRASTB
7070
b"\x83\x01\x7D" # _CONTRASTC
71-
b"\xAF\x00" # _DISPLAYON
71+
b"\xAF\x00" # _DISPLAYON
7272
)
7373

7474
# pylint: disable=too-few-public-methods
7575
class SSD1331(displayio.Display):
7676
"""SSD1331 driver"""
77+
7778
def __init__(self, bus, **kwargs):
78-
super().__init__(bus, _INIT_SEQUENCE, **kwargs, set_column_command=0x15,
79-
set_row_command=0x75, single_byte_bounds=True,
80-
data_as_commands=True)
79+
super().__init__(
80+
bus,
81+
_INIT_SEQUENCE,
82+
**kwargs,
83+
set_column_command=0x15,
84+
set_row_command=0x75,
85+
single_byte_bounds=True,
86+
data_as_commands=True,
87+
)

docs/conf.py

Lines changed: 65 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
import os
44
import sys
5-
sys.path.insert(0, os.path.abspath('..'))
5+
6+
sys.path.insert(0, os.path.abspath(".."))
67

78
# -- General configuration ------------------------------------------------
89

910
# Add any Sphinx extension module names here, as strings. They can be
1011
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
1112
# ones.
1213
extensions = [
13-
'sphinx.ext.autodoc',
14-
'sphinx.ext.intersphinx',
15-
'sphinx.ext.napoleon',
16-
'sphinx.ext.todo',
14+
"sphinx.ext.autodoc",
15+
"sphinx.ext.intersphinx",
16+
"sphinx.ext.napoleon",
17+
"sphinx.ext.todo",
1718
]
1819

1920
# TODO: Please Read!
@@ -24,29 +25,32 @@
2425
autodoc_mock_imports = ["displayio"]
2526

2627

27-
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
28+
intersphinx_mapping = {
29+
"python": ("https://docs.python.org/3.4", None),
30+
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
31+
}
2832

2933
# Add any paths that contain templates here, relative to this directory.
30-
templates_path = ['_templates']
34+
templates_path = ["_templates"]
3135

32-
source_suffix = '.rst'
36+
source_suffix = ".rst"
3337

3438
# The master toctree document.
35-
master_doc = 'index'
39+
master_doc = "index"
3640

3741
# General information about the project.
38-
project = u'Adafruit SSD1331 Library'
39-
copyright = u'2019 Melissa LeBlanc-Williams'
40-
author = u'Melissa LeBlanc-Williams'
42+
project = "Adafruit SSD1331 Library"
43+
copyright = "2019 Melissa LeBlanc-Williams"
44+
author = "Melissa LeBlanc-Williams"
4145

4246
# The version info for the project you're documenting, acts as replacement for
4347
# |version| and |release|, also used in various other places throughout the
4448
# built documents.
4549
#
4650
# The short X.Y version.
47-
version = u'1.0'
51+
version = "1.0"
4852
# The full version, including alpha/beta/rc tags.
49-
release = u'1.0'
53+
release = "1.0"
5054

5155
# The language for content autogenerated by Sphinx. Refer to documentation
5256
# for a list of supported languages.
@@ -58,7 +62,7 @@
5862
# List of patterns, relative to source directory, that match files and
5963
# directories to ignore when looking for source files.
6064
# This patterns also effect to html_static_path and html_extra_path
61-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
65+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
6266

6367
# The reST default role (used for this markup: `text`) to use for all
6468
# documents.
@@ -70,7 +74,7 @@
7074
add_function_parentheses = True
7175

7276
# The name of the Pygments (syntax highlighting) style to use.
73-
pygments_style = 'sphinx'
77+
pygments_style = "sphinx"
7478

7579
# If true, `todo` and `todoList` produce output, else they produce nothing.
7680
todo_include_todos = False
@@ -85,68 +89,76 @@
8589
# The theme to use for HTML and HTML Help pages. See the documentation for
8690
# a list of builtin themes.
8791
#
88-
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
92+
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
8993

9094
if not on_rtd: # only import and set the theme if we're building docs locally
9195
try:
9296
import sphinx_rtd_theme
93-
html_theme = 'sphinx_rtd_theme'
94-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
97+
98+
html_theme = "sphinx_rtd_theme"
99+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
95100
except:
96-
html_theme = 'default'
97-
html_theme_path = ['.']
101+
html_theme = "default"
102+
html_theme_path = ["."]
98103
else:
99-
html_theme_path = ['.']
104+
html_theme_path = ["."]
100105

101106
# Add any paths that contain custom static files (such as style sheets) here,
102107
# relative to this directory. They are copied after the builtin static files,
103108
# so a file named "default.css" will overwrite the builtin "default.css".
104-
html_static_path = ['_static']
109+
html_static_path = ["_static"]
105110

106111
# The name of an image file (relative to this directory) to use as a favicon of
107112
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
108113
# pixels large.
109114
#
110-
html_favicon = '_static/favicon.ico'
115+
html_favicon = "_static/favicon.ico"
111116

112117
# Output file base name for HTML help builder.
113-
htmlhelp_basename = 'AdafruitSsd1331Librarydoc'
118+
htmlhelp_basename = "AdafruitSsd1331Librarydoc"
114119

115120
# -- Options for LaTeX output ---------------------------------------------
116121

117122
latex_elements = {
118-
# The paper size ('letterpaper' or 'a4paper').
119-
#
120-
# 'papersize': 'letterpaper',
121-
122-
# The font size ('10pt', '11pt' or '12pt').
123-
#
124-
# 'pointsize': '10pt',
125-
126-
# Additional stuff for the LaTeX preamble.
127-
#
128-
# 'preamble': '',
129-
130-
# Latex figure (float) alignment
131-
#
132-
# 'figure_align': 'htbp',
123+
# The paper size ('letterpaper' or 'a4paper').
124+
#
125+
# 'papersize': 'letterpaper',
126+
# The font size ('10pt', '11pt' or '12pt').
127+
#
128+
# 'pointsize': '10pt',
129+
# Additional stuff for the LaTeX preamble.
130+
#
131+
# 'preamble': '',
132+
# Latex figure (float) alignment
133+
#
134+
# 'figure_align': 'htbp',
133135
}
134136

135137
# Grouping the document tree into LaTeX files. List of tuples
136138
# (source start file, target name, title,
137139
# author, documentclass [howto, manual, or own class]).
138140
latex_documents = [
139-
(master_doc, 'AdafruitSSD1331Library.tex', u'AdafruitSSD1331 Library Documentation',
140-
author, 'manual'),
141+
(
142+
master_doc,
143+
"AdafruitSSD1331Library.tex",
144+
"AdafruitSSD1331 Library Documentation",
145+
author,
146+
"manual",
147+
),
141148
]
142149

143150
# -- Options for manual page output ---------------------------------------
144151

145152
# One entry per manual page. List of tuples
146153
# (source start file, name, description, authors, manual section).
147154
man_pages = [
148-
(master_doc, 'AdafruitSSD1331library', u'Adafruit SSD1331 Library Documentation',
149-
[author], 1)
155+
(
156+
master_doc,
157+
"AdafruitSSD1331library",
158+
"Adafruit SSD1331 Library Documentation",
159+
[author],
160+
1,
161+
)
150162
]
151163

152164
# -- Options for Texinfo output -------------------------------------------
@@ -155,7 +167,13 @@
155167
# (source start file, target name, title, author,
156168
# dir menu entry, description, category)
157169
texinfo_documents = [
158-
(master_doc, 'AdafruitSSD1331Library', u'Adafruit SSD1331 Library Documentation',
159-
author, 'AdafruitSSD1331Library', 'One line description of project.',
160-
'Miscellaneous'),
170+
(
171+
master_doc,
172+
"AdafruitSSD1331Library",
173+
"Adafruit SSD1331 Library Documentation",
174+
author,
175+
"AdafruitSSD1331Library",
176+
"One line description of project.",
177+
"Miscellaneous",
178+
),
161179
]

examples/ssd1331_simpletest.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
tft_cs = board.D5
1717
tft_dc = board.D6
1818

19-
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
19+
display_bus = displayio.FourWire(
20+
spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
21+
)
2022

2123
display = SSD1331(display_bus, width=96, height=64)
2224

@@ -26,20 +28,16 @@
2628

2729
color_bitmap = displayio.Bitmap(96, 64, 1)
2830
color_palette = displayio.Palette(1)
29-
color_palette[0] = 0x00FF00 # Bright Green
31+
color_palette[0] = 0x00FF00 # Bright Green
3032

31-
bg_sprite = displayio.TileGrid(color_bitmap,
32-
pixel_shader=color_palette,
33-
x=0, y=0)
33+
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
3434
splash.append(bg_sprite)
3535

3636
# Draw a smaller inner rectangle
3737
inner_bitmap = displayio.Bitmap(86, 54, 1)
3838
inner_palette = displayio.Palette(1)
39-
inner_palette[0] = 0xAA0088 # Purple
40-
inner_sprite = displayio.TileGrid(inner_bitmap,
41-
pixel_shader=inner_palette,
42-
x=5, y=5)
39+
inner_palette[0] = 0xAA0088 # Purple
40+
inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=5, y=5)
4341
splash.append(inner_sprite)
4442

4543
# Draw a label

0 commit comments

Comments
 (0)