Updates
This commit is contained in:
parent
363ffc40ce
commit
b2504f49f9
5
upload
5
upload
@ -25,7 +25,7 @@ def find_ais(path):
|
||||
return [Ai(x) for x in os.listdir(path) if not x.startswith('__')]
|
||||
|
||||
def upload_ai(ai):
|
||||
print_yellow("Zipping " + ai.name + "...")
|
||||
print_yellow("Zipping the AI...")
|
||||
zip = zipfile.ZipFile('.archive.zip', mode = 'w')
|
||||
try:
|
||||
for file in os.listdir(AIS_DIR + "/" + ai.path):
|
||||
@ -33,12 +33,15 @@ def upload_ai(ai):
|
||||
finally:
|
||||
zip.close()
|
||||
|
||||
print_yellow("Uploading the AI...")
|
||||
try:
|
||||
subprocess.check_call([
|
||||
'curl', '-X', 'POST', '-F', 'archive=@.archive.zip', '-F', 'name=' + ai.name,
|
||||
'http://pytron.tforgione.fr/upload-target/'],
|
||||
stderr = subprocess.DEVNULL,
|
||||
stdout = subprocess.DEVNULL)
|
||||
|
||||
print_green("Upload finished!")
|
||||
except subprocess.CalledProcessError:
|
||||
print_red('An error occured while uploading the AI...')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user