simonzack / hfilesize Goto Github PK
View Code? Open in Web Editor NEWHuman readable file size parsing & formatting in python 3, with various notations
Human readable file size parsing & formatting in python 3, with various notations
>>> from hfilesize import Format, FileSize
>>> FileSize('1k')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/marc/.virtualenvs/wrimg/local/lib/python2.7/site-packages/hfilesize/hfilesize.py", line 236, in __new__
return super().__new__(cls, size)
TypeError: super() takes at least 1 argument (0 given)
I didn't have a chance to put a PR together, but the change is pretty simple.
hfilesize/hfilesize/hfilesize.py
Line 206 in e14acef
value
should be value=0
to match the behavior of int
>>> int()
0
>>> FileSize()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __new__() missing 1 required positional argument: 'value'
I'd like to have 1-symbol short versions of the suffixes for base 1000 just like the ones for base 1024 that already exist in the cs
format:
'' ' kb' ' mb' ' gb' ' tb' ' pb' ' eb' ' zb' ' yb' (current abbreviations)
'' 'k' 'm' 'g' 't' 'p' 'e' 'z' 'y' (proposed)
I've created a PR #4 with this changes by introducing a new css
format that gets rid of the extra space/b symbols.
Hopefully you'll find this change useful
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.