Skip to content

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

Merged
merged 5 commits into from
Dec 16, 2017
Merged

Conversation

mrmcwethy
Copy link
Collaborator

Lint all the libraries! #475

I tested I2C using MetroM0 with CP 2.1

Copy link
Member

@tannewt tannewt left a 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.

self.write_cmd(SET_NORM_INV | (invert & 1))

def write_framebuf(self):
""""derived class must implement this"""
pass
Copy link
Member

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

Copy link
Collaborator Author

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.

@@ -1 +1,2 @@
from adafruit_ssd1306.ssd1306 import *
"""force classes to be loaded"""
from adafruit_ssd1306.ssd1306 import SSD1306_SPI, SSD1306_I2C
Copy link
Member

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.

Copy link
Collaborator Author

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

self.write_cmd(cmd)
self.fill(0)
self.show()

def poweroff(self):
"""poweroff"""
Copy link
Member

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.)

Copy link
Collaborator Author

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
@mrmcwethy
Copy link
Collaborator Author

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.

@mrmcwethy
Copy link
Collaborator Author

Found an error in the SPI class. Resolved and successfully tested.
Copy link
Contributor

@kattni kattni left a 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!

@kattni kattni merged commit e1275e9 into adafruit:master Dec 16, 2017
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 16, 2017
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants