Convert installed size to a human readable format.
BUG:COMMENT:8845
This commit is contained in:
+5
-2
@@ -29,7 +29,7 @@ import pisi.util as util
|
|||||||
|
|
||||||
class Delta:
|
class Delta:
|
||||||
__metaclass__ = autoxml.autoxml
|
__metaclass__ = autoxml.autoxml
|
||||||
|
|
||||||
t_PackageURI = [ autoxml.String, autoxml.optional]
|
t_PackageURI = [ autoxml.String, autoxml.optional]
|
||||||
t_PackageSize = [ autoxml.Long, autoxml.optional]
|
t_PackageSize = [ autoxml.Long, autoxml.optional]
|
||||||
t_PackageHash = [ autoxml.String, autoxml.optional, "SHA1Sum" ]
|
t_PackageHash = [ autoxml.String, autoxml.optional, "SHA1Sum" ]
|
||||||
@@ -71,10 +71,13 @@ class Package(specfile.Package, xmlfile.XmlFile):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
s = specfile.Package.__str__(self)
|
s = specfile.Package.__str__(self)
|
||||||
|
i_size = util.human_readable_size(self.installedSize)
|
||||||
|
size = "%.2f %s" % (i_size[0], i_size[1])
|
||||||
|
|
||||||
s += _('Distribution: %s, Dist. Release: %s\n') % \
|
s += _('Distribution: %s, Dist. Release: %s\n') % \
|
||||||
(self.distribution, self.distributionRelease)
|
(self.distribution, self.distributionRelease)
|
||||||
s += _('Architecture: %s, Installed Size: %s') % \
|
s += _('Architecture: %s, Installed Size: %s') % \
|
||||||
(self.architecture, self.installedSize)
|
(self.architecture, size)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
class MetaData(xmlfile.XmlFile):
|
class MetaData(xmlfile.XmlFile):
|
||||||
|
|||||||
Reference in New Issue
Block a user