Skip to content

save_file now cleans the filename, expands user and returns the full file path - #84

Merged
nabobalis merged 4 commits into
mainfrom
bug
Oct 19, 2022
Merged

save_file now cleans the filename, expands user and returns the full file path#84
nabobalis merged 4 commits into
mainfrom
bug

Conversation

@nabobalis

@nabobalisnabobalis commented Oct 17, 2022

Copy link
Copy Markdown
Member

Fixes#83
Cleans filename, expands users and returns the filename now.

We also forgot to delete the old changelog file and point users to where the "changelogs" are kept.

Comment threadhvpy/tests/test_utils.py Outdated
@nabobalis

Copy link
Copy Markdown
MemberAuthor

I would like to get a 1.0.1 out of the door with this PR.

@nabobalis
nabobalis requested review from akash5100 and dgarciabriseno and removed request for dgarciabrisenoOctober 17, 2022 23:24
Comment threadhvpy/utils.py
if filename.exists() and not overwrite:
raise FileExistsError(f"{filename} already exists. Use overwrite=True to overwrite.")
filename.write_bytes(data)
return filename

@nabobalisnabobalisOct 17, 2022

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason to not do this?

It is quite useful to get the return and so I can pass that filepath into another function.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I don't recall. It is better now.

@nabobalisnabobalis changed the title fix for filename on windows and expand userFilaname is cleaned, expands user and save_file now returns the full file pathOct 17, 2022
@nabobalisnabobalis changed the title Filaname is cleaned, expands user and save_file now returns the full file pathFilename is cleaned, expands user and save_file now returns the full file pathOct 17, 2022
@nabobalisnabobalis changed the title Filename is cleaned, expands user and save_file now returns the full file pathsave_file now cleans the filename, expands user and returns the full file pathOct 17, 2022
@nabobalisnabobalis changed the title save_file now cleans the filename, expands user and returns the full file pathsave_file now cleans the filename, expands user and returns the full file pathOct 17, 2022
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Base: 99.29% // Head: 99.30% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (e7b1d8c) compared to base (716a5ec).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@ Coverage Diff @@## main #84 +/- ##
=======================================
Coverage 99.29% 99.30% =======================================
Files 25 25 Lines 711 716 +5 =======================================
+ Hits 706 711 +5 
Misses 5 5 
Impacted FilesCoverage Δ
hvpy/helpers.py96.15% <100.00%> (ø)
hvpy/utils.py100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment threadhvpy/helpers.py
@nabobalisnabobalis mentioned this pull request Oct 18, 2022
@nabobalis
nabobalis merged commit a46a790 into mainOct 19, 2022
@nabobalis
nabobalis deleted the bug branch October 19, 2022 16:25
Sign up for freeto 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.

Trying to save using ~/example.jpeg

4 participants

@nabobalis@codecov-commenter@akash5100@dgarciabriseno