-
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
Allow custom Javascript files #2359
Conversation
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... 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.
Looks good to me
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.
a few comments
Page specific script will be handled in another PR ?
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.
My guts tell me glob() is usually not so safe, portability-wise. But I assume tests ensure this works everywhere...
taipy/gui/gui.py
Outdated
@@ -411,6 +419,32 @@ def __init__( | |||
for library in libraries: | |||
Gui.add_library(library) | |||
|
|||
def __load_scripts(self, script_paths: t.Optional[t.Union[str, Path, t.List[t.Union[str, Path]]]]): | |||
def load_script(path: t.Union[str, Path]): |
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.
what's the point of inner defined function ?
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.
it was based on Fabien suggestion
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.
then ...
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.
Inner functions don't clobber the namespace. I like that, as long as these functions are not evaluated over and over... which is the case here.
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 code of the inner function is called only once ... what's the point ?
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.
Oh... that's different.
A function called only once is kind of useless indeed.
Then a comment does the trick, expanding the function where it belongs.
700cc9a
to
3bc41b8
Compare
…es' into 1808-allow-custom-javascript-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.
👌
What type of PR is this? (check all applicable)
Description
Allowing custom javascript file from GUI
Related Tickets & Documents
#1808
Checklist
We encourage you to keep the code coverage percentage at 80% and above.