summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2021-12-29 21:14:38 +0100
committerHelmut Grohne <helmut@subdivi.de>2021-12-29 21:14:38 +0100
commit9b2cd74186f74a3c3e7c10b0ce39ebd992b11d36 (patch)
tree14fb7269f8e771b794a4559b69f468f6c30ef54d
parentd9d757792682e98e006d93f6bcbb94688d3a0f3f (diff)
downloaddebian-dedup-9b2cd74186f74a3c3e7c10b0ce39ebd992b11d36.tar.gz
webapp: avoid changing variable type
Again static type checking is the driver for the change here.
-rwxr-xr-xwebapp.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/webapp.py b/webapp.py
index d91d724..0d9e3f9 100755
--- a/webapp.py
+++ b/webapp.py
@@ -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: