]> git.tdb.fi Git - poefilter.git/blobdiff - scrape-item-data.py
Created combined best/second_at_level categories
[poefilter.git] / scrape-item-data.py
index ab8bc097d4ecc8383cddf993a2abf378bb3a824f..c592ff48d1c1d437a3d86b1ebb300206c7677797 100755 (executable)
@@ -163,6 +163,8 @@ class ItemDataParser(html.parser.HTMLParser):
 
                if self.in_heading:
                        self.current_heading = data
+                       if self.current_heading=="Staff":
+                               self.current_heading = "Stave"
                        self.headings.append(self.current_heading)
                elif self.in_items_table and self.in_cell:
                        if self.mod_row:
@@ -317,6 +319,13 @@ def main():
                        out.write('\t\tbase_type "{}";\n'.format(it.name))
                out.write("\t};\n};\n")
 
+       for b in ("best", "second"):
+               out.write('category "armor.{}_at_level"\n'.format(b))
+               out.write('{\n\tor\n\t{\n')
+               for t in types.keys():
+                       out.write('\t\tcategory "armor.{}.{}_at_level";\n'.format(t, b))
+               out.write("\t};\n};\n")
+
        out.write('category "armor"\n{\n\tor\n\t{\n')
        for h in p.headings:
                out.write('\t\tclass "{}";\n'.format(h))
@@ -337,6 +346,13 @@ def main():
                for i in range(1, 3):
                        write_best_category(out, "weapon.{}".format(h.lower().replace(' ', '_')), items, i)
 
+       for b in ("best", "second"):
+               out.write('category "weapon.{}_at_level"\n'.format(b))
+               out.write('{\n\tor\n\t{\n')
+               for h in p.headings:
+                       out.write('\t\tcategory "weapon.{}.{}_at_level";\n'.format(h.lower().replace(' ', '_'), b))
+               out.write("\t};\n};\n")
+
        out.write('category "weapon"\n{\n\tor\n\t{\n')
        for h in p.headings:
                out.write('\t\tclass "{}";\n'.format(h))