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

Refactoring old apps to add new best practices #113

Open
6 tasks
CRImier opened this issue Oct 9, 2018 · 2 comments
Open
6 tasks

Refactoring old apps to add new best practices #113

CRImier opened this issue Oct 9, 2018 · 2 comments
Labels
cleanup good first issue New contributors should be able to tackle this help wanted

Comments

@CRImier
Copy link
Member

CRImier commented Oct 9, 2018

Many apps contain old constructs that are no longer needed, but might be picked up as good practices by new contributors (or, in some cases, will prevent the app from working at all - though unlikely because generally backwards compatibility is preserved). So, refactoring those would help.

Old and outdated practices include:

  • Using Printer(ffs(string, o.cols)) instead of PrettyPrinter(string)
  • Using init_app in function-based apps just to set i and o (can be removed entirely in that case)
  • Redefining __init__ in class-based apps just to set self.menu_name (can be removed entirely in that case)
  • Not defining callback in function-based apps as a separate function
  • Defining the main_menu inside init_app and using a global to access it from callback
  • Adding ["Exit", 'exit'] entries to Menu elements (entry can just be removed)

All of these ought to be grepped for, then removed/replaced - afterwards, it's best if you test your changes by actually launching the app and confirming that it behaves the same way as it did previously.

@CRImier CRImier added the good first issue New contributors should be able to tackle this label Nov 22, 2018
@LouisPi
Copy link
Collaborator

LouisPi commented Feb 28, 2019

I should be able to help out with this.

@CRImier
Copy link
Member Author

CRImier commented Feb 28, 2019

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup good first issue New contributors should be able to tackle this help wanted
Projects
None yet
Development

No branches or pull requests

2 participants