forked from UltimaPHP/UltimaPHP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RemovingAllCS.py
33 lines (26 loc) · 963 Bytes
/
RemovingAllCS.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, sys
'''
Fiz essa fun??o para remover todos os arquivos .cs da pasta do RunUO depois da convers?o
'''
def RemoveFiles(subDir=None):
extensions = ['cs']
root = 'C:\\runuo-master2\\Scripts'
runUOdir = "C:\\runuo-master\\Scripts"
listFilesPath = []
if sys.argv[1].lower() == "items":
root += "\\Items"
listDir = os.listdir(runUOdir)
elif sys.argv[1].lower() == "mobiles":
root += "\\Mobiles"
listDir = os.listdir(runUOdir)
else:
listDir = os.listdir(sys.argv[1])
walk_gen = os.walk(root)
for root,dirs,files in walk_gen:
for cur_file in files:
if cur_file.endswith('cs'):
os.remove(os.path.join(root,cur_file))
if __name__ == "__main__":
if sys.argv == None:
print("Digite items ou mobiles ex: RunUOtoUltimaPHP.py items \n Com isso ja vai exportar todos os scripts.")
RemoveFiles()