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

Show more than bytes for negative file sizes #122

Merged
merged 2 commits into from
Mar 9, 2020
Merged

Show more than bytes for negative file sizes #122

merged 2 commits into from
Mar 9, 2020

Conversation

hugovk
Copy link
Collaborator

@hugovk hugovk commented Mar 5, 2020

Fixes #79.

Changes proposed in this pull request:

  • For negative file sizes (for example, to display a change in file size), don't return everything in bytes, use the other prefixes

Before

>>> import humanize
>>> humanize.naturalsize(123456)
'123.5 kB'
>>> humanize.naturalsize(-123456)
'-123456 Bytes'
>>>

After

>>> import humanize
>>> humanize.naturalsize(123456)
'123.5 kB'
>>> humanize.naturalsize(-123456)
'-123.5 kB'
>>>

@tmc
Copy link

tmc commented Mar 5, 2020

Codecov Report

Merging #122 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #122   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          410       414    +4     
=========================================
+ Hits           410       414    +4     
Flag Coverage Δ
#GHA_Ubuntu 100.00% <100.00%> (ø)
#GHA_Windows ?
#GHA_macOS 100.00% <100.00%> (ø)

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 aaca29f...8c56ba7. Read the comment docs.

@hugovk hugovk added changelog: Added For new features enhancement New feature or request labels Mar 5, 2020
@codecov-io
Copy link

codecov-io commented Mar 5, 2020

Codecov Report

Merging #122 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #122   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           9      9           
  Lines         410    414    +4     
=====================================
+ Hits          410    414    +4
Flag Coverage Δ
#GHA_Ubuntu 100% <100%> (ø) ⬆️
#GHA_Windows 100% <100%> (ø) ⬆️
#GHA_macOS 100% <100%> (ø) ⬆️
Impacted Files Coverage Δ
tests/test_filesize.py 100% <100%> (ø) ⬆️
src/humanize/filesize.py 100% <100%> (ø) ⬆️

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 aaca29f...8c56ba7. Read the comment docs.

@tmc
Copy link

tmc commented Mar 5, 2020

Codecov Report

Merging #122 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #122   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          410       414    +4     
=========================================
+ Hits           410       414    +4     
Flag Coverage Δ
#GHA_Ubuntu 100.00% <100.00%> (ø)
#GHA_Windows 100.00% <100.00%> (ø)
#GHA_macOS 100.00% <100.00%> (ø)

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 aaca29f...8c56ba7. Read the comment docs.

@hugovk hugovk merged commit 705ff99 into jmoiron:master Mar 9, 2020
@hugovk hugovk deleted the 79-negative-filesize branch March 9, 2020 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Added For new features enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Negative Sizes Only Show In Bytes
3 participants