]> git.tdb.fi Git - poefilter.git/commitdiff
Some tweaks to skill gem scraping
authorMikko Rasa <tdb@tdb.fi>
Fri, 17 Aug 2018 20:29:48 +0000 (23:29 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 17 Aug 2018 20:42:40 +0000 (23:42 +0300)
Better tagging for categories

Don't output drop-only gems in the price categories

scrape-wiki-data.py

index b12f8a67681aa79e1469c1184749eee4d6d05b25..470d282e21876a6655c07a9429ba683f11daba0c 100755 (executable)
@@ -382,28 +382,28 @@ def main():
        sys.stdout.write(prefix)
 
        out = open("skillgems.txt", "w")
        sys.stdout.write(prefix)
 
        out = open("skillgems.txt", "w")
-       out.write('category "skillgem.vaal"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n')
+       out.write('category "skillgem.special.vaal"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n')
        for g in gems:
                if g.vaal:
                        out.write('\t\tbase_type "{}";\n'.format(g.name))
        out.write("\t};\n};\n")
 
        for g in gems:
                if g.vaal:
                        out.write('\t\tbase_type "{}";\n'.format(g.name))
        out.write("\t};\n};\n")
 
-       out.write('category "skillgem.drop"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n')
+       out.write('category "skillgem.special.drop"\n{\n\tclass "Skill Gem";\n\tor\n\t{\n')
        for g in gems:
                if (g.drop_only or not g.price) and not g.vaal:
                        out.write('\t\tbase_type "{}";\n'.format(g.name))
        out.write("\t};\n};\n")
 
        for p, n in SkillGemParser.prices:
        for g in gems:
                if (g.drop_only or not g.price) and not g.vaal:
                        out.write('\t\tbase_type "{}";\n'.format(g.name))
        out.write("\t};\n};\n")
 
        for p, n in SkillGemParser.prices:
-               out.write('category "skillgem.{}"\n'.format(p))
+               out.write('category "skillgem.price.{}"\n'.format(p))
                out.write('{\n\tclass "Skill Gem";\n\tor\n\t{\n')
                for g in gems:
                out.write('{\n\tclass "Skill Gem";\n\tor\n\t{\n')
                for g in gems:
-                       if g.price==p:
+                       if not g.drop_only and g.price==p:
                                out.write('\t\tbase_type "{}";\n'.format(g.name))
                out.write("\t};\n};\n")
 
        for a in ["strength", "dexterity", "intelligence"]:
                                out.write('\t\tbase_type "{}";\n'.format(g.name))
                out.write("\t};\n};\n")
 
        for a in ["strength", "dexterity", "intelligence"]:
-               out.write('category "skillgem.{}"\n'.format(a))
+               out.write('category "skillgem.attribute.{}"\n'.format(a))
                out.write('{\n\tclass "Skill Gem";\n\tor\n\t{\n')
                for g in gems:
                        if g.primary_attribute==a:
                out.write('{\n\tclass "Skill Gem";\n\tor\n\t{\n')
                for g in gems:
                        if g.primary_attribute==a: