-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·91 lines (69 loc) · 1.83 KB
/
setup.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
import os
import sys
ver3 = 'version-3'
ver2 = 'version-2'
ver = 'version-default'
uninstall = 'uninstall'
install = 'install'
args = sys.argv
status = 'status'
manual = 'manual'
### Install
def Install(ver2, ver3):
if args[2] == ver2:
print('python2 setup')
os.system('~/PyBox/setup/install version-2')
print('\n ### Done ### \n')
sys.exit()
elif args[2] == ver3:
print('python3 setup')
os.system('~/PyBox/setup/install version-3')
print('\n ### Done ### \n')
sys.exit()
elif args[2] == ver:
print('python setup')
os.system('~/PyBox/setup/install version-default')
print('\n ### Done ### \n')
sys.exit()
else:
Manual()
print(" ")
print("###### Not found " + str(args[2]) + " options ######")
sys.exit()
### Uninstall
def Uninstall():
os.system('~/PyBox/setup/uninstall')
#print('\n ### complete ### \n')
sys.exit()
### what venv using version of python
def Status():
isthere3 = os.path.isfile("~/PyBox/pyboxenv/bin/python3")
isthere2 = os.path.isfile("~/PyBox/pyboxenv/bin/python2")
if isthere3 == True:
print("python3")
elif isthere2 == True:
print("python2")
else:
print("")
print("Please wait a update")
def Manual():
#cwd = os.getcwd()
cwd = os.path.expanduser("~/PyBox")
f = open('{}/manual.txt'.format(cwd), 'r', encoding='UTF-8')
words = f.read() ##feature/Update-2
print(words)
f.close()
try:
if str(args[1]) == install:
Install(ver2, ver3)
elif str(args[1]) == uninstall:
Uninstall()
elif str(args[1]) == status:
Status()
elif str(args[1]) == manual:
Manual()
else:
Manual()
except KeyboardInterrupt:
print('stop')
sys.exit()