Created
July 23, 2017 09:55
-
-
Save TurBoss/ff439dd31840908e5d8eb103e1119753 to your computer and use it in GitHub Desktop.
Downloads SpringRTS to a specific directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
from xmlrpc.client import ServerProxy | |
path = "/home/spring/SpringRTS" | |
pr_downloader = "/home/spring/bin/pr-downloader" | |
proxy = ServerProxy('http://api.springfiles.com/xmlrpc.php') | |
searchstring = {"category" : "engine_linux64", "limit": 1} | |
result = proxy.springfiles.search(searchstring) | |
version = result[0]['version'] | |
output = subprocess.Popen([pr_downloader, | |
'--filesystem-writepath', path, | |
'--download-engine', version], | |
stdout=subprocess.PIPE) \ | |
.communicate()[0] \ | |
.decode("UTF-8") | |
print(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment