Skip to content

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

Merged
nabobalis merged 4 commits intomainfrom
bug
Oct 19, 2022
Merged

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

Conversation

@nabobalis
Copy link
Member

@nabobalis nabobalis commented Oct 17, 2022

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.

@nabobalis
Copy link
Member Author

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 dgarciabriseno October 17, 2022 23:24
if filename.exists() and not overwrite:
raise FileExistsError(f"{filename} already exists. Use overwrite=True to overwrite.")
filename.write_bytes(data)
return filename
Copy link
Member Author

@nabobalis nabobalis Oct 17, 2022

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

@nabobalis nabobalis changed the title fix for filename on windows and expand user Filaname is cleaned, expands user and save_file now returns the full file path Oct 17, 2022
@nabobalis nabobalis changed the title Filaname is cleaned, expands user and save_file now returns the full file path Filename is cleaned, expands user and save_file now returns the full file path Oct 17, 2022
@nabobalis nabobalis changed the title Filename is cleaned, expands user and save_file now returns the full file path save_file now cleans the filename, expands user and returns the full file path Oct 17, 2022
@nabobalis nabobalis changed the title save_file now cleans the filename, expands user and returns the full file path save_file now cleans the filename, expands user and returns the full file path Oct 17, 2022
@codecov-commenter
Copy link

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 Files Coverage Δ
hvpy/helpers.py 96.15% <100.00%> (ø)
hvpy/utils.py 100.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.

@nabobalis nabobalis merged commit a46a790 into main Oct 19, 2022
@nabobalis nabobalis deleted the bug branch October 19, 2022 16:25
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.

Trying to save using ~/example.jpeg

4 participants