-
Notifications
You must be signed in to change notification settings - Fork 0
/
___init___.py
145 lines (130 loc) · 5.39 KB
/
___init___.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
from Load import Load
import Test
import time
import os
import gc
class ___init___:
def ___init___():
return True
def init_Start():
Load.load_Title()
responce = Load.__init__()
gc.collect()
return responce
def init_Load_Pro():
gc.collect()
return Load.load_Project()
#try:
code,msg = ___init___.init_Start()
#print (code)
#print (msg)
path = Load.load_Path()+"Sudarshana"
if code == "1" and not os.getcwd() == path:
Load.load_Pro_Pros()
print (msg)
Load.load_FileDir()
ROOT,D_NAME,F_NAME = ___init___.init_Load_Pro()
count = 0
if D_NAME != []:
for directory in D_NAME:
count += 1
print (str(count)+".) "+directory)
if F_NAME != []:
for file in F_NAME:
count += 1
print (str(count)+".) "+file)
while True:
#code,msg = ___init___.init_Start()
#Load.load_FileDir()
cpath=Load.load_Project()
print (cpath[0])
Choise = input("What Do You Want To Do? ").upper()
if Choise == 'E' or Choise == 'EXIT':
break
elif Choise == 'B' or Choise == 'Back':
Choise = 'B'
BASE = Load.load_Path_Match(ROOT)
CWD = os.getcwd()
CWD = Load.load_Path_Match(CWD)
if BASE < CWD:
os.chdir("..")
NEW_ROOT,D_NAME,F_NAME = Load.load_CWD(os.getcwd())
Load.load_List_FileDir(D_NAME,F_NAME)
else:
print ("You Alredy On Your Project Root.")
elif Choise == 'L' or Choise == 'LIST':
Choise = 'L'
Load.load_FileDir()
CWD = os.getcwd()
NEW_ROOT,D_NAME,F_NAME = Load.load_CWD(CWD)
Load.load_List_FileDir(D_NAME,F_NAME)
elif Choise == 'A' or Choise == 'ALL':
Choise = 'A'
Load.under_Maintenance()
FULL_PATH = os.getcwd()
conf = input("You Select "+FULL_PATH+"? (Y/n)").upper()
if conf == "Y" or conf == "YES" or conf == "":
if os.path.isdir(FULL_PATH):
#try:
NEW_ROOT,D_NAME,F_NAME = Load.load_CWD(os.getcwd())
#Load.load_List_FileDir(D_NAME,F_NAME)
#FileDir = os.getcwd()+"\\"+F_NAME
#if os.path.exists(FileDir):
if F_NAME != []:
print ("entrr")
for file in F_NAME:
if file.lower().endswith(".php"):
FileDir = os.getcwd()+"\\"+file
print (FileDir)
Test.Analysis.file_Analysis(FileDir)
else:
print ("[ |------------------------------------------------------| ]")
print ("[ | No file detected in this working Directory. | ]")
print ("[ | Using 'MANUAL' option chnage working directory. | ]")
print ("[ |------------------------------------------------------| ]")
#
'''except:
print ("No")
Load.load_Warning()'''
elif os.path.isfile(FULL_PATH):
print (FULL_PATH,"is a file.")
elif Choise == 'M' or Choise == 'MANUAL':
Choise = 'M'
FileDir = input("Eneter File or Drectory Name: ").replace("\\",'')
FULL_PATH = os.getcwd()+"\\"+FileDir
conf = input("You Select "+FileDir+"? (Y/n)").upper()
if conf == "Y" or conf == "YES" or conf == "":
print (FileDir)
print (FULL_PATH+"\\"+FileDir)
if os.path.isdir(FULL_PATH):
try:
os.chdir(FULL_PATH)
Load.load_FileDir()
NEW_ROOT,D_NAME,F_NAME = Load.load_CWD(os.getcwd())
Load.load_List_FileDir(D_NAME,F_NAME)
except:
Load.load_Warning()
elif os.path.isfile(FULL_PATH):
if FULL_PATH.lower().endswith(".php"):
print (FileDir,"is a file.")
#Read = Load.load_FileRead(FileDir)
#print (Read)
#Read = Test.Analysis.load_FileRead(FileDir)
Test.Analysis.file_Analysis(FileDir)
#command = "start cmd /K echo "+Read
#os.system(command)
time.sleep(2)
Load.load_FileDir()
NEW_ROOT,D_NAME,F_NAME = Load.load_CWD(os.getcwd())
Load.load_List_FileDir(D_NAME,F_NAME)
else:
print ("This tool accept '.PHP' file only.")
else:
Load.load_Warning()
else:
Load.load_Warning()
else:
Load.load_Pro_Pros()
print (msg)
'''except:
Load.load_Warning()'''