self.in_items_table = False
self.column = 0
self.in_cell = False
- self.items = {}
+ self.items = []
self.current_item = None
self.in_heading = False
self.headings = []
self.in_cell = False
elif tag=="tr":
if self.current_item and self.mod_row:
- for it in self.items.values():
+ for it in self.items:
self.current_item.check_upgrade(it)
elif tag=="h1":
self.in_heading = False
else:
if self.column==2:
self.current_item = self.create_item(data, self.current_heading)
- self.items[data] = self.current_item
+ self.items.append(self.current_item)
elif self.column==3:
self.current_item.droplevel = int(data)
elif self.column>=4:
out = open("armor.txt", "w")
for t, f in types.items():
- items = [i for i in p.items.values() if f(i)]
+ items = [i for i in p.items if f(i)]
for i in range(1, 3):
write_best_category(out, "armor.{}".format(t), items, i)
out = open("weapons.txt", "w")
for h in p.headings:
- items = [i for i in p.items.values() if i.kind==h]
+ items = [i for i in p.items if i.kind==h]
for i in range(1, 3):
write_best_category(out, "weapon.{}".format(h.lower().replace(' ', '_')), items, i)