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

Restructure code #176

Closed
dagwieers opened this issue May 3, 2019 · 1 comment · Fixed by #269
Closed

Restructure code #176

dagwieers opened this issue May 3, 2019 · 1 comment · Fixed by #269
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@dagwieers
Copy link
Collaborator

dagwieers commented May 3, 2019

Describe the bug

A few thoughts on code structure:

  • Kodi's included path for code is the main directory, not resources/lib
  • We have issues because we include/import too much code that is unneeded
  • A lot of functionality is locked inside classes, which complicate their use needlessly
  • The current nesting of of classes/methods is too complicated
  • Design should enable unit testing (so XBMC stuff should stay separated)

I would like to propose:

  • Moving all code into a single directory (e.g; ./vrtnu/) with potentially 10 to 15 files
  • Use script.module.routing to improve addon entrance (see Move to using script.module.routing #103)
  • Get rid of actions.py and the unwanted __init__.py files
  • Separate files on function and reusability
  • Import only needed data/classes/methods so it looks much cleaner to what is used
  • Separate independent functions instead of static class methods (so they can be imported)
  • Simplify TitleItem, or replace it with a well-designed dictionary

I am very skeptical to forced object oriented programming, it's nice where it improves readability, but sometimes putting stuff in classes together because you have to overcomplicates the design (and Python does not force you to).

@dagwieers dagwieers added enhancement New feature or request question Further information is requested labels May 3, 2019
@dagwieers dagwieers added this to the v2.0.0 milestone May 3, 2019
@pietje666
Copy link
Collaborator

pietje666 commented May 16, 2019

Maybe some static class methods could be replaced indeed. How do you mock stuff when using procedural programming?

@dagwieers dagwieers modified the milestones: v2.0.0, v1.10.0, Future May 18, 2019
@dagwieers dagwieers modified the milestones: Future, v1.10.0 May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants