forked from xpclove/autofp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease_core.py
33 lines (31 loc) · 886 Bytes
/
release_core.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
import os
import shutil
import sys
def release(option=["pyc"]):
arglen=len(sys.argv)
outdir="release"
if(os.path.exists("release")):
shutil.rmtree("release")
os.mkdir("release")
os.mkdir("release/auto")
infile=open("release.ini","r")
line=""
all_line=infile.readlines()
for line in all_line:
linec=line.strip('\n')
ss=linec.split("@");
if (ss[0] == "d"):
shutil.copytree(ss[1],outdir+"/"+ss[1])
continue
if (ss[0] == "f"):
shutil.copyfile(ss[1],outdir+"/"+ss[1])
continue
linepy=line.strip('\n')+".py"
line=linepy+"c"
print(line)
if("src" in option):
shutil.copyfile(linepy,"release/"+linepy)
shutil.copyfile(line, "release/"+line)
infile.close()
if __name__ == "__main__":
release()