Skip to content
This repository has been archived by the owner on Jun 4, 2020. It is now read-only.

Commit

Permalink
fix pakage
Browse files Browse the repository at this point in the history
  • Loading branch information
vmora committed Jan 22, 2016
1 parent 39e1236 commit be25c64
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit be25c64

Please sign in to comment.