-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocw.py
47 lines (32 loc) · 994 Bytes
/
docw.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
import sys
def getArgument(argument: str, default="") -> str:
for i in range(len(sys.argv)):
if sys.argv[i].startswith(argument):
try:
return sys.argv[i].split(":", 1)[1]
except:
return default
return default
def getArgumentAsBool(argument: str, default=False) -> bool:
for i in range(len(sys.argv)):
if sys.argv[i].startswith(argument):
try:
return bool(sys.argv[i].split(":", 1)[1])
except:
return default
return default
if sys.argv[1] == "core:run":
from core.doc import doc
this = doc(
username=getArgument(argument="username", default="USER"),
live_debug=getArgumentAsBool(argument="debug"),
guest=getArgumentAsBool("guest"),
dev=getArgumentAsBool("dev")
)
this.client()
# add here new clients
else:
print("""
Run client with:
python3 docw.py <client_name>:run <arguments>
""")