Skip to content

Commit 78cf68c

Browse files
authored
Merge pull request #8 from adafruit/pylint-update
Ran black, updated to pylint 2.x
2 parents aa02354 + 03c79fc commit 78cf68c

File tree

4 files changed

+89
-74
lines changed

4 files changed

+89
-74
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_hx8357.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,29 @@
5151
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_HX8357.git"
5252

5353
_INIT_SEQUENCE = (
54-
b"\x01\x80\x64" # _SWRESET and Delay 100ms
55-
b"\xB9\x83\xFF\x83\x57\xFF" # _SETC and delay 500ms
56-
b"\xB3\x04\x80\x00\x06\x06" # _SETRGB 0x80 enables SDO pin (0x00 disables)
57-
b"\xB6\x01\x25" # _SETCOM -1.52V
58-
b"\xB0\x01\x68" # _SETOSC Normal mode 70Hz, Idle mode 55 Hz
59-
b"\xCC\x01\x05" # _SETPANEL BGR, Gate direction swapped
60-
b"\xB1\x06\x00\x15\x1C\x1C\x83\xAA" # _SETPWR1 Not deep standby BT VSPR VSNR AP
61-
b"\xC0\x06\x50\x50\x01\x3C\x1E\x08" # _SETSTBA OPON normal OPON idle STBA GEN
62-
b"\xB4\x07\x02\x40\x00\x2A\x2A\x0D\x78" # _SETCYC NW 0x02 RTN DIV DUM DUM GDON GDOFF
63-
b"\xE0\x22\x02\x0A\x11\x1d\x23\x35\x41\x4b\x4b\x42\x3A\x27\x1B\x08\x09\x03\x02\x0A" \
64-
b"\x11\x1d\x23\x35\x41\x4b\x4b\x42\x3A\x27\x1B\x08\x09\x03\x00\x01" # _SETGAMMA
65-
b"\x3A\x01\x55" # _COLMOD 16 bit
66-
b"\x36\x01\xC0" # _MADCTL
67-
b"\x35\x01\x00" # _TEON TW off
68-
b"\x44\x02\x00\x02" # _TEARLINE
69-
b"\x11\x80\x96" # _SLPOUT and delay 150 ms
54+
b"\x01\x80\x64" # _SWRESET and Delay 100ms
55+
b"\xB9\x83\xFF\x83\x57\xFF" # _SETC and delay 500ms
56+
b"\xB3\x04\x80\x00\x06\x06" # _SETRGB 0x80 enables SDO pin (0x00 disables)
57+
b"\xB6\x01\x25" # _SETCOM -1.52V
58+
b"\xB0\x01\x68" # _SETOSC Normal mode 70Hz, Idle mode 55 Hz
59+
b"\xCC\x01\x05" # _SETPANEL BGR, Gate direction swapped
60+
b"\xB1\x06\x00\x15\x1C\x1C\x83\xAA" # _SETPWR1 Not deep standby BT VSPR VSNR AP
61+
b"\xC0\x06\x50\x50\x01\x3C\x1E\x08" # _SETSTBA OPON normal OPON idle STBA GEN
62+
b"\xB4\x07\x02\x40\x00\x2A\x2A\x0D\x78" # _SETCYC NW 0x02 RTN DIV DUM DUM GDON GDOFF
63+
b"\xE0\x22\x02\x0A\x11\x1d\x23\x35\x41\x4b\x4b\x42\x3A\x27\x1B\x08\x09\x03\x02\x0A"
64+
b"\x11\x1d\x23\x35\x41\x4b\x4b\x42\x3A\x27\x1B\x08\x09\x03\x00\x01" # _SETGAMMA
65+
b"\x3A\x01\x55" # _COLMOD 16 bit
66+
b"\x36\x01\xC0" # _MADCTL
67+
b"\x35\x01\x00" # _TEON TW off
68+
b"\x44\x02\x00\x02" # _TEARLINE
69+
b"\x11\x80\x96" # _SLPOUT and delay 150 ms
7070
b"\x36\x01\xA0"
71-
b"\x29\x80\x32" # _DISPON and delay 50 ms
71+
b"\x29\x80\x32" # _DISPON and delay 50 ms
7272
)
7373

7474
# pylint: disable=too-few-public-methods
7575
class HX8357(displayio.Display):
7676
"""HX8357D driver"""
77+
7778
def __init__(self, bus, **kwargs):
7879
super().__init__(bus, _INIT_SEQUENCE, **kwargs)

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 HX8357 Library'
39-
copyright = u'2019 Melissa LeBlanc-Williams'
40-
author = u'Melissa LeBlanc-Williams'
42+
project = "Adafruit HX8357 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 = 'AdafruitHx8357Librarydoc'
118+
htmlhelp_basename = "AdafruitHx8357Librarydoc"
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, 'AdafruitHX8357Library.tex', u'AdafruitHX8357 Library Documentation',
140-
author, 'manual'),
141+
(
142+
master_doc,
143+
"AdafruitHX8357Library.tex",
144+
"AdafruitHX8357 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, 'AdafruitHX8357library', u'Adafruit HX8357 Library Documentation',
149-
[author], 1)
155+
(
156+
master_doc,
157+
"AdafruitHX8357library",
158+
"Adafruit HX8357 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, 'AdafruitHX8357Library', u'Adafruit HX8357 Library Documentation',
159-
author, 'AdafruitHX8357Library', 'One line description of project.',
160-
'Miscellaneous'),
170+
(
171+
master_doc,
172+
"AdafruitHX8357Library",
173+
"Adafruit HX8357 Library Documentation",
174+
author,
175+
"AdafruitHX8357Library",
176+
"One line description of project.",
177+
"Miscellaneous",
178+
),
161179
]

examples/hx8357_simpletest.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,23 @@
2626

2727
color_bitmap = displayio.Bitmap(480, 320, 1)
2828
color_palette = displayio.Palette(1)
29-
color_palette[0] = 0x00FF00 # Bright Green
29+
color_palette[0] = 0x00FF00 # Bright Green
3030

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

3634
# Draw a smaller inner rectangle
3735
inner_bitmap = displayio.Bitmap(440, 280, 1)
3836
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=20, y=20)
37+
inner_palette[0] = 0xAA0088 # Purple
38+
inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20)
4339
splash.append(inner_sprite)
4440

4541
# Draw a label
4642
text_group = displayio.Group(max_size=10, scale=3, x=137, y=160)
4743
text = "Hello World!"
4844
text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00)
49-
text_group.append(text_area) # Subgroup for text scaling
45+
text_group.append(text_area) # Subgroup for text scaling
5046
splash.append(text_group)
5147

5248
while True:

0 commit comments

Comments
 (0)