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

Python template refactor #99

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

xLinkOut
Copy link

@xLinkOut xLinkOut commented Jan 7, 2021

Python script template crypto_price.py refactor

  • Support for both Python 2 and Python 3
  • More readable default parameters
  • Used round instead of build and eval a format string
  • Substitute is keyword with == operator
  • Code cleanup and minor optimizations

Maybe more tests are needed but it seems to work well!
(I have not found a guideline for pr, so I kept all commits made but I could do a squash into something like chg: python template refactor if you think it's better)

@chrislennon
Copy link
Owner

Hey @xLinkOut - wanted to loop back to you on this, apologies for not doing so already. The changes look great, my only hesitation to merging it so far has been that I would want to do a bunch of manual testing. I was never wise enough to add any automated tests at the start.

Additionally, with the recent attention this is getting (with current prices), I've been thinking to do a grander refactor of the ugly JS side of the tool, and some further thoughts on an issue here. When I find/make time to do so, I will merge in your contributions before taking it in any further direction for sure.

Thank you for adding this, I hope it's been working well for you for the months since you sent this in.

@xLinkOut
Copy link
Author

xLinkOut commented Mar 22, 2021

Hi @chrislennon! Don't apologize, I appreciate this answer. I have been using this modified version of the template for about a month and I have not had any problems, but obviously, the invitation is always to do as many tests as possible, especially when there are no automatic ones. I'm glad you enjoyed it anyway!

I had also tried to redesign the frontend of the web app, despite not being a web developer. I didn't complete it, the JS part is very "fragile" to changes, however, this is what I managed to complete: rewrote the Touch Bar, to make it much cleaner, sharper and responsive; fixed - with the precious help of @dianaberna - the problems with the two color-pickers, which now also show the preview of the colors directly in the Touch Bar; lastly, added a caching system with sessionStorage for the result of the Coin API, to limit the requests at least in the same browser session.

I would be happy if you take a look at it, could be useful for a possible refactor: you can find it in the redesign branch in the fork on my profile.

@chrislennon
Copy link
Owner

Fragile would be an understatement 😅
Gosh there is some horrible stuff in there...
Can see why I haven't reworked it in many years.

I'll take a look at the branch and see what I can do when it comes to rebuilding. Thanks for that!

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.

None yet

2 participants