-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpackage.py
executable file
·77 lines (71 loc) · 2.99 KB
/
package.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/python
from zipfile import ZipFile
import os
from os.path import split
EXPORT = "package/"
if not os.path.exists(EXPORT):
os.makedirs(EXPORT)
# Connectors
with ZipFile(EXPORT + "connectors.zip", 'w') as zipObj:
dir = "Connectors/STL/"
zipObj.write("LICENSE")
# Iterate over all the files in directory
for folderName, subfolders, filenames in os.walk("docs/"):
for filename in filenames:
if filename != "CNAME":
#create complete filepath of file in directory
filePath = os.path.join(folderName, filename)
# Add file to zip
zipObj.write(filePath, filePath)
for folderName, subfolders, filenames in os.walk(dir):
for filename in filenames:
#create complete filepath of file in directory
filePath = os.path.join(folderName, filename)
safename = filePath.replace(dir, "")
# Add file to zip
zipObj.write(filePath, safename)
# Modules
with ZipFile(EXPORT + "modules.zip", 'w') as zipObj:
dir = "Modules/STL/"
zipObj.write("LICENSE")
# Iterate over all the files in directory
for folderName, subfolders, filenames in os.walk("docs/"):
for filename in filenames:
if filename != "CNAME":
#create complete filepath of file in directory
filePath = os.path.join(folderName, filename)
# Add file to zip
zipObj.write(filePath, filePath)
for folderName, subfolders, filenames in os.walk(dir):
for filename in filenames:
#create complete filepath of file in directory
filePath = os.path.join(folderName, filename)
safename = filePath.replace(dir, "")
# Add file to zip
zipObj.write(filePath, safename)
# Formicaria
with ZipFile(EXPORT + "formicaria.zip", 'w') as zipObj:
dir = "Formicaria/STL/"
zipObj.write("LICENSE")
# Iterate over all the files in directory
for folderName, subfolders, filenames in os.walk("docs/"):
for filename in filenames:
if filename != "CNAME":
#create complete filepath of file in directory
filePath = os.path.join(folderName, filename)
# Add file to zip
zipObj.write(filePath, filePath)
for folderName, subfolders, filenames in os.walk(dir):
for filename in filenames:
#create complete filepath of file in directory
filePath = os.path.join(folderName, filename)
safename = filePath.replace(dir, "")
# Add file to zip
zipObj.write(filePath, safename)
for folderName, subfolders, filenames in os.walk("Formicaria/Inserts/"):
for filename in filenames:
#create complete filepath of file in directory
filePath = os.path.join(folderName, filename)
safename = filePath.replace("Formicaria/", "")
# Add file to zip
zipObj.write(filePath, safename)