websoft9/apps/create.py
2022-07-14 14:37:34 +08:00

28 lines
747 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python2
#!/usr/bin/env python3
#coding: utf-8
import os, io, sys, platform, shutil, urllib3, time, json
def ReadLists(filename):
if os.path.getsize(filename) == 0:
print("\n清单中没有项目!")
sys.exit()
else:
with open("./"+filename,mode='r',newline='') as f:
templists=list(f)
rlist=[]
for templist in templists:
rlist.append(templist.replace('\n',''))
return rlist
mylists=ReadLists("add")
# 批量处理创建项目文件夹issue
for mylist in mylists:
print("处理 "+mylist+" ...\n")
os.system("cp -R roles/Template roles/" + mylist)
os.system("echo '' > add")
print("\n执行完成,并清空列表")