update the addon manager for "simple WML"
This commit is contained in:
parent
7cdec04c7f
commit
4de5cdc7d3
1 changed files with 10 additions and 0 deletions
|
@ -111,6 +111,16 @@ class CampaignClient:
|
|||
|
||||
|
||||
def make_packet(self, doc):
|
||||
|
||||
# The Wesnoth campaign server only accepts "simple WML", which
|
||||
# requires all attributes to be sorted alphabetically.
|
||||
def sorter(tag):
|
||||
if isinstance(tag, wmlparser.TagNode):
|
||||
tag.data.sort(key = lambda node: node.name)
|
||||
for tag2 in tag.data:
|
||||
sorter(tag2)
|
||||
sorter(doc)
|
||||
|
||||
return doc.wml()
|
||||
|
||||
def send_packet(self, packet):
|
||||
|
|
Loading…
Add table
Reference in a new issue