diff options
author | Helmut Grohne <helmut@subdivi.de> | 2021-12-29 21:14:38 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2021-12-29 21:14:38 +0100 |
commit | 9b2cd74186f74a3c3e7c10b0ce39ebd992b11d36 (patch) | |
tree | 14fb7269f8e771b794a4559b69f468f6c30ef54d | |
parent | d9d757792682e98e006d93f6bcbb94688d3a0f3f (diff) | |
download | debian-dedup-9b2cd74186f74a3c3e7c10b0ce39ebd992b11d36.tar.gz |
webapp: avoid changing variable type
Again static type checking is the driver for the change here.
-rwxr-xr-x | webapp.py | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -22,18 +22,18 @@ from dedup.utils import fetchiter jinjaenv = jinja2.Environment(loader=jinja2.PackageLoader("dedup", "templates")) def format_size(size): - size = float(size) + sizef = float(size) fmt = "%d B" - if size >= 1024: - size /= 1024 + if sizef >= 1024: + sizef /= 1024 fmt = "%.1f KB" - if size >= 1024: - size /= 1024 + if sizef >= 1024: + sizef /= 1024 fmt = "%.1f MB" - if size >= 1024: - size /= 1024 + if sizef >= 1024: + sizef /= 1024 fmt = "%.1f GB" - return fmt % size + return fmt % sizef def function_combination(function1, function2): if function1 == function2: |