Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ignore until issue is closed] Ran black, updated to pylint 2.x #15

Merged
merged 2 commits into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
source actions-ci/install.sh
- name: Pip install pylint, black, & Sphinx
run: |
pip install --force-reinstall pylint==1.9.2 black==19.10b0 Sphinx sphinx-rtd-theme
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
- name: Library version
run: git describe --dirty --always --tags
- name: PyLint
Expand Down
211 changes: 118 additions & 93 deletions adafruit_miniesptool.py

Large diffs are not rendered by default.

112 changes: 65 additions & 47 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

import os
import sys
sys.path.insert(0, os.path.abspath('..'))

sys.path.insert(0, os.path.abspath(".."))

# -- General configuration ------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
]

# TODO: Please Read!
Expand All @@ -23,29 +24,32 @@
# autodoc_mock_imports = ["digitalio", "busio"]


intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
intersphinx_mapping = {
"python": ("https://docs.python.org/3.4", None),
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'Adafruit miniesptool Library'
copyright = u'2018 ladyada'
author = u'ladyada'
project = u"Adafruit miniesptool Library"
copyright = u"2018 ladyada"
author = u"ladyada"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'1.0'
version = u"1.0"
# The full version, including alpha/beta/rc tags.
release = u'1.0'
release = u"1.0"

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

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

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

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

if not on_rtd: # only import and set the theme if we're building docs locally
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
except:
html_theme = 'default'
html_theme_path = ['.']
html_theme = "default"
html_theme_path = ["."]
else:
html_theme_path = ['.']
html_theme_path = ["."]

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

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

# Output file base name for HTML help builder.
htmlhelp_basename = 'AdafruitMiniesptoolLibrarydoc'
htmlhelp_basename = "AdafruitMiniesptoolLibrarydoc"

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'AdafruitminiesptoolLibrary.tex', u'Adafruitminiesptool Library Documentation',
author, 'manual'),
(
master_doc,
"AdafruitminiesptoolLibrary.tex",
u"Adafruitminiesptool Library Documentation",
author,
"manual",
),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'Adafruitminiesptoollibrary', u'Adafruit miniesptool Library Documentation',
[author], 1)
(
master_doc,
"Adafruitminiesptoollibrary",
u"Adafruit miniesptool Library Documentation",
[author],
1,
)
]

# -- Options for Texinfo output -------------------------------------------
Expand All @@ -154,7 +166,13 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'AdafruitminiesptoolLibrary', u'Adafruit miniesptool Library Documentation',
author, 'AdafruitminiesptoolLibrary', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"AdafruitminiesptoolLibrary",
u"Adafruit miniesptool Library Documentation",
author,
"AdafruitminiesptoolLibrary",
"One line description of project.",
"Miscellaneous",
),
]
83 changes: 53 additions & 30 deletions examples/miniesptool_esp32argon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
import board
import busio

from digitalio import DigitalInOut, Direction # pylint: disable=unused-import
from digitalio import DigitalInOut, Direction # pylint: disable=unused-import
import adafruit_miniesptool

print("ESP32 mini prog")


# With a Metro or Feather M4
#uart = busio.UART(TX, RX, baudrate=115200, timeout=1)
#resetpin = DigitalInOut(board.D5)
#gpio0pin = DigitalInOut(board.D6)
# uart = busio.UART(TX, RX, baudrate=115200, timeout=1)
# resetpin = DigitalInOut(board.D5)
# gpio0pin = DigitalInOut(board.D6)

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

esptool = adafruit_miniesptool.miniesptool(uart, gpio0pin, resetpin,
flashsize=4*1024*1024)
esptool = adafruit_miniesptool.miniesptool(
uart, gpio0pin, resetpin, flashsize=4 * 1024 * 1024
)
esptool.debug = False

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

