linkname = 'hob-image-' + self.configuration.curr_mach
else:
linkname = selected_image + '-' + self.configuration.curr_mach
+ image_extension = self.get_image_extension()
for image_type in self.parameters.image_types:
- for real_image_type in hcc.SUPPORTED_IMAGE_TYPES[image_type]:
+ if image_type in image_extension:
+ real_types = image_extension[image_type]
+ else:
+ real_types = [image_type]
+ for real_image_type in real_types:
linkpath = self.parameters.image_addr + '/' + linkname + '.' + real_image_type
if os.path.exists(linkpath):
self.parameters.image_names.append(os.readlink(linkpath))
self.save_template(path)
dialog.destroy()
+ def get_image_extension(self):
+ image_extension = {}
+ for type in self.parameters.image_types:
+ ext = self.handler.runCommand(["getVariable", "IMAGE_EXTENSION_%s" % type])
+ if ext:
+ image_extension[type] = ext.split(' ')
+
+ return image_extension
+
def show_load_my_images_dialog(self):
+ image_extension = self.get_image_extension()
dialog = ImageSelectionDialog(self.parameters.image_addr, self.parameters.image_types,
"Open My Images", self,
- gtk.FILE_CHOOSER_ACTION_SAVE)
+ gtk.FILE_CHOOSER_ACTION_SAVE, None,
+ image_extension)
button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
HobAltButton.style_button(button)
button = dialog.add_button("Open", gtk.RESPONSE_YES)
format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
self.consolelog.setFormatter(format)
- self.logger.addHandler(self.consolelog)
\ No newline at end of file
+ self.logger.addHandler(self.consolelog)
}]
- def __init__(self, image_folder, image_types, title, parent, flags, buttons=None):
+ def __init__(self, image_folder, image_types, title, parent, flags, buttons=None, image_extension = {}):
super(ImageSelectionDialog, self).__init__(title, parent, flags, buttons)
self.connect("response", self.response_cb)
self.image_types = image_types
self.image_list = []
self.image_names = []
+ self.image_extension = image_extension
# create visual elements on the dialog
self.create_visual_elements()
dirs[:] = []
for f in files:
for image_type in self.image_types:
- for real_image_type in hcc.SUPPORTED_IMAGE_TYPES[image_type]:
+ if image_type in self.image_extension:
+ real_types = self.image_extension[image_type]
+ else:
+ real_types = [image_type]
+ for real_image_type in real_types:
if f.endswith('.' + real_image_type):
imageset.add(f.rsplit('.' + real_image_type)[0].rsplit('.rootfs')[0])
self.image_list.append(f)