mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-11 20:48:11 +01:00
Fix: convert string to float #52
This commit is contained in:
parent
699e494e50
commit
1d1f79d4b5
1 changed files with 4 additions and 2 deletions
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
|
@ -406,10 +407,11 @@ class PackageManager(object):
|
||||||
data = Utils().read_file(self.meta.pkg_path + package)
|
data = Utils().read_file(self.meta.pkg_path + package)
|
||||||
for line in data.splitlines():
|
for line in data.splitlines():
|
||||||
if line.startswith("UNCOMPRESSED PACKAGE SIZE:"):
|
if line.startswith("UNCOMPRESSED PACKAGE SIZE:"):
|
||||||
|
digit = re.sub("\D", "", line[26:])
|
||||||
if "M" in line[26:]:
|
if "M" in line[26:]:
|
||||||
self.size += float(line[26:-1]) * 1024
|
self.size += float(digit) * 1024
|
||||||
else:
|
else:
|
||||||
self.size += float(line[26:-1])
|
self.size += float(digit)
|
||||||
break
|
break
|
||||||
|
|
||||||
def display(self):
|
def display(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue