-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcreate_package.py
More file actions
executable file
·58 lines (42 loc) · 1.13 KB
/
create_package.py
File metadata and controls
executable file
·58 lines (42 loc) · 1.13 KB
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
#!/usr/bin/env python3.4
import os
import settings
import fs
import tarfile
import sys
def main():
print("Package Creator")
print("Brett Mayson - 1.0 - Dec 2015")
try:
path = sys.argv[1]
except:
path = input("Path to plugin: ")
#expand short file paths
fs.expand_path(path)
print("Path:",path)
#get info from ini file
if os.path.exists(path+"/info.ini"):
l = settings.Settings(path+"/info.ini")
print(l.get("info","name"))
else:
print("No Info.ini")
return
tar = tarfile.open(l.get("info","name").lower()+".tar.gz","w:gz")
os.chdir(path)
tar.add("info.ini")
#check for tts modules
if l.has_section("tts"):
tar.add("tts")
#check for stt modules
if l.has_section("stt"):
tar.add("stt")
#check for services
if l.has_section("services"):
tar.add("services")
if os.path.exists("bin"):
tar.add("bin")
if os.path.exists("actions"):
tar.add("actions")
tar.close()
if __name__ == "__main__":
main()