-
Notifications
You must be signed in to change notification settings - Fork 0
/
.setup.aex
170 lines (141 loc) · 4.7 KB
/
.setup.aex
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# This is the setup file.
import sys
import os
#from necta.globalv import *
from necta.animations import *
from time import sleep
# These variables will be used regularly,
# So I decide to put them in the var.py
__TOOL__= "NECTA-TOOL"
__VERSION__= "1.0.0"
__YEAR__="©2022"
__DEVELOPER__= "Isack Nkolima"
__TWITTER__ = "https://twitter.com/isack_nkolima"
__GITHUB__= "https://github.com/MrNkolima"
__AVAILABLE__="Due to api dependance:: 2015 to 2022 ACSEE & CSEE results are available for this version"
#The colors used
__TOOL__= "NECTA-TOOL"
__BOLDRED__= "\033[01;31m"
__BOLDGREEN__= "\033[01;32m"
__BOLDBLUE__= "\033[01;34m"
__BOLDYELLOW__="\033[01;33m"
__BOLDCYAN__= "\033[01;36m"
__BOLDPURPLE__= "\033[01;35m"
__BACKBLUE__= "\033[44m"
__BACKPURPLE__= "\033[45m"
__BACKCYAN__= "\033[46m"
__RED__= "\033[0;31m"
__GREEN__= "\033[0;32m"
__BLUE__= "\033[0;34m"
__CYAN__= "\033[0;36m"
__YELLOW__= "\033[0;33m"
__PURPLE__= "\033[0;33m"
__RESET__="\033[00m"
# I love this piece of code very much!!,
# This helps me to diagnostically detect,
# And to assign the OS to variables so,
# That I can distinguish them in some,
# Critical situations.
if os.path.exists("/data/data/com.termux/files/usr/bin/pkg"):
#This deals with TERMUX Environment.
home=os.getenv("HOME")+"/"
pkg="pkg"
bd="/data/data/com.termux/files/usr/bin/"
# bd=> bin directory.
sd="/data/data/com.termux/files/usr/share/"
# sd=> share directory.
system="termux"
# System is Termux Environment.
# This deals with non Termux Environments,
# Like Linux and Ubuntu (Desktops)
elif os.path.exists("/usr/bin/apt") or os.path.exists("/usr/bin/apt-get") or os.path.exists("/bin/apt") or os.path.exists("/bin/apt"):
if os.path.exists("/usr/lib/sudo") or os.path.exists("/usr/bin/sudo") or os.path.exists("/usr/sbin/sudo"):
home=os.getenv("HOME")+"/"
pkg="sudo apt-get"
bd="/usr/bin/"
sd="/usr/share/"
system="ubuntu"
else:
home=os.getenv("HOME")+"/"
pkg="apt-get"
bd="/usr/bin/"
sd="/usr/share/"
system="debian"
class necta(object):
#while True:
def first(self):
# If the NECTA-TOOL files were present,
# removing them with an update.
if os.path.exists(bd+"necta") or os.path.exists(sd+"NECTA"):
if system=="ubuntu":
os.system("sudo rm -rf "+sd+"NECTA && rm -rf "+bd+"necta")
os.system("cd "+sd+" && sudo rm -rf NECTA")
else:
os.system("rm -rf "+sd+"NECTA && rm -rf "+bd+"necta")
os.system("cd "+sd+" && rm -rf NECTA")
def setup(self):
if system=="ubuntu":
#Install NECTA-TOOL in UBUNTU
# Creating NECTA directory in sd.
os.system("sudo mkdir "+sd+"NECTA")
# Moving necta/necta (bash file) to bd,
# Which enable client to use tool from any directory.
os.system("sudo mv necta/necta "+bd)
#Moving the NECTA-TOOL files to sd.
os.system("sudo mv necta necta-tool.py attach.py results.py README.md LICENSE "+sd+"NECTA-TOOL")
#Making the files executable
os.system("sudo chmod +x "+bd+"necta")
os.system("sudo chmod +x "+sd+"NECTA/necta/* ")
os.system("sudo chmod +x "+sd+"NECTA/* ")
# Removing the files after installation,
# From the home directory so as,
# To save space.
os.system("cd .. && sudo rm -rf NECTA-TOOL && "+pkg+" install bs4"+" && "+pkg+" install tabulate"+" && pip install nectaapi")
#A
#N
#I
#M
#A
#T
install()
#I
#O
#N
#If the system is not using Sudo.
else:
# Making NECTA directory in sd.
os.system("mkdir "+sd+"NECTA")
# Moving the necta (bash) to bd.
os.system("mv necta/necta "+bd)
# Moving the files to sd.
os.system("mv necta results.py attach.py necta-tool.py README.md LICENSE "+sd+"NECTA")
# Making files e x e c u t a b l e.
os.system("chmod +x "+bd+"necta")
os.system("chmod +x "+sd+"NECTA/*")
os.system("chmod +x "+sd+"NECTA/necta/*")
# Removing the NECTA-TOOL files,
# So as to save storage,
# Of the system.
os.system("cd .. && rm -rf NECTA-TOOL && "+pkg+" install bs4"+" && "+pkg+" install tabulate"+" && pip install nectaapi")
#A
#N
#I
#M
#A
#T
install()
#I
#O
#N
# The function for easily install
# I love this format.
def installing():
try:
necta().first()
necta().setup()
except KeyboardInterrupt:
sys.exit()
installing()
# necta().first() ==> Checks if the system has either of the names that can are used in this tool. By means of the client has once installed it wrongly. And delete them.
# necta().setup() ==> This settup the Tool.
#Oct 25, 2022.