From: Artem Bityutskiy Date: Wed, 31 Oct 2012 12:09:08 +0000 (+0200) Subject: BmapFlasher: provide a list of supported image formats X-Git-Tag: v1.0~175 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f70571fd66e6c6718a25da10042c64fead204982;p=tools%2Fbmap-tools.git BmapFlasher: provide a list of supported image formats Change-Id: I45b8014c14dfe863190ce2967c151b269d2c9af9 Signed-off-by: Artem Bityutskiy --- diff --git a/BmapFlasher.py b/BmapFlasher.py index 867bacc..5c9de88 100644 --- a/BmapFlasher.py +++ b/BmapFlasher.py @@ -13,6 +13,9 @@ import os import hashlib from xml.etree import ElementTree +# A list of supported image formats +supported_image_formats = ('bz2', 'gz', 'tar.gz', 'tgz', 'tar.bz2') + # The highest supported bmap format version supported_bmap_version = 1 @@ -54,7 +57,7 @@ class BmapFlasher: def _open_image_file(self): """ Open the image The image file may be uncompressed or compressed. The compression type is recognized by the file extention. Supported - types are: .tar.gz, .tar.bz2, .tgz, .gz, and .bz2. """ + types are defined by 'supported_image_formats' """ try: if self._image_path.endswith('.tar.gz') \ diff --git a/bmap-flasher b/bmap-flasher index 145baa5..33fd966 100755 --- a/bmap-flasher +++ b/bmap-flasher @@ -52,8 +52,8 @@ def parse_arguments(): parser.add_argument("bdev", help = text) # The second command-line argument - image file - text = "The image file to flash. Supported formats: uncompressed, " \ - ".tar.bz2, .tar.gz, .bz2, .gz." + text = "The image file to flash. Supported formats: uncompressed, " + \ + ", ".join(BmapFlasher.supported_image_formats) parser.add_argument("image", help = text) # The --bmap option