Beispiel #1
0
 def detectSubtypes(self):
     if windows.askUser(
         "Change Subtypes",
         "Software will set default subtypes.\n"
         "Subtypes of most items will be changed",
     ):
         upgradeDB.findSubTypes(dao.getAllItems())
Beispiel #2
0
def update(dir, includedMods):
    #fix this so it does not need written anymore
    written = []
    includedMods = orderModList(includedMods)
    f = dir
    items = dao.getAllItems()
    f.write("<types>\n")
    for mod in includedMods:
        f.write("  <!--{}--> \n".format(mod))
        for item in items:
            if item[37] in mod and item[0] not in written:
                f.write(getXmlBlock(item))
                written.append(item[0])
    f.write("</types>\n")
Beispiel #3
0
    def viewCategroy(self):
        cat = self.typeSel.get()
        subtype = self.subtypeSel.get() if self.subtypeSel.get() != "" else None

        try:
            if cat in categories.categories:
                rows = dao.getCategory(cat, subtype)
            elif cat in itemTypes:
                rows = dao.getType(cat, subtype)
            else:
                rows = dao.getAllItems(subtype)
        except Exception:
            rows = []

        self.updateDisplay(rows)
def update(dir, includedMods, namalsk=False):
    #fix this so it does not need written anymore

    mod_index = len(cats.loot_economy) + len(cats.usages) + len(
        cats.tiers) + len(cats.tags) + len(cats.flags) + 2

    written = []
    includedMods = orderModList(includedMods)
    f = dir
    items = dao.getAllItems()
    f.write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n")
    f.write("<types>\n")
    for mod in includedMods:
        f.write("  <!--{}--> \n".format(mod))
        for item in items:
            if item[mod_index] in mod and item[0] not in written:
                f.write(getXmlBlock(item, namalsk))
                written.append(item[0])
    f.write("</types>\n")
def all_items_handler():
    """API endpoint to get all items."""
    items = getAllItems()
    return jsonify(items=[i.serialize for i in items])