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

Improve handling of methods that must be implemented in subclasses. #88

Closed
jwlodek opened this issue Jan 26, 2021 · 1 comment
Closed
Labels
Core Add for issues having to do with core functions Debug Add for issues pertaining to debug options (logging) Good first issue Good for newcomers
Milestone

Comments

@jwlodek
Copy link
Owner

jwlodek commented Jan 26, 2021

Currently, certain parent classes have methods that are required to be overridden by subclasses in order to function, and at the moment the parent class only returns dummy values. Ex the below method from UIElement:

py_cui/py_cui/ui.py

Lines 76 to 80 in d859746

def get_absolute_start_pos(self):
"""Must be implemented by subclass, computes the absolute coords of upper-left corner
"""
return 0, 0

This should be changed to where these required override methods simply raise a NotImplementedError or something similar.

@jwlodek jwlodek added Good first issue Good for newcomers Core Add for issues having to do with core functions Debug Add for issues pertaining to debug options (logging) labels Jan 26, 2021
@jwlodek jwlodek added this to the v0.1.3 milestone Jan 26, 2021
@jwlodek jwlodek closed this as completed Feb 20, 2021
@jwlodek
Copy link
Owner Author

jwlodek commented Mar 1, 2021

This caused a bug with popups, since they were unnecessarily calling super._draw()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Add for issues having to do with core functions Debug Add for issues pertaining to debug options (logging) Good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant