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

Clean up inheritance of targets #1690

Merged
merged 1 commit into from
Sep 10, 2023
Merged

Conversation

Julian-O
Copy link
Contributor

  1. Target class contained Android-only attribute "artifact_format". Moved that code into TargetAndroid class.

  2. TargetIos had a check_build_prepared() method that was ineffective.

prepare_for_build() sets target._build_prepared to True. Then check_build_prepared() inexplicably set it to False. Then build() checks for its existence, rather than its value [this is code smell that is on my list for later], so the fact that it had been changed made no difference.

So, I removed the method, and the call to it.

  1. TargetOSX had lots of methods that were identical to its base class implementations (three more, once the above steps were done). They don't need to be specified; they are inherited. I removed them. osx.py is now 20% smaller.

1) Target class contained Android-only attribute "artifact_format". Moved that code into TargetAndroid class.

2) TargetIos had a `check_build_prepared()` method that was ineffective.

`prepare_for_build()` sets `target._build_prepared` to True.
Then `check_build_prepared()` inexplicably set it to False.
Then `build()` checks for its existence, rather than its value [this is code smell that is on my list for later], so the fact that it had been changed made no difference.

So, I removed the method, and the call to it.

2) TargetOSX had lots of methods that were identical to its base class implementations (three more, once the above steps were done). They don't need to be specified; they are inherited. I removed them. `osx.py` is now 20% smaller.
Copy link
Member

@misl6 misl6 left a comment

Choose a reason for hiding this comment

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

Nice!

LGTM. Thank you!

@misl6 misl6 merged commit f633b15 into kivy:master Sep 10, 2023
13 of 15 checks passed
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