-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
find_file utility handles absolute path #1023
Conversation
Ready after review. |
""" | ||
matches = [] | ||
if os.path.isabs(filename) and os.path.isfile(filename): | ||
return filename | ||
for root, _, filenames in os.walk(folder): | ||
for filename in fnmatch.filter(filenames, filename): | ||
matches.append(os.path.join(root, filename)) |
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 worth avoid overwriting the filename
argument with the return values of fnmatch.filter
(i.e it might be worth calling it fname
in this loop).
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.
Good catch.
Addressed your comment, ready to merge after tests pass. |
Just to say that I do think being to change the layout using CSS would be useful. Ideally, we could provide alternate CSS stylesheets and an API to switch them between them that is nicer than setting file paths. Anyway, that could be a separate feature request and this PR would help make it possible. As the tests have passed, I'll merge now. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Ensure the
find_file
utility can handle an absolute filename path passed to it. The function ensures that the default widget assets get resolved correctly but the user should be able to override these with an absolute path.Concretely you can now supply custom CSS to the widgets to change the layout a bit. Setting:
can give you something like this: