def do_list_imp(self, what = None, stream=sys.stdout):
    if what is None:
        augmentedYaml.writeAsYaml(self, stream)
    list_to_do = list()
    if isinstance(what, str):
        list_to_do.append(what)
    elif isinstance(what, list):
        list_to_do.extend(what)
    whole_sections_to_write = list()
    individual_items_to_write = list()
    for item_to_do in list_to_do:
        if guid_re.match(item_to_do):
            whole_sections_to_write.append({item_to_do: iids_from_guid(self.install_definitions_index, item_to_do)})
        elif item_to_do == "define":
            whole_sections_to_write.append(augmentedYaml.YamlDumpDocWrap(var_list, '!define', "Definitions", explicit_start=True, sort_mappings=True))
        elif item_to_do == "index":
            whole_sections_to_write.append(augmentedYaml.YamlDumpDocWrap(self.install_definitions_index, '!index', "Installation index", explicit_start=True, sort_mappings=True))
        elif item_to_do == "guid":
            guid_dict = dict()
            for lic in guid_list(self.install_definitions_index):
                guid_dict[lic] = iids_from_guid(self.install_definitions_index, lic)
            whole_sections_to_write.append(augmentedYaml.YamlDumpDocWrap(guid_dict, '!guid', "guid to IID", explicit_start=True, sort_mappings=True))
        else:
            individual_items_to_write.append(item_to_do)

    augmentedYaml.writeAsYaml(whole_sections_to_write+self.repr_for_yaml(individual_items_to_write), stream)
def create_completion_list_imp(self, for_what="all"):
    retVal = list()
    try:
        if for_what in ("all", "index"):
            retVal.extend(self.install_definitions_index.keys())
        if for_what in ("all", "define"):
            retVal.extend(var_list.keys())
        if for_what in ("all", "guid"):
            retVal.extend(guid_list(self.install_definitions_index))
    except Exception as ex:
        print("create_completion_list:",   ex)
    return retVal
Example #3
0
    def add_deafult_items(self):
        all_items_item = InstallItem()
        all_items_item.iid = "__ALL_ITEMS_IID__"
        all_items_item.name = "All IIDs"
        for item_name in self.install_definitions_index:
            all_items_item.add_depend(item_name)
        self.install_definitions_index["__ALL_ITEMS_IID__"] = all_items_item

        all_guids_item = InstallItem()
        all_guids_item.iid = "__ALL_GUIDS_IID__"
        all_guids_item.name = "All GUIDs"
        for guid in guid_list(self.install_definitions_index):
            all_guids_item.add_depend(guid)
        self.install_definitions_index["__ALL_GUIDS_IID__"] = all_guids_item