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

let FileInput widget set filename #956

Merged
merged 2 commits into from
Jan 18, 2020

Conversation

ltalirz
Copy link
Contributor

@ltalirz ltalirz commented Jan 17, 2020

fixes #955

The value of the filename property of the FileInput always remained
None (also after uploading a file).

I could add a test here, if you let me know what the filename I should be testing for here.

The value of the `filename` property of the `FileInput` always remained
`None` (also after uploading a file).
@codecov
Copy link

codecov bot commented Jan 18, 2020

Codecov Report

Merging #956 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #956      +/-   ##
=========================================
+ Coverage   85.05%   85.1%   +0.05%     
=========================================
  Files          96      96              
  Lines       10637   10685      +48     
=========================================
+ Hits         9047    9094      +47     
- Misses       1590    1591       +1
Impacted Files Coverage Δ
panel/tests/widgets/test_input.py 100% <100%> (ø) ⬆️
panel/widgets/input.py 97.92% <100%> (ø) ⬆️
panel/tests/pane/test_markup.py 99.2% <0%> (-0.8%) ⬇️
panel/tests/test_io.py 100% <0%> (ø) ⬆️
panel/models/markup.py 100% <0%> (ø) ⬆️
panel/pane/markup.py 95.95% <0%> (+0.46%) ⬆️
panel/pane/base.py 87.2% <0%> (+0.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80d8f5e...883f87e. Read the comment docs.

@philippjfr
Copy link
Member

This is great thank you!

I could add a test here, if you let me know what the filename I should be testing for here.

Just do something like this:

file_input._comm_change({'mime_type': 'text/plain', 'value': 'U29tZSB0ZXh0Cg==', 'filename': 'testfile'})

assert file_input.filename == 'testfile'

@ltalirz
Copy link
Contributor Author

ltalirz commented Jan 18, 2020

Done!

@philippjfr
Copy link
Member

Looks like a syntax error snuck in there.

@ltalirz ltalirz force-pushed the issue_955_fileinput_filename branch from 17b2236 to 883f87e Compare January 18, 2020 00:31
@philippjfr philippjfr merged commit 2a53244 into holoviz:master Jan 18, 2020
@philippjfr
Copy link
Member

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fileinput widget always returns None for name of uploaded file
2 participants