Closed vpodzime closed 5 years ago
Found few "bugs" (mostly just not returning nice error messages):
Modulo with integer traceback:
$ python3 bs_calc.py "4 B % 2"
Traceback (most recent call last):
...
AttributeError: 'int' object has no attribute '_c_size'
Zero division traceback:
$ python3 bs_calc.py "4 B / 0"
Traceback (most recent call last):
...
bytesize.bytesize.ZeroDivisionError: Division by zero
Parsing exponents fails:
$ python3 bs_calc.py "1e5 MiB"
Error while parsing expression: Failed to parse size spec: 1e5 MiB
but it works with negative powers:
$ python3 bs_calc.py "1e-5 MiB"
10 B
0.01 KiB
Support for sectors. (I can use
*/512
, but I'm too lazy.)
Sector size depends on the device.
This needs some more work on adding the man page.
This needs some more work on adding the man page.
DONE.
Jenkins, test this please.
Ideas for further development:
bscalc --MiB 15698412
should work. I often need to "parse" some "random" number of bytes and addingB
to some copy-pasted value is annoying :-)*/512
, but I'm too lazy.)