Skip to content

Commit b2eaf2a

Browse files
authored
Merge pull request #15 from adafruit/pylint-update
[Ignore until issue is closed] Ran black, updated to pylint 2.x
2 parents e2fbef0 + 9539dda commit b2eaf2a

8 files changed

+318
-235
lines changed

.github/workflows/build.yml

+1-1
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 --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
4444
- name: Library version
4545
run: git describe --dirty --always --tags
4646
- name: PyLint

adafruit_miniesptool.py

+118-93
Large diffs are not rendered by default.

docs/conf.py

+65-47
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!
@@ -23,29 +24,32 @@
2324
# autodoc_mock_imports = ["digitalio", "busio"]
2425

2526

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

2832
# Add any paths that contain templates here, relative to this directory.
29-
templates_path = ['_templates']
33+
templates_path = ["_templates"]
3034

31-
source_suffix = '.rst'
35+
source_suffix = ".rst"
3236

3337
# The master toctree document.
34-
master_doc = 'index'
38+
master_doc = "index"
3539

3640
# General information about the project.
37-
project = u'Adafruit miniesptool Library'
38-
copyright = u'2018 ladyada'
39-
author = u'ladyada'
41+
project = u"Adafruit miniesptool Library"
42+
copyright = u"2018 ladyada"
43+
author = u"ladyada"
4044

4145
# The version info for the project you're documenting, acts as replacement for
4246
# |version| and |release|, also used in various other places throughout the
4347
# built documents.
4448
#
4549
# The short X.Y version.
46-
version = u'1.0'
50+
version = u"1.0"
4751
# The full version, including alpha/beta/rc tags.
48-
release = u'1.0'
52+
release = u"1.0"
4953

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

6266
# The reST default role (used for this markup: `text`) to use for all
6367
# documents.
@@ -69,7 +73,7 @@
6973
add_function_parentheses = True
7074

7175
# The name of the Pygments (syntax highlighting) style to use.
72-
pygments_style = 'sphinx'
76+
pygments_style = "sphinx"
7377

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

8993
if not on_rtd: # only import and set the theme if we're building docs locally
9094
try:
9195
import sphinx_rtd_theme
92-
html_theme = 'sphinx_rtd_theme'
93-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
96+
97+
html_theme = "sphinx_rtd_theme"
98+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
9499
except:
95-
html_theme = 'default'
96-
html_theme_path = ['.']
100+
html_theme = "default"
101+
html_theme_path = ["."]
97102
else:
98-
html_theme_path = ['.']
103+
html_theme_path = ["."]
99104

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

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

111116
# Output file base name for HTML help builder.
112-
htmlhelp_basename = 'AdafruitMiniesptoolLibrarydoc'
117+
htmlhelp_basename = "AdafruitMiniesptoolLibrarydoc"
113118

114119
# -- Options for LaTeX output ---------------------------------------------
115120

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

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

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

144151
# One entry per manual page. List of tuples
145152
# (source start file, name, description, authors, manual section).
146153
man_pages = [
147-
(master_doc, 'Adafruitminiesptoollibrary', u'Adafruit miniesptool Library Documentation',
148-
[author], 1)
154+
(
155+
master_doc,
156+
"Adafruitminiesptoollibrary",
157+
u"Adafruit miniesptool Library Documentation",
158+
[author],
159+
1,
160+
)
149161
]
150162

151163
# -- Options for Texinfo output -------------------------------------------
@@ -154,7 +166,13 @@
154166
# (source start file, target name, title, author,
155167
# dir menu entry, description, category)
156168
texinfo_documents = [
157-
(master_doc, 'AdafruitminiesptoolLibrary', u'Adafruit miniesptool Library Documentation',
158-
author, 'AdafruitminiesptoolLibrary', 'One line description of project.',
159-
'Miscellaneous'),
169+
(
170+
master_doc,
171+
"AdafruitminiesptoolLibrary",
172+
u"Adafruit miniesptool Library Documentation",
173+
author,
174+
"AdafruitminiesptoolLibrary",
175+
"One line description of project.",
176+
"Miscellaneous",
177+
),
160178
]

examples/miniesptool_esp32argon.py

+53-30
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
import board
33
import busio
44

5-
from digitalio import DigitalInOut, Direction # pylint: disable=unused-import
5+
from digitalio import DigitalInOut, Direction # pylint: disable=unused-import
66
import adafruit_miniesptool
77

88
print("ESP32 mini prog")
99

1010

1111
# With a Metro or Feather M4
12-
#uart = busio.UART(TX, RX, baudrate=115200, timeout=1)
13-
#resetpin = DigitalInOut(board.D5)
14-
#gpio0pin = DigitalInOut(board.D6)
12+
# uart = busio.UART(TX, RX, baudrate=115200, timeout=1)
13+
# resetpin = DigitalInOut(board.D5)
14+
# gpio0pin = DigitalInOut(board.D6)
1515

1616
# With a Particle Argon, we need to also turn off flow control
1717
uart = busio.UART(board.ESP_RX, board.ESP_TX, baudrate=115200, timeout=1)
@@ -21,8 +21,9 @@
2121
esp_cts.direction = Direction.OUTPUT
2222
esp_cts.value = False
2323

24-
esptool = adafruit_miniesptool.miniesptool(uart, gpio0pin, resetpin,
25-
flashsize=4*1024*1024)
24+
esptool = adafruit_miniesptool.miniesptool(
25+
uart, gpio0pin, resetpin, flashsize=4 * 1024 * 1024
26+
)
2627
esptool.debug = False
2728

2829
esptool.sync()
@@ -34,51 +35,73 @@
3435
print("MAC ADDR: ", [hex(i) for i in esptool.mac_addr])
3536

3637
# 0x10000 ota_data_initial.bin
37-
esptool.flash_file("esp32/ota_data_initial.bin", 0x10000,
38-
'84d04c9d6cc8ef35bf825d51a5277699')
38+
esptool.flash_file(
39+
"esp32/ota_data_initial.bin", 0x10000, "84d04c9d6cc8ef35bf825d51a5277699"
40+
)
3941

4042
# 0x1000 bootloader/bootloader.bin
41-
esptool.flash_file("esp32/bootloader/bootloader.bin", 0x1000,
42-
'195dae16eda6ab703a45928182baa863')
43+
esptool.flash_file(
44+
"esp32/bootloader/bootloader.bin", 0x1000, "195dae16eda6ab703a45928182baa863"
45+
)
4346
# 0x20000 at_customize.bin
44-
esptool.flash_file("esp32/at_customize.bin", 0x20000,
45-
'9853055e077ba0c90cd70691b9d8c3d5')
47+
esptool.flash_file(
48+
"esp32/at_customize.bin", 0x20000, "9853055e077ba0c90cd70691b9d8c3d5"
49+
)
4650

4751
# 0x24000 customized_partitions/server_cert.bin
48-
esptool.flash_file("esp32/customized_partitions/server_cert.bin", 0x24000,
49-
'766fa1e87aabb9ab78ff4023f6feb4d3')
52+
esptool.flash_file(
53+
"esp32/customized_partitions/server_cert.bin",
54+
0x24000,
55+
"766fa1e87aabb9ab78ff4023f6feb4d3",
56+
)
5057

5158
# 0x26000 customized_partitions/server_key.bin
52-
esptool.flash_file("esp32/customized_partitions/server_key.bin", 0x26000,
53-
'05da7907776c3d5160f26bf870592459')
59+
esptool.flash_file(
60+
"esp32/customized_partitions/server_key.bin",
61+
0x26000,
62+
"05da7907776c3d5160f26bf870592459",
63+
)
5464

5565
# 0x28000 customized_partitions/server_ca.bin
56-
esptool.flash_file("esp32/customized_partitions/server_ca.bin", 0x28000,
57-
'e0169f36f9cb09c6705343792d353c0a')
66+
esptool.flash_file(
67+
"esp32/customized_partitions/server_ca.bin",
68+
0x28000,
69+
"e0169f36f9cb09c6705343792d353c0a",
70+
)
5871

5972
# 0x2a000 customized_partitions/client_cert.bin
60-
esptool.flash_file("esp32/customized_partitions/client_cert.bin", 0x2a000,
61-
'428ed3bae5d58b721b8254cbeb8004ff')
73+
esptool.flash_file(
74+
"esp32/customized_partitions/client_cert.bin",
75+
0x2A000,
76+
"428ed3bae5d58b721b8254cbeb8004ff",
77+
)
6278

6379
# 0x2c000 customized_partitions/client_key.bin
64-
esptool.flash_file("esp32/customized_partitions/client_key.bin", 0x2c000,
65-
'136f563811930a5d3bf04c946f430ced')
80+
esptool.flash_file(
81+
"esp32/customized_partitions/client_key.bin",
82+
0x2C000,
83+
"136f563811930a5d3bf04c946f430ced",
84+
)
6685

6786
# 0x2e000 customized_partitions/client_ca.bin
68-
esptool.flash_file("esp32/customized_partitions/client_ca.bin", 0x2e000,
69-
'25ab638695819daae67bcd8a4bfc5626')
87+
esptool.flash_file(
88+
"esp32/customized_partitions/client_ca.bin",
89+
0x2E000,
90+
"25ab638695819daae67bcd8a4bfc5626",
91+
)
7092

7193
# 0xf000 phy_init_data.bin
72-
esptool.flash_file("esp32/phy_init_data.bin", 0xf000,
73-
'bc9854aa3687ca73e25d213d20113b23')
94+
esptool.flash_file(
95+
"esp32/phy_init_data.bin", 0xF000, "bc9854aa3687ca73e25d213d20113b23"
96+
)
7497

7598
# 0x100000 esp-at.bin
76-
esptool.flash_file("esp32/esp-at.bin", 0x100000,
77-
'ae256e4ab546354cd8dfa241e1056996')
99+
esptool.flash_file("esp32/esp-at.bin", 0x100000, "ae256e4ab546354cd8dfa241e1056996")
78100

79101
# 0x8000 partitions_at.bin
80-
esptool.flash_file("esp32/partitions_at.bin", 0x8000,
81-
'd3d1508993d61aedf17280140fc22a6b')
102+
esptool.flash_file(
103+
"esp32/partitions_at.bin", 0x8000, "d3d1508993d61aedf17280140fc22a6b"
104+
)
82105

83106
esptool.reset()
84107
time.sleep(0.5)

0 commit comments

Comments
 (0)