diff --git a/pym/install/distr.py b/pym/install/distr.py index 25d7172..2e1fd53 100644 --- a/pym/install/distr.py +++ b/pym/install/distr.py @@ -47,6 +47,7 @@ from calculate.lib.utils.text import _u8 from calculate.lib.variables.linux import LinuxDataVars, Linux from calculate.lib.cl_lang import setLocalTranslate, _ +from functools import reduce setLocalTranslate('cl_install3', sys.modules[__name__]) @@ -319,10 +320,10 @@ class Distributive(object): return False os.mkdir(pathname) return True - except Exception, e: + except Exception as e: raise DistributiveError(_("Failed to create the directory") + " '%s':\n%s" % (pathname, str(e))) - except KeyboardInterrupt, e: + except KeyboardInterrupt as e: raise DistributiveError(_("Failed to create the directory") + " '%s':\n%s" % (pathname, str(e))) @@ -356,10 +357,10 @@ class Distributive(object): def _copytree(self, indir, outdir): try: copytree(indir, outdir, symlinks=True) - except Exception, e: + except Exception as e: raise DistributiveError(_("Failed to copy") + " '%s' to '%s':\n%s" \ % (indir, outdir, str(e))) - except KeyboardInterrupt, e: + except KeyboardInterrupt as e: raise DistributiveError(_("Failed to copy") + " '%s' to '%s':\n%s" \ % (indir, outdir, str(e))) @@ -399,7 +400,7 @@ class Distributive(object): path.join(todir, copyfile)): if callbackProgress: callbackProgress(recountPerc(perc, i)) - except Exception, e: + except Exception as e: res = False errmes = str(e) if not res: diff --git a/pym/install/install.py b/pym/install/install.py index 4d9a0fe..a4a83c1 100644 --- a/pym/install/install.py +++ b/pym/install/install.py @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import absolute_import import os import re import sys @@ -37,9 +38,9 @@ import calculate.lib.utils.device as device from calculate.lib.utils.device import (detectDeviceForPartition, countPartitions) 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 itertools import * from calculate.lib.utils.tools import traverse @@ -49,7 +50,7 @@ class InstallError(Exception): """Installation Error""" -from migrate_users import migrate +from .migrate_users import migrate from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate, _ @@ -508,7 +509,7 @@ class Install(MethodsInterface): # если package.mask является файлом - делаем его директорией if path.isfile(mask_file): 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")) current_nvidia_mask = readFile(nvidia_mask_file).strip() new_nvidia_mask = self.clVars.Get('os_nvidia_mask') diff --git a/pym/install/migrate_users.py b/pym/install/migrate_users.py index 6bf24ef..4796836 100644 --- a/pym/install/migrate_users.py +++ b/pym/install/migrate_users.py @@ -20,6 +20,7 @@ from os import path from calculate.lib.utils.files import pathJoin, FilePermission from calculate.lib.cl_lang import setLocalTranslate, _ +from functools import reduce setLocalTranslate('cl_install3', sys.modules[__name__]) diff --git a/pym/install/variables/__init__.py b/pym/install/variables/__init__.py index a2a8abe..ea5023d 100644 --- a/pym/install/variables/__init__.py +++ b/pym/install/variables/__init__.py @@ -14,17 +14,34 @@ # See the License for the specific language governing permissions and # limitations under the License. -import action -import disk -import locale -import linux -import distr -import kernel -import net -import system -import X11 -import lvm -import autopartition -import audio +from __future__ import absolute_import +#-*- coding: utf-8 -*- + +# Copyright 2008-2016 Mir Calculate. http://www.calculate-linux.org +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# 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" diff --git a/pym/install/variables/distr.py b/pym/install/variables/distr.py index 26abb43..1e7e5dc 100644 --- a/pym/install/variables/distr.py +++ b/pym/install/variables/distr.py @@ -34,6 +34,7 @@ from calculate.install.distr import (Distributive, PartitionDistributive, from calculate.lib.cl_lang import setLocalTranslate, _ from calculate.install.fs_manager import FileSystemManager +from functools import reduce setLocalTranslate('cl_install3', sys.modules[__name__]) diff --git a/pym/install/wsdl_install.py b/pym/install/wsdl_install.py index 6687985..55e4ff7 100644 --- a/pym/install/wsdl_install.py +++ b/pym/install/wsdl_install.py @@ -14,12 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import absolute_import import sys from calculate.lib.datavars import VariableError, DataVarsError from calculate.install.distr import DistributiveError -import install +from . import install from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate, _ setLocalTranslate('cl_install3', sys.modules[__name__])