-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Adding example for get_resource for taipy extension #2297
Conversation
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
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 don't see the implementation for the get_resources()
method that is at the heart of this PR...
With what I propose, this should point to the assets
directory.
|
||
|
||
class ExampleLibrary(ElementLibrary): | ||
def __init__(self) -> None: | ||
# Initialize the set of visual elements for this extension library | ||
|
||
logo_path = self.get_resource("resources/taipy_logo.png") |
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.
The best I think would be to change the path not to confuse users about what we're looking for and where.
I also rename the image file itself for simplicity.
logo_path = self.get_resource("resources/taipy_logo.png") | |
logo_path = self.get_resource("icons/logo.png") |
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.
Rename to doc/gui/extension/example_library/assets/icons/logo.png
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.
Looks good to me!
What type of PR is this? (check all applicable)
Description
Adding an example for get_resources for taipy extension
Checklist
We encourage you to keep the code coverage percentage at 80% and above.