From c158cb076fe2ca6a009262caeb6a1f5a8f8f1a70 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Thu, 24 Sep 2015 12:43:20 -0400 Subject: [PATCH] Fix dist script for icons --- scripts/dist.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/dist.py b/scripts/dist.py index 237e4f5e9..b13cb48d9 100755 --- a/scripts/dist.py +++ b/scripts/dist.py @@ -174,17 +174,18 @@ if __name__ == "__main__": sys.path.append(source) import setup + # the following operations require us to be in the source directory + # for the zipping to work correctly + oldcwd = os.getcwd() + os.chdir(source) + libraryFile = os.path.join(base, "library.zip") with zipfile.ZipFile(libraryFile, 'a') as library: - # change cwd to source so that the zip append will work correctly - oldcwd = os.getcwd() - os.chdir(source) for dir in setup.packages: zipdir(dir, library) library.write('pyfa.py', 'pyfa__main__.py') library.write('config.py') - os.chdir(oldcwd) for dir in setup.include_files: copyanything(dir, os.path.join(base, dir)) @@ -193,11 +194,11 @@ if __name__ == "__main__": imagesFile = os.path.join(base, "imgs.zip") with zipfile.ZipFile(imagesFile, 'w') as images: - oldcwd = os.getcwd() - os.chdir(source) + os.chdir('imgs') # need to be in images directory for dir in setup.icon_dirs: zipdir(dir, images) - os.chdir(oldcwd) + + os.chdir(oldcwd) if options.zip: archive = zipfile.ZipFile(tmpFile, 'w', compression=zipfile.ZIP_DEFLATED)