mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-18 03:01:01 +01:00
python 3
This commit is contained in:
@@ -266,7 +266,7 @@ class preFlightsChecks:
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
def checkPythonVersion(self):
|
def checkPythonVersion(self):
|
||||||
if sys.version_info[0] == 2 and sys.version_info[1] == 7:
|
if sys.version_info[0] == 3:
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
preFlightsChecks.stdOut("You are running Unsupported python version, please install python 2.7")
|
preFlightsChecks.stdOut("You are running Unsupported python version, please install python 2.7")
|
||||||
@@ -1918,7 +1918,6 @@ milter_default_action = accept
|
|||||||
|
|
||||||
return res # Though probably not used
|
return res # Though probably not used
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def setupVirtualEnv(distro):
|
def setupVirtualEnv(distro):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
@@ -1961,12 +1960,12 @@ milter_default_action = accept
|
|||||||
|
|
||||||
##
|
##
|
||||||
|
|
||||||
command = "pip install virtualenv"
|
#command = "pip3.6 install virtualenv"
|
||||||
preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR)
|
#preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
####
|
####
|
||||||
|
|
||||||
command = "virtualenv --system-site-packages /usr/local/CyberCP"
|
command = "python3.6 -m venv --system-site-packages /usr/local/CyberCP"
|
||||||
preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR)
|
preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
##
|
##
|
||||||
@@ -1992,10 +1991,13 @@ milter_default_action = accept
|
|||||||
preFlightsChecks.stdOut("Install updated " + install_file_new, 1)
|
preFlightsChecks.stdOut("Install updated " + install_file_new, 1)
|
||||||
install_file = install_file_new
|
install_file = install_file_new
|
||||||
|
|
||||||
command = "pip install --ignore-installed -r " + install_file
|
command = "pip3.6 install --ignore-installed -r " + install_file
|
||||||
preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR)
|
preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
command = "virtualenv --system-site-packages /usr/local/CyberCP"
|
command = "python3.6 -m venv /usr/local/CyberCP"
|
||||||
|
preFlightsChecks.call(command, distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
|
command = "ln -s /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/bin/python"
|
||||||
preFlightsChecks.call(command, distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
except OSError as msg:
|
except OSError as msg:
|
||||||
|
|||||||
Reference in New Issue
Block a user