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

find_file utility handles absolute path #1023

Merged
merged 1 commit into from Jan 17, 2017

Conversation

Projects
None yet
2 participants
@philippjfr
Copy link
Contributor

philippjfr commented Dec 18, 2016

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:

hv.plotting.widgets.SelectionWidget.css = '/Users/philippjfr/Downloads/test.css'

can give you something like this:

screen shot 2016-12-18 at 7 41 20 pm

@philippjfr

This comment has been minimized.

Copy link
Contributor Author

philippjfr commented Dec 18, 2016

Ready after review.

@philippjfr philippjfr requested a review from jlstevens Dec 18, 2016

"""
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))

This comment has been minimized.

@jlstevens

jlstevens Dec 18, 2016

Contributor

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).

This comment has been minimized.

@philippjfr

philippjfr Jan 17, 2017

Author Contributor

Good catch.

@philippjfr philippjfr force-pushed the find_file branch from f2d8ccf to 468d81a Jan 17, 2017

@philippjfr

This comment has been minimized.

Copy link
Contributor Author

philippjfr commented Jan 17, 2017

Addressed your comment, ready to merge after tests pass.

@philippjfr philippjfr force-pushed the find_file branch from 468d81a to e64a9b6 Jan 17, 2017

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Jan 17, 2017

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.

@jlstevens jlstevens merged commit 8e67b33 into master Jan 17, 2017

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.006%) to 77.254%
Details
s3-reference-data-cache Test data is cached.
Details

@philippjfr philippjfr deleted the find_file branch Jan 27, 2017

@philippjfr philippjfr referenced this pull request Mar 29, 2017

Closed

%%opts has no effect #1230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.