0,0 → 1,40 |
from zipfile import ZipFile |
import os |
import sys |
import glob |
import shutil |
import platform |
|
sys.path.append(os.path.abspath('.')) |
|
import relevation |
|
if sys.platform != 'win32': |
print "This script is meant to be run in Windows only" |
sys.exit(3) |
|
if not os.path.isdir('dist'): |
print "dist\\ must exist" |
sys.exit(2) |
|
plat = platform.architecture() |
if plat[0] == '64bit': |
plat = '64' |
else: |
plat = '32' |
|
pkgver = 'relevation-%s_win%s' % ( relevation.__version__, plat ) |
zipname = pkgver + '.zip' |
|
if os.path.isdir(pkgver): |
shutil.rmtree(pkgver) |
shutil.copytree("dist", pkgver) |
|
print '>',zipname |
with ZipFile(zipname, 'w') as zipf: |
for f in glob.glob("%s\\*" % pkgver): |
zipf.write(f) |
print f |
|
if os.path.isdir(pkgver): |
shutil.rmtree(pkgver) |