Fixed campaign2wiki script not working with the new difficulty syntax

This commit is contained in:
Elvish_Hunter 2016-06-21 21:50:47 +02:00
parent 0b48b779c0
commit ad5b92392c

View file

@ -26,9 +26,7 @@ class Campaign:
self.name = self.parser.get_text_val("name")
self.id = self.parser.get_text_val("id")
self.description = self.parser.get_text_val("description")
# Difficulty levels are separated by commas, so there are
# count(',')+1 difficulty levels.
self.levels = self.parser.get_text_val("difficulties").count(',') + 1
self.levels = len(self.parser.get_all(tag="difficulty"))
self.credits_link = "http://wiki.wesnoth.org/Credits#" + self.id
self.units_link = "http://units.wesnoth.org/trunk/mainline/en_US/%s.html" % self.id