diff --git a/pym/update/profile.py b/pym/update/profile.py index 11017eb..b0f028f 100644 --- a/pym/update/profile.py +++ b/pym/update/profile.py @@ -21,7 +21,7 @@ import shutil from calculate.lib.utils.files import (listDirectory, readFile, readLinesFile, makeDirectory, removeDir) from calculate.lib.utils.git import Git -from update import UpdateError +from .update import UpdateError from calculate.lib.cl_lang import setLocalTranslate, _ setLocalTranslate('cl_update3', sys.modules[__name__]) @@ -209,7 +209,7 @@ class ProfileRepository(object): if git.is_private_url(url): try: makeDirectory(rpath) - os.chmod(rpath, 0700) + os.chmod(rpath, 0o700) except OSError: pass git.cloneRepository(url, rpath, branch) diff --git a/pym/update/update.py b/pym/update/update.py index f9f930d..3f474d4 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -29,9 +29,9 @@ from calculate.lib.datavars import DataVarsError, VariableError, Variable from calculate.lib.utils.tools import AddonError from calculate.lib.utils.colortext.palette import TextState from calculate.lib.utils.colortext import get_color_print -from calculate.update.emerge_parser import RevdepPercentBlock -from calculate.update.datavars import DataVarsUpdate -from calculate.update.update_info import UpdateInfo +from .emerge_parser import RevdepPercentBlock +from .datavars import DataVarsUpdate +from .update_info import UpdateInfo from calculate.lib.utils.binhosts import (Binhosts, BinhostSignError, BinhostError, PackagesIndex, DAYS) from calculate.lib.utils.gpg import GPG, GPGError @@ -65,9 +65,9 @@ from calculate.lib.utils.files import (getProgPath, STDOUT, removeDir, readFile, listDirectory, pathJoin, find, FindFileType,quite_unlink, writeFile, makeDirectory) -import emerge_parser +from . import emerge_parser import logging -from emerge_parser import (EmergeParser, EmergeCommand, EmergeError, +from .emerge_parser import (EmergeParser, EmergeCommand, EmergeError, EmergeCache, Chroot) from calculate.lib.cl_lang import (setLocalTranslate, getLazyLocalTranslate, @@ -177,19 +177,19 @@ class Update(MethodsInterface): try: if not path.exists(rpath): makeDirectory(rpath) - os.chmod(rpath, 0700) + os.chmod(rpath, 0o700) yield finally: try: for dn in (Git._gitDir(rpath), path.join(rpath, "profiles/templates")): if path.exists(dn): - os.chmod(dn, 0700) + os.chmod(dn, 0o700) for fn in find(path.join(rpath, "profiles"), True, FindFileType.RegularFile, True, None, downfilter=lambda x: not x.endswith("/templates")): if fn.endswith("calculate.env") or fn.endswith("ini.env"): - os.chmod(fn, 0600) + os.chmod(fn, 0o600) if path.exists(rpath): - os.chmod(rpath, 0755) + os.chmod(rpath, 0o755) except OSError: pass else: diff --git a/pym/update/update_info.py b/pym/update/update_info.py index f0f5975..7b22157 100644 --- a/pym/update/update_info.py +++ b/pym/update/update_info.py @@ -16,7 +16,6 @@ import os from os import path -from itertools import ifilter from calculate.core.datavars import DataVarsCore from calculate.core.server.gen_pid import search_worked_process from calculate.lib.cl_template import SystemIni @@ -71,7 +70,7 @@ class UpdateInfo(object): """ Проверить есть ли уже запущенная копия console-gui """ - return any(ifilter(lambda x: "cl-console-gui" in x, getRunCommands())) + return any(filter(lambda x: "cl-console-gui" in x, getRunCommands())) def update_already_run(self): """ diff --git a/pym/update/variables/__init__.py b/pym/update/variables/__init__.py index 0581c8b..e074ab8 100644 --- a/pym/update/variables/__init__.py +++ b/pym/update/variables/__init__.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import action -import update +from . import action +from . import update section = "update" diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index 2f7ace8..41a3559 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -42,7 +42,7 @@ from calculate.lib.variables import env from calculate.lib.variables import system as lib_system from calculate.update.update_info import UpdateInfo from itertools import chain -from urlparse import urlparse +from urllib.parse import urlparse import io import time diff --git a/pym/update/wsdl_update.py b/pym/update/wsdl_update.py index e4280bb..e39dfa7 100644 --- a/pym/update/wsdl_update.py +++ b/pym/update/wsdl_update.py @@ -20,7 +20,7 @@ from calculate.lib.datavars import VariableError,DataVarsError from calculate.core.server.func import WsdlBase from calculate.install.install import InstallError -from calculate.update.update import Update, UpdateError +from .update import Update, UpdateError from calculate.lib.utils.git import GitError from utils.cl_update import ClUpdateAction from utils.cl_update_profile import ClUpdateProfileAction