Skip to content

Commit

Permalink
[wesnoth_addon_manager] Also upload sub-sections from the .pbl.
Browse files Browse the repository at this point in the history
  • Loading branch information
allefant committed Feb 16, 2014
1 parent d62fbe5 commit ae3697d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
11 changes: 4 additions & 7 deletions data/tools/wesnoth/campaignserver_client.py
Expand Up @@ -305,19 +305,16 @@ def get_campaign(self, name):

return None

def put_campaign(self, name, cfgfile, directory, ign, stuff):
def put_campaign(self, name, cfgfile, directory, ign, pbl):
"""
Uploads a campaign to the server. The title, name, author, passphrase,
description, version and icon parameters are what would normally be
found in a .pbl file.
Uploads a campaign to the server.
The cfgfile is the name of the main .cfg file of the campaign.
The directory is the name of the campaign's directory.
"""
request = wmldata.DataSub("upload")
for k, v in stuff.items():
request.set_text_val(k, v)
request = pbl.copy()
request.name = "upload"
request.set_text_val("name", name)

data = wmldata.DataSub("data")
Expand Down
6 changes: 1 addition & 5 deletions data/tools/wesnoth_addon_manager
Expand Up @@ -327,11 +327,7 @@ dependencies="%s"
"*.wesnoth",
"*.project"]

stuff = {}
for field in pbl.children():
stuff[field.name] = pbl.get_text_val(field.name)

mythread = cs.put_campaign_async(name, cfgfile, wmldir, ign, stuff)
mythread = cs.put_campaign_async(name, cfgfile, wmldir, ign, pbl)

pcounter = 0
while not mythread.event.isSet():
Expand Down

0 comments on commit ae3697d

Please sign in to comment.