From 28f35aa12ad667c71916412b37bb8cf8cb0af947 Mon Sep 17 00:00:00 2001 From: Krateng Date: Mon, 18 Feb 2019 16:45:36 +0100 Subject: [PATCH] Worked around VERY strange bug in update script --- maloja | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/maloja b/maloja index c22443d..2bdcd86 100755 --- a/maloja +++ b/maloja @@ -157,21 +157,28 @@ def update(): import urllib.request import shutil - import tempfile + #import tempfile import zipfile import distutils.dir_util print("Updating Maloja...") - with urllib.request.urlopen(SOURCE_URL) as response: - with tempfile.NamedTemporaryFile(delete=True) as tmpfile: - shutil.copyfileobj(response,tmpfile) - - with zipfile.ZipFile(tmpfile.name,"r") as z: + #with urllib.request.urlopen(SOURCE_URL) as response: + # with tempfile.NamedTemporaryFile(delete=True) as tmpfile: + # shutil.copyfileobj(response,tmpfile) + # + # with zipfile.ZipFile(tmpfile.name,"r") as z: + # + # for f in z.namelist(): + # #print("extracting " + f) + # z.extract(f) + + + os.system("wget " + SOURCE_URL) + with zipfile.ZipFile("master.zip","r") as z: - for f in z.namelist(): - #print("extracting " + f) - z.extract(f) - + for f in z.namelist(): + #print("extracting " + f) + z.extract(f) distutils.dir_util.copy_tree("./maloja-master/","./",verbose=2)