-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtool_manager.py
50 lines (40 loc) · 1.37 KB
/
tool_manager.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
# coding=utf-8
import os
import sys
from time import sleep
from core import ClarityTool, ClarityToolsCollection
class UpdateTool(ClarityTool):
TITLE = "Update Clarity-Tool"
DESCRIPTION = "Update Clarity-Tool"
def __init__(self):
super(UpdateTool, self).__init__([
('Update', self.update)
], installable=False, runnable=False)
def update(self):
print("Clarity-Tool started to update..\n")
sleep(1)
os.system("rd /s /q clarity-tool")
os.system("git clone https://github.com/alextoutcourt72/clarity-tool.git")
print("\nClarity-Tool successfully updated... Goodbye.")
sys.exit()
class UninstallTool(ClarityTool):
TITLE = "Uninstall Clarity-Tool"
DESCRIPTION = "Uninstall Clarity-Tool"
def __init__(self):
super(UninstallTool, self).__init__([
('Uninstall', self.uninstall)
], installable=False, runnable=False)
def uninstall(self):
print("Clarity-Tool started to uninstall..\n")
sleep(1)
os.system("rd /s /q C:\\Clarity-Tool")
print("\nClarity-Tool successfully uninstalled... Goodbye.")
sys.exit()
class ToolManager(ClarityToolsCollection):
TITLE = "Uninstall or Update | Clarity-Tool"
TOOLS = [
UninstallTool(),
UpdateTool()
]
if __name__ == "__main__":
ToolManager().show_options()