py3_forced 3.7.0
idziubenko 3 years ago
parent d8c14903e9
commit 409534d108

@ -47,6 +47,7 @@ from calculate.lib.utils.text import _u8
from calculate.lib.variables.linux import LinuxDataVars, Linux from calculate.lib.variables.linux import LinuxDataVars, Linux
from calculate.lib.cl_lang import setLocalTranslate, _ from calculate.lib.cl_lang import setLocalTranslate, _
from functools import reduce
setLocalTranslate('cl_install3', sys.modules[__name__]) setLocalTranslate('cl_install3', sys.modules[__name__])
@ -319,10 +320,10 @@ class Distributive(object):
return False return False
os.mkdir(pathname) os.mkdir(pathname)
return True return True
except Exception, e: except Exception as e:
raise DistributiveError(_("Failed to create the directory") + raise DistributiveError(_("Failed to create the directory") +
" '%s':\n%s" % (pathname, str(e))) " '%s':\n%s" % (pathname, str(e)))
except KeyboardInterrupt, e: except KeyboardInterrupt as e:
raise DistributiveError(_("Failed to create the directory") + raise DistributiveError(_("Failed to create the directory") +
" '%s':\n%s" % (pathname, str(e))) " '%s':\n%s" % (pathname, str(e)))
@ -356,10 +357,10 @@ class Distributive(object):
def _copytree(self, indir, outdir): def _copytree(self, indir, outdir):
try: try:
copytree(indir, outdir, symlinks=True) copytree(indir, outdir, symlinks=True)
except Exception, e: except Exception as e:
raise DistributiveError(_("Failed to copy") + " '%s' to '%s':\n%s" \ raise DistributiveError(_("Failed to copy") + " '%s' to '%s':\n%s" \
% (indir, outdir, str(e))) % (indir, outdir, str(e)))
except KeyboardInterrupt, e: except KeyboardInterrupt as e:
raise DistributiveError(_("Failed to copy") + " '%s' to '%s':\n%s" \ raise DistributiveError(_("Failed to copy") + " '%s' to '%s':\n%s" \
% (indir, outdir, str(e))) % (indir, outdir, str(e)))
@ -399,7 +400,7 @@ class Distributive(object):
path.join(todir, copyfile)): path.join(todir, copyfile)):
if callbackProgress: if callbackProgress:
callbackProgress(recountPerc(perc, i)) callbackProgress(recountPerc(perc, i))
except Exception, e: except Exception as e:
res = False res = False
errmes = str(e) errmes = str(e)
if not res: if not res:

@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import absolute_import
import os import os
import re import re
import sys import sys
@ -37,9 +38,9 @@ import calculate.lib.utils.device as device
from calculate.lib.utils.device import (detectDeviceForPartition, from calculate.lib.utils.device import (detectDeviceForPartition,
countPartitions) countPartitions)
from calculate.lib.utils.partition import DiskFactory from calculate.lib.utils.partition import DiskFactory
from datavars import DataVarsInstall from .datavars import DataVarsInstall
from distr import DistributiveError, PartitionDistributive from .distr import DistributiveError, PartitionDistributive
from subprocess import Popen, PIPE, STDOUT from subprocess import Popen, PIPE, STDOUT
from itertools import * from itertools import *
from calculate.lib.utils.tools import traverse from calculate.lib.utils.tools import traverse
@ -49,7 +50,7 @@ class InstallError(Exception):
"""Installation Error""" """Installation Error"""
from migrate_users import migrate from .migrate_users import migrate
from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate, _ from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate, _
@ -508,7 +509,7 @@ class Install(MethodsInterface):
# если package.mask является файлом - делаем его директорией # если package.mask является файлом - делаем его директорией
if path.isfile(mask_file): if path.isfile(mask_file):
os.rename(mask_file, mask_file + "2") os.rename(mask_file, mask_file + "2")
os.mkdir(mask_file, mode=0755) os.mkdir(mask_file, mode=0o755)
os.rename(mask_file + "2", path.join(mask_file, "default")) os.rename(mask_file + "2", path.join(mask_file, "default"))
current_nvidia_mask = readFile(nvidia_mask_file).strip() current_nvidia_mask = readFile(nvidia_mask_file).strip()
new_nvidia_mask = self.clVars.Get('os_nvidia_mask') new_nvidia_mask = self.clVars.Get('os_nvidia_mask')

@ -20,6 +20,7 @@ from os import path
from calculate.lib.utils.files import pathJoin, FilePermission from calculate.lib.utils.files import pathJoin, FilePermission
from calculate.lib.cl_lang import setLocalTranslate, _ from calculate.lib.cl_lang import setLocalTranslate, _
from functools import reduce
setLocalTranslate('cl_install3', sys.modules[__name__]) setLocalTranslate('cl_install3', sys.modules[__name__])

@ -14,17 +14,34 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import action from __future__ import absolute_import
import disk #-*- coding: utf-8 -*-
import locale
import linux # Copyright 2008-2016 Mir Calculate. http://www.calculate-linux.org
import distr #
import kernel # Licensed under the Apache License, Version 2.0 (the "License");
import net # you may not use this file except in compliance with the License.
import system # You may obtain a copy of the License at
import X11 #
import lvm # http://www.apache.org/licenses/LICENSE-2.0
import autopartition #
import audio # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from . import action
from . import disk
from . import locale
from . import linux
from . import distr
from . import kernel
from . import net
from . import system
from . import X11
from . import lvm
from . import autopartition
from . import audio
section = "install" section = "install"

@ -34,6 +34,7 @@ from calculate.install.distr import (Distributive, PartitionDistributive,
from calculate.lib.cl_lang import setLocalTranslate, _ from calculate.lib.cl_lang import setLocalTranslate, _
from calculate.install.fs_manager import FileSystemManager from calculate.install.fs_manager import FileSystemManager
from functools import reduce
setLocalTranslate('cl_install3', sys.modules[__name__]) setLocalTranslate('cl_install3', sys.modules[__name__])

@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import absolute_import
import sys import sys
from calculate.lib.datavars import VariableError, DataVarsError from calculate.lib.datavars import VariableError, DataVarsError
from calculate.install.distr import DistributiveError from calculate.install.distr import DistributiveError
import install from . import install
from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate, _ from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate, _
setLocalTranslate('cl_install3', sys.modules[__name__]) setLocalTranslate('cl_install3', sys.modules[__name__])

Loading…
Cancel
Save