-
Notifications
You must be signed in to change notification settings - Fork 722
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
Launcher: deprecate FUNC Component type #1872
Conversation
worlds/LauncherComponents.py
Outdated
@@ -31,9 +32,8 @@ def __init__(self, display_name: str, script_name: Optional[str] = None, frozen_ | |||
self.cli = cli | |||
self.type = component_type or \ | |||
None if not display_name else \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while you are at it,
- i don't think
bool(display_name)
should ever beFalse
, so we could remove theNone if ...
and change the type hint fortype
to not be optional? if we want hide a button, it'd be better to use a special type or an additional flag rather than havingdisplay_name = ""
worlds/LauncherComponents.py
Outdated
|
||
|
||
class Type(Enum): | ||
TOOL = auto() | ||
FUNC = auto() # not a real component | ||
FUNC = auto() # not a real component, do not use anymore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be better the other way around? i.e. MISC = auto(); MISC = FUNC
? anyway, this way we can't give a DeprecationWarning. My original idea would've been renaming FUNC
-> MISC
, and then adding a new FUNC
which gets checked and replaecd in Components.__init__
to generate a DeprecationWarning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
component_type: Type = None
should be component_type: Optional[Type] = None
and type: Optional[Type]
should be type: Type
now
Plus below
Co-authored-by: black-sliver <[email protected]>
* Launcher: add hidden component type --------- Co-authored-by: black-sliver <[email protected]>
* Launcher: add hidden component type --------- Co-authored-by: black-sliver <[email protected]>
* Launcher: add hidden component type --------- Co-authored-by: black-sliver <[email protected]>
* Launcher: add hidden component type --------- Co-authored-by: black-sliver <[email protected]>
What is this fixing or adding?
removes that any callable is always FUNC, instead of say CLIENT
How was this tested?
running Launcher.py
If this makes graphical changes, please attach screenshots.