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
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') \
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