From be25c647390748ac76ee66861d07338d1c19a6dd Mon Sep 17 00:00:00 2001 From: vmora Date: Fri, 22 Jan 2016 17:13:44 +0100 Subject: [PATCH] fix pakage --- package.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.py b/package.py index 6752cea..f748674 100755 --- a/package.py +++ b/package.py @@ -6,30 +6,30 @@ import tempfile import shutil -__currendir = os.path.dirname(__file__) +__currendir = os.path.abspath(os.path.dirname(__file__)) +out = os.path.join(__currendir,"qgis_versioning.zip") + files = ["README.md", "LICENSE", "metadata.txt"] for file_ in os.listdir(__currendir): if file_[-4:]==".svg" or file_[-3:]==".py" or file_[-3:]==".ui": files.append(file_) -print files tmpdir = os.path.join(tempfile.gettempdir(), "qgis_versioning") -print tmpdir if os.path.isdir(tmpdir): for file_ in os.listdir(tmpdir): - print "remove ", file_ ,"from", tmpdir os.remove(os.path.join(tmpdir, file_)) else: - print "create", tmpdir os.mkdir(tmpdir) for file_ in files: shutil.copy(os.path.join(__currendir, file_), os.path.join(tmpdir, file_)) -with zipfile.ZipFile("qgis_versioning.zip", 'w') as package: - for root, dirs, files in os.walk(tmpdir): +os.chdir(tempfile.gettempdir()) +with zipfile.ZipFile(out, 'w') as package: + for root, dirs, files in os.walk("qgis_versioning"): for file_ in files: + print root+"/"+file_ package.write(os.path.join(root, file_)) - +print "->", out