forked from naudio/NAudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzipdemo.py
32 lines (25 loc) · 930 Bytes
/
zipdemo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import zipfile
import os
import sys
outfile = "BuildArtefacts\\NAudio-Demo-Apps.zip"
if len(sys.argv) > 1:
outfile = sys.argv[1]
print "creating " + outfile
folders = ['AudioFileInspector','NAudioDemo','NAudioWpfDemo']
files = {}
def exclude(filename):
return filename.endswith('.pdb') or ('.vshost.' in filename)
for folder in folders:
fullpath = folder + "\\bin\\debug\\"
for filename in os.listdir(fullpath):
if not exclude(filename):
files[filename] = fullpath + filename
zip = zipfile.ZipFile(outfile, "w")
for filename, fullpath in files.iteritems():
if os.path.isdir(fullpath):
#print fullpath + " is a folder"
for subfile in os.listdir(fullpath):
zip.write(fullpath + "\\" + subfile, filename + "\\" + subfile, zipfile.ZIP_DEFLATED)
else:
zip.write(fullpath, filename, zipfile.ZIP_DEFLATED)
zip.close()