Skip to content

Commit 3d79b5a

Browse files
committed
relinted to match cookiecutter
1 parent 7e3ae1d commit 3d79b5a

23 files changed

+537
-836
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
.DS_Store
2+
__pycache__
3+
_build
4+
*.pyc
25
.env
36
build*
47
bundles

.pylintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ spelling-store-unknown-words=no
119119
[MISCELLANEOUS]
120120

121121
# List of note tags to take in consideration, separated by a comma.
122-
notes=FIXME,XXX,TODO
122+
# notes=FIXME,XXX,TODO
123+
notes=FIXME,XXX
123124

124125

125126
[TYPECHECK]

CODE_OF_CONDUCT.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at support@adafruit.com. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 Radomir Dopieralski and Adafruit Industries
3+
Copyright (c) 2017 Radomir Dopieralski and Adafruit Industries
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.rst

+66-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
Display drivers for Adafruit CircuitPython.
2-
=========================================
1+
Introduction
2+
============
3+
4+
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-rgb_display/badge/?version=latest
5+
6+
:target: https://circuitpython.readthedocs.io/projects/rgb_display/en/latest/
7+
8+
:alt: Documentation Status
9+
10+
.. image :: https://img.shields.io/discord/327254708534116352.svg
11+
:target: https://discord.gg/nBQh6qu
12+
:alt: Discord
313
414
Port of display drivers from https://github.com/adafruit/micropython-adafruit-rgb-display
515
to Adafruit CircuitPython for use on Adafruit's SAMD21-based and other CircuitPython
@@ -10,3 +20,57 @@ board too: https://github.com/adafruit/Adafruit_MicroPython_BusDevice
1020

1121
Note that this driver currently won't work on micropython.org firmware, instead
1222
you want the micropython-adafruit-rgb-display driver linked above!
23+
24+
Dependencies
25+
=============
26+
This driver depends on:
27+
28+
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
29+
30+
Please ensure all dependencies are available on the CircuitPython filesystem.
31+
This is easily achieved by downloading
32+
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
33+
34+
Usage Example
35+
=============
36+
37+
TODO
38+
39+
API Reference
40+
=============
41+
42+
.. toctree::
43+
:maxdepth: 2
44+
45+
api
46+
47+
Contributing
48+
============
49+
50+
Contributions are welcome! Please read our `Code of Conduct
51+
<https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/blob/master/CODE_OF_CONDUCT.md>`_
52+
before contributing to help this project stay welcoming.
53+
54+
Building locally
55+
================
56+
57+
To build this library locally you'll need to install the
58+
`circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package.
59+
60+
.. code-block:: shell
61+
62+
python3 -m venv .env
63+
source .env/bin/activate
64+
pip install circuitpython-build-tools
65+
66+
Once installed, make sure you are in the virtual environment:
67+
68+
.. code-block:: shell
69+
70+
source .env/bin/activate
71+
72+
Then run the build:
73+
74+
.. code-block:: shell
75+
76+
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-rgb_display --library_location .

adafruit_rgb_display/hx8353.py

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
"""A simple driver for the HX8353-based displays."""
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2017 Radomir Dopieralski and Adafruit Industries
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
22+
"""
23+
`adafruit_RGB_Display.hx8353`
24+
====================================================
25+
26+
A simple driver for the HX8353-based displays.
27+
28+
* Author(s): Radomir Dopieralski, Michael McWethy
29+
"""
230
from adafruit_rgb_display.rgb import DisplaySPI
331
from micropython import const
432

adafruit_rgb_display/ili9341.py

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
"""A simple driver for the ILI9341/ILI9340-based displays."""
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2017 Radomir Dopieralski and Adafruit Industries
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
22+
"""
23+
`adafruit_RGB_Display.ili9341`
24+
====================================================
25+
26+
A simple driver for the ILI9341/ILI9340-based displays.
27+
28+
* Author(s): Radomir Dopieralski, Michael McWethy
29+
"""
230

331
try:
432
import struct

adafruit_rgb_display/rgb.py

+42-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
1-
""" Base class for all RGB Display devices """
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2017 Radomir Dopieralski and Adafruit Industries
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
22+
"""
23+
`adafruit_RGB_Display.rgb`
24+
====================================================
25+
26+
Base class for all RGB Display devices
27+
28+
* Author(s): Radomir Dopieralski, Michael McWethy
29+
"""
30+
231
import time
332
from micropython import const
433
try:
@@ -17,12 +46,14 @@
1746

1847

1948
def color565(r, g, b):
20-
"""Format color code for device"""
49+
"""Convert red, green and blue values (0-255) into a 16-bit 565 encoding. As
50+
a convenience this is also available in the parent adafruit_rgb_display
51+
package namespace."""
2152
return (r & 0xf8) << 8 | (g & 0xfc) << 3 | b >> 3
2253

2354

2455
class DummyPin:
25-
"""A fake gpio pin for when you want to skip pins."""
56+
"""Can be used in place of a ``Pin()`` when you don't want to skip it."""
2657
def init(self, *args, **kwargs):
2758
"""Dummy Pin init"""
2859
pass
@@ -37,7 +68,10 @@ def high(self):
3768

3869

3970
class Display: #pylint: disable-msg=no-member
40-
"""Base class for all RGB display devices"""
71+
"""Base class for all RGB display devices
72+
:param width: number of pixels wide
73+
:param height: number of pixels high
74+
"""
4175
_PAGE_SET = None
4276
_COLUMN_SET = None
4377
_RAM_WRITE = None
@@ -83,7 +117,7 @@ def _decode_pixel(self, data):
83117
return color565(*struct.unpack(self._DECODE_PIXEL, data))
84118

85119
def pixel(self, x, y, color=None):
86-
"""Read or write a pixel."""
120+
"""Read or write a pixel at a given position."""
87121
if color is None:
88122
return self._decode_pixel(self._block(x, y, x, y))
89123

@@ -93,7 +127,8 @@ def pixel(self, x, y, color=None):
93127

94128
#pylint: disable-msg=too-many-arguments
95129
def fill_rectangle(self, x, y, width, height, color):
96-
"""Draw a filled rectangle."""
130+
"""Draw a rectangle at specified position with specified width and
131+
height, and fill it with the specified color."""
97132
x = min(self.width - 1, max(0, x))
98133
y = min(self.height - 1, max(0, y))
99134
width = min(self.width - x, max(1, width))
@@ -109,7 +144,7 @@ def fill_rectangle(self, x, y, width, height, color):
109144
#pylint: enable-msg=too-many-arguments
110145

111146
def fill(self, color=0):
112-
"""Fill whole screen."""
147+
"""Fill the whole display with the specified color."""
113148
self.fill_rectangle(0, 0, self.width, self.height, color)
114149

115150
def hline(self, x, y, width, color):

adafruit_rgb_display/s6d02a1.py

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
"""A simple driver for the S6D02A1-based displays."""
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2017 Radomir Dopieralski and Adafruit Industries
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
22+
"""
23+
`adafruit_RGB_Display.s6d02a1`
24+
====================================================
25+
26+
A simple driver for the S6D02A1-based displays.
27+
28+
* Author(s): Radomir Dopieralski, Michael McWethy
29+
"""
230

331
from adafruit_rgb_display.rgb import DisplaySPI
432
from micropython import const

0 commit comments

Comments
 (0)