-
Notifications
You must be signed in to change notification settings - Fork 70
Added pylint to project and update code #3
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix! I added a couple more things to change.
adafruit_ssd1306/ssd1306.py
Outdated
self.write_cmd(SET_NORM_INV | (invert & 1)) | ||
|
||
def write_framebuf(self): | ||
""""derived class must implement this""" | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise NotImplementedError
in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added raise NotImplemented to all abstract method.
adafruit_ssd1306/__init__.py
Outdated
@@ -1 +1,2 @@ | |||
from adafruit_ssd1306.ssd1306 import * | |||
"""force classes to be loaded""" | |||
from adafruit_ssd1306.ssd1306 import SSD1306_SPI, SSD1306_I2C |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a weird pattern done in some of the drivers. Instead, rename ssd1306.py
to adafruit_ssd1306.py
in the top level directory.
Try renaming the base class to _SSD1306 to make it private to the module. I hadn't thought of doing that before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved and renamed ssd1306.py. changed the name of SSD1306 to _SSD1306
adafruit_ssd1306/ssd1306.py
Outdated
self.write_cmd(cmd) | ||
self.fill(0) | ||
self.show() | ||
|
||
def poweroff(self): | ||
"""poweroff""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be a bit more verbose here and start the comments with a capital letter. (Applies here and elsewhere.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
improved the method doc string and implemented i2c poweron
…Implement i2c poweron. improved method doc strings
I think this is ready now. I tested using Metro M0 CP 2.1 I do not have a SPI device, so the SPI side of things could use some testing. |
Found an error in the SPI class. Resolved and successfully tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested successfully with SPI. Required minor change, already added. It's good to go!
Updating https://github.com/adafruit/Adafruit_CircuitPython_CharLCD to 2.2 from 2.1.1: > Merge branch 'mrmcwethy-lint' > Add support for I2C/SPI backpack with MCP23008 and 74LS595. New Character_LCD_I2C and Character_LCD_SPI classes. Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 1.0.0 from 0.9.1: > Added double_tap to express class (adafruit/Adafruit_CircuitPython_CircuitPlayground#23) > Added shake_threshold arg and updated docs Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH to 3.0.0 from 2.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_LIS3DH#17 from tannewt/single_double Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.0.0 from 1.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#3 from mrmcwethy/lint
Lint all the libraries! #475
I tested I2C using MetroM0 with CP 2.1