py3_forced 3.7.0
idziubenko 3 years ago
parent beed790b61
commit 659f1d1920

@ -21,7 +21,7 @@ import shutil
from calculate.lib.utils.files import (listDirectory, readFile, readLinesFile, from calculate.lib.utils.files import (listDirectory, readFile, readLinesFile,
makeDirectory, removeDir) makeDirectory, removeDir)
from calculate.lib.utils.git import Git from calculate.lib.utils.git import Git
from update import UpdateError from .update import UpdateError
from calculate.lib.cl_lang import setLocalTranslate, _ from calculate.lib.cl_lang import setLocalTranslate, _
setLocalTranslate('cl_update3', sys.modules[__name__]) setLocalTranslate('cl_update3', sys.modules[__name__])
@ -209,7 +209,7 @@ class ProfileRepository(object):
if git.is_private_url(url): if git.is_private_url(url):
try: try:
makeDirectory(rpath) makeDirectory(rpath)
os.chmod(rpath, 0700) os.chmod(rpath, 0o700)
except OSError: except OSError:
pass pass
git.cloneRepository(url, rpath, branch) git.cloneRepository(url, rpath, branch)

@ -29,9 +29,9 @@ from calculate.lib.datavars import DataVarsError, VariableError, Variable
from calculate.lib.utils.tools import AddonError from calculate.lib.utils.tools import AddonError
from calculate.lib.utils.colortext.palette import TextState from calculate.lib.utils.colortext.palette import TextState
from calculate.lib.utils.colortext import get_color_print from calculate.lib.utils.colortext import get_color_print
from calculate.update.emerge_parser import RevdepPercentBlock from .emerge_parser import RevdepPercentBlock
from calculate.update.datavars import DataVarsUpdate from .datavars import DataVarsUpdate
from calculate.update.update_info import UpdateInfo from .update_info import UpdateInfo
from calculate.lib.utils.binhosts import (Binhosts, BinhostSignError, from calculate.lib.utils.binhosts import (Binhosts, BinhostSignError,
BinhostError, PackagesIndex, DAYS) BinhostError, PackagesIndex, DAYS)
from calculate.lib.utils.gpg import GPG, GPGError from calculate.lib.utils.gpg import GPG, GPGError
@ -65,9 +65,9 @@ from calculate.lib.utils.files import (getProgPath, STDOUT, removeDir,
readFile, listDirectory, pathJoin, readFile, listDirectory, pathJoin,
find, FindFileType,quite_unlink, find, FindFileType,quite_unlink,
writeFile, makeDirectory) writeFile, makeDirectory)
import emerge_parser from . import emerge_parser
import logging import logging
from emerge_parser import (EmergeParser, EmergeCommand, EmergeError, from .emerge_parser import (EmergeParser, EmergeCommand, EmergeError,
EmergeCache, Chroot) EmergeCache, Chroot)
from calculate.lib.cl_lang import (setLocalTranslate, getLazyLocalTranslate, from calculate.lib.cl_lang import (setLocalTranslate, getLazyLocalTranslate,
@ -177,19 +177,19 @@ class Update(MethodsInterface):
try: try:
if not path.exists(rpath): if not path.exists(rpath):
makeDirectory(rpath) makeDirectory(rpath)
os.chmod(rpath, 0700) os.chmod(rpath, 0o700)
yield yield
finally: finally:
try: try:
for dn in (Git._gitDir(rpath), path.join(rpath, "profiles/templates")): for dn in (Git._gitDir(rpath), path.join(rpath, "profiles/templates")):
if path.exists(dn): if path.exists(dn):
os.chmod(dn, 0700) os.chmod(dn, 0o700)
for fn in find(path.join(rpath, "profiles"), True, FindFileType.RegularFile, for fn in find(path.join(rpath, "profiles"), True, FindFileType.RegularFile,
True, None, downfilter=lambda x: not x.endswith("/templates")): True, None, downfilter=lambda x: not x.endswith("/templates")):
if fn.endswith("calculate.env") or fn.endswith("ini.env"): if fn.endswith("calculate.env") or fn.endswith("ini.env"):
os.chmod(fn, 0600) os.chmod(fn, 0o600)
if path.exists(rpath): if path.exists(rpath):
os.chmod(rpath, 0755) os.chmod(rpath, 0o755)
except OSError: except OSError:
pass pass
else: else:

@ -16,7 +16,6 @@
import os import os
from os import path from os import path
from itertools import ifilter
from calculate.core.datavars import DataVarsCore from calculate.core.datavars import DataVarsCore
from calculate.core.server.gen_pid import search_worked_process from calculate.core.server.gen_pid import search_worked_process
from calculate.lib.cl_template import SystemIni from calculate.lib.cl_template import SystemIni
@ -71,7 +70,7 @@ class UpdateInfo(object):
""" """
Проверить есть ли уже запущенная копия console-gui Проверить есть ли уже запущенная копия 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): def update_already_run(self):
""" """

@ -14,7 +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.
import action from . import action
import update from . import update
section = "update" section = "update"

@ -42,7 +42,7 @@ from calculate.lib.variables import env
from calculate.lib.variables import system as lib_system from calculate.lib.variables import system as lib_system
from calculate.update.update_info import UpdateInfo from calculate.update.update_info import UpdateInfo
from itertools import chain from itertools import chain
from urlparse import urlparse from urllib.parse import urlparse
import io import io
import time import time

@ -20,7 +20,7 @@ from calculate.lib.datavars import VariableError,DataVarsError
from calculate.core.server.func import WsdlBase from calculate.core.server.func import WsdlBase
from calculate.install.install import InstallError 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 calculate.lib.utils.git import GitError
from utils.cl_update import ClUpdateAction from utils.cl_update import ClUpdateAction
from utils.cl_update_profile import ClUpdateProfileAction from utils.cl_update_profile import ClUpdateProfileAction

Loading…
Cancel
Save