-
Notifications
You must be signed in to change notification settings - Fork 70
Use saner names for the pin attributes #4
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
I think that `d_or_c` is as confusing as `dc`, possibly more, when the parameter is still called `dc`. If we wanted to be hyper-correct and stick to Python's style, we should call it `data_or_command`, but then for consistency we would also need things like `master_in_slave_out` and so on, and I think this is an overkill. Since the pin is usually labelled `dc` on the physical modules anyways, I think it's perfectly fine to use that — it's also consistent with the usage in Arduino and other drivers. I added `_pin` so make the linter shut up and also to clarify that this is indeed a pin. I also changed the name of `res` to `reset_pin` to be consistent (the label for that pin on the modules is sometimes `rs` and sometimes `rst` so keeping the shortcut is not helpful).
Woud you be willing to add a docstring to |
Added that. |
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.
travis build failed, fixed issue. Looks great! Thank you for doing this!
Tested successfully with display. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 1.0.1 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#25 from adafruit/tannewt-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_MPR121 to 1.0.1 from 0.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_MPR121#4 from adafruit/travis-yaml-typo > Merge pull request adafruit/Adafruit_CircuitPython_MPR121#3 from tannewt/lint Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8523 to 1.0.0 from 0.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_PCF8523#4 from tannewt/lint Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.1.0 from 2.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#4 from deshipu/patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2561 to 3.0.0 from 2.0: > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#9 from kattni/driver-lint-update > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#7 from tannewt/lint Updating https://github.com/adafruit/Adafruit_CircuitPython_HID to 2.0.0 from 1.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_HID#8 from mrmcwethy/lint Updating https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO to 1.0.0 from 0.3.1: > add pylint to project and updated code Updating https://github.com/adafruit/Adafruit_CircuitPython_Waveform to 1.0.0 from 0.1.1: > add pylint to project (adafruit/Adafruit_CircuitPython_Waveform#1)
I think that
d_or_c
is as confusing asdc
, possibly more, when the parameter is still calleddc
. If we wanted to be hyper-correct and stick to Python's style, we should call itdata_or_command
, but then for consistency we would also need things likemaster_in_slave_out
and so on, and I think this is an overkill. Since the pin is usually labelleddc
on the physical modules anyways, I think it's perfectly fine to use that — it's also consistent with the usage in Arduino and other drivers. I added_pin
to make the linter be quiet and also to clarify that this is indeed a pin. I also changed the name ofres
toreset_pin
to be consistent (the label for that pin on the modules is sometimesrs
and sometimesrst
so keeping the shortcut is not helpful).