# 0x10000 ota_data_initial.bin
esptool.flash_file("esp32/ota_data_initial.bin", 0x10000,
'84d04c9d6cc8ef35bf825d51a5277699')
esptool.flash_file(
"esp32/ota_data_initial.bin", 0x10000, "84d04c9d6cc8ef35bf825d51a5277699"
)

# 0x1000 bootloader/bootloader.bin
esptool.flash_file("esp32/bootloader/bootloader.bin", 0x1000,
'195dae16eda6ab703a45928182baa863')
esptool.flash_file(
"esp32/bootloader/bootloader.bin", 0x1000, "195dae16eda6ab703a45928182baa863"
)
# 0x20000 at_customize.bin
esptool.flash_file("esp32/at_customize.bin", 0x20000,
'9853055e077ba0c90cd70691b9d8c3d5')
esptool.flash_file(
"esp32/at_customize.bin", 0x20000, "9853055e077ba0c90cd70691b9d8c3d5"
)

# 0x24000 customized_partitions/server_cert.bin
esptool.flash_file("esp32/customized_partitions/server_cert.bin", 0x24000,
'766fa1e87aabb9ab78ff4023f6feb4d3')
esptool.flash_file(
"esp32/customized_partitions/server_cert.bin",
0x24000,
"766fa1e87aabb9ab78ff4023f6feb4d3",
)

# 0x26000 customized_partitions/server_key.bin
esptool.flash_file("esp32/customized_partitions/server_key.bin", 0x26000,
'05da7907776c3d5160f26bf870592459')
esptool.flash_file(
"esp32/customized_partitions/server_key.bin",
0x26000,
"05da7907776c3d5160f26bf870592459",
)

# 0x28000 customized_partitions/server_ca.bin
esptool.flash_file("esp32/customized_partitions/server_ca.bin", 0x28000,
'e0169f36f9cb09c6705343792d353c0a')
esptool.flash_file(
"esp32/customized_partitions/server_ca.bin",
0x28000,
"e0169f36f9cb09c6705343792d353c0a",
)

# 0x2a000 customized_partitions/client_cert.bin
esptool.flash_file("esp32/customized_partitions/client_cert.bin", 0x2a000,
'428ed3bae5d58b721b8254cbeb8004ff')
esptool.flash_file(
"esp32/customized_partitions/client_cert.bin",
0x2A000,
"428ed3bae5d58b721b8254cbeb8004ff",
)

# 0x2c000 customized_partitions/client_key.bin
esptool.flash_file("esp32/customized_partitions/client_key.bin", 0x2c000,
'136f563811930a5d3bf04c946f430ced')
esptool.flash_file(
"esp32/customized_partitions/client_key.bin",
0x2C000,
"136f563811930a5d3bf04c946f430ced",
)

# 0x2e000 customized_partitions/client_ca.bin
esptool.flash_file("esp32/customized_partitions/client_ca.bin", 0x2e000,
'25ab638695819daae67bcd8a4bfc5626')
esptool.flash_file(
"esp32/customized_partitions/client_ca.bin",
0x2E000,
"25ab638695819daae67bcd8a4bfc5626",
)

# 0xf000 phy_init_data.bin
esptool.flash_file("esp32/phy_init_data.bin", 0xf000,
'bc9854aa3687ca73e25d213d20113b23')
esptool.flash_file(
"esp32/phy_init_data.bin", 0xF000, "bc9854aa3687ca73e25d213d20113b23"
)

# 0x100000 esp-at.bin
esptool.flash_file("esp32/esp-at.bin", 0x100000,
'ae256e4ab546354cd8dfa241e1056996')
esptool.flash_file("esp32/esp-at.bin", 0x100000, "ae256e4ab546354cd8dfa241e1056996")

# 0x8000 partitions_at.bin
esptool.flash_file("esp32/partitions_at.bin", 0x8000,
'd3d1508993d61aedf17280140fc22a6b')
esptool.flash_file(
"esp32/partitions_at.bin", 0x8000, "d3d1508993d61aedf17280140fc22a6b"
)

esptool.reset()
time.sleep(0.5)
Loading