Skip to content
Snippets Groups Projects
Commit 0149a130 authored by Aurélien Dunand's avatar Aurélien Dunand Committed by Seblu
Browse files

Add function to display packaged image content

parent df547c79
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,6 @@ class Image(object):
'''
return re.match("\d+", buf) is not None
class SourceImage(Image):
'''
Image source manipulation class
......@@ -418,6 +417,31 @@ class PackageImage(Image):
arrowlevel(-1)
return desc
def show(self, verbose=False, list=False):
'''
Display image content
'''
out('Name : %s' % self.name)
out('Version : %s' % self.version)
out('Date : %s' % time.asctime(time.gmtime(self.date)))
if verbose:
out('Description : %s' % self.description)
out('Author : %s' % self.author)
out('MD5 : %s' % self.md5 )
out('Payload :')
payloads = self.payload
for payload_name in payloads:
payload = payloads[payload_name]
out(' Name : %s' % payload_name)
out(' Date : %s' % time.asctime(time.gmtime(payload.mtime)))
out(' Size : %s' % (istools.human_size(payload.size)))
out(' MD5 : %s' % payload.md5)
out('')
out('')
if list:
out('Content : ')
self._tarball.list(verbose)
def check(self, message="Check MD5"):
'''
Check md5 and size of tarballs are correct
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment