-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.py
89 lines (62 loc) · 1.64 KB
/
make.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
from abc import ABC, abstractmethod
from subprocess import call
from platform import system
from os import chdir, mkdir
from sys import argv
# This value is mandatory since there will be the path where the program will
# be installed.
INSTALL_DIR = ""
class OsUtil(ABC):
def __init__(self):
super().__init__()
@abstractmethod
def clean(self):
pass
@abstractmethod
def build(self):
pass
@abstractmethod
def install(self):
pass
@abstractmethod
def _clear_console(self):
pass
class LinuxUtils(OsUtil):
def __init__(self):
super().__init__()
def build(self):
pass
def clean(self):
call(["rm", "-r", "src/__pycache__"])
call(["rm", "-r", "src/build"])
call(["rm", "-r", "src/dist"])
call(["rm", "-r", "src/__main__.spec"])
def install(self):
pass
def _clear_console(self):
call(["clear"])
class WindowsUtils(OsUtil):
def __init__():
super().__init__()
def build(self):
pass
def clean(self):
pass
def install(self):
pass
def _clear_console(self):
call(["cls"])
def main():
os_helper: OsUtil = None
if system() == "Linux":
os_helper = LinuxUtils()
elif system() == "Windows":
os_helper = WindowsUtils()
else:
print("Your system is not supported :(\n")
print("Please help us to support users with the same system")
print("Any help is welcome :)")
if os_helper is not None:
print("You system has been checked")
if __name__ == '__main__':
main()