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

update to show_business_card in pybadger_base.py #49

Merged
merged 7 commits into from
Aug 13, 2021

Conversation

liltux
Copy link
Contributor

@liltux liltux commented Aug 13, 2021

Added a few lines to breakout option to set background color and font color when setting text lines for show_business_card.
This is my first time playing around with adafruit_pybadger library, and I found the default text color, 0xFFFFFF, and transparent background, did not work with my white image.
After looking through, the ability was there, just not made available through the pybadger show_business_card.
I am not a pro - coder, mere tinkerer, so there may be a better way to accomplish this, but just thought I would throw it out there and see what you all thought.
I can now do this:
pybadger.show_business_card( background_color=0xFFFFFF, font_color=0x0000FF, ...
which makes my font more readable on a white image pallette. Thanks!

Updated code to allow for background_color to be set for box around text in business card or custom.  None = Transparent, Color number Hex = background box color.
Update to use font-color with background color in custom business card.
@FoamyGuy
Copy link
Contributor

Hello @liltux. Thanks for contributing this enhancement. We use Black and PyLint as well as a few other tools to ensure the code formatting across all of the many different libraries is consistent. The actions checks have not passed on this PR due to the formatting be off a little bit.

You can learn about how to set it up and run it in this guide, here is the page on Black specifically: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/black there is a page for PyLint as well which might become an issue once the formatting is resolved (but maybe not also).

To make it easier all of the checks are combined into 1 by a tool called pre-commit. https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code installing and using that is the easiest way to get all of the checks to run locally. Then you can make any changes needed and make a new commit / push which should pass in the github actions if it's also passing locally for you.

Please give this a try and make a new commit / push. If you run into trouble you can reply back here or on the discord: https://adafru.it/discord and myself or other folks can help you work through any issues that you run into.

@liltux
Copy link
Contributor Author

liltux commented Aug 13, 2021

@FoamyGuy Thanks! I now have a todo list. Time to tinker some more.

black check should succeed now.
Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great work. Thanks again for adding this new feature! And thank you as well for working through the formatting issues to get it passing the checks.

I tested this out and it is working as expected. I have one minor request with regards to the name of one of the arguments, but beyond that this change looks good to me.

adafruit_pybadger/pybadger_base.py Outdated Show resolved Hide resolved
@FoamyGuy
Copy link
Contributor

@liltux okay I was able to remove that and now I know the correct command to run no so I can share that:

git rm -r --cached .vscode/

this command will remove the .vscode/ and all of the files inside of it. The -r is what will make it recursive and remove everything inside of the directory too. The --cached will cause it to remove the specified files from the git repo but it will still keep the actual files themselves in your local filesystem that way your IDE can continue to make use of them without them being in the repo.

I added .vscode to the gitignore as well so that it won't get automatically added anymore in the future.

I pushed those changes to your branch so that they will show up automatically here in the PR without you needing to do anything else. If you do end up needing or wanting to make more changes in this branch you'll likely have to either pull these changes, or else re-clone a new copy of the branch.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Tested the latest version successfully on PyGamer 7.0.0 alpha5.

It looks like this might your first contribution to a CircuitPython library, if that is the case congratulations 🎉

@FoamyGuy FoamyGuy merged commit 994172e into adafruit:main Aug 13, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 14, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9600 to 1.2.0 from 1.1.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_MCP9600#16 from kattni/mcp9601
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyBadger to 3.5.1 from 3.5.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyBadger#49 from liltux/tinkerd
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.

2 participants