Изменёно определение текущей версии python (через emerge)

legacy27 3.6.6.7
Mike Hiretsky 4 years ago
parent 7af74fd8ee
commit 8fe3f6ba1e

@ -22,7 +22,7 @@ from calculate.lib.datavars import (TableVariable, Variable, ReadonlyVariable,
VariableError, ReadonlyTableVariable,
FieldValue, HumanReadable)
from calculate.lib.utils.files import (listDirectory, process, PIPE, pathJoin,
readFileEx)
readFileEx)
from calculate.lib.utils.portage import (isPkgInstalled, RepositoryPath,
getInstalledAtom)
from calculate.lib.utils.common import cmpVersion
@ -821,6 +821,11 @@ class VariableOsPython(ReadonlyVariable):
def get(self):
chroot_path = self.get_root()
if chroot_path == "/":
p = process("/usr/bin/emerge","--version")
m = re.search("python (\d\.\d)", p.read())
if m:
return "python%s" % m.group(1)
pythons = readFileEx(pathJoin(chroot_path,
"/etc/python-exec/python-exec.conf"), grab=True).split()
if pythons:

Loading…
Cancel
Save