Browse Source

Refactoring

tags/3.4.1.3
Mike Khiretskiy 6 years ago
parent
commit
20d09bbabf
7 changed files with 16 additions and 11 deletions
  1. +2
    -1
      pym/update/emerge_parser.py
  2. +2
    -1
      pym/update/update.py
  3. +1
    -1
      pym/update/utils/cl_setup_update.py
  4. +2
    -1
      pym/update/utils/cl_update.py
  5. +1
    -1
      pym/update/utils/cl_update_profile.py
  6. +7
    -5
      pym/update/variables/update.py
  7. +1
    -1
      pym/update/wsdl_update.py

+ 2
- 1
pym/update/emerge_parser.py View File

@@ -23,9 +23,10 @@ import re
import sys
from calculate.lib.utils.colortext.palette import TextState
from calculate.lib.utils.tools import ignore
from calculate.lib.utils.git import Git, GitError
from calculate.lib.utils.portage import (EmergePackage, PackageList,
EmergeUpdateInfo,
EmergeRemoveInfo, Git, GitError)
EmergeRemoveInfo)

Colors = TextState.Colors
import pexpect


+ 2
- 1
pym/update/update.py View File

@@ -38,7 +38,8 @@ import shutil
from collections import MutableSet
from update_tasks import EmergeMark

from calculate.lib.utils.portage import (Git, Layman, EmergeLog, GitError,
from calculate.lib.utils.git import Git, GitError
from calculate.lib.utils.portage import (Layman, EmergeLog,
EmergeLogNamedTask, PackageList,
PackageInformation,
get_packages_files_directory,


+ 1
- 1
pym/update/utils/cl_setup_update.py View File

@@ -19,7 +19,7 @@ from calculate.core.server.func import Action
from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate
from calculate.lib.utils.files import FilesError
from calculate.update.update import UpdateError
from calculate.lib.utils.portage import GitError
from calculate.lib.utils.git import GitError

_ = lambda x: x
setLocalTranslate('cl_update3', sys.modules[__name__])


+ 2
- 1
pym/update/utils/cl_update.py View File

@@ -21,7 +21,8 @@ from calculate.lib.cl_template import TemplatesError
from calculate.lib.utils.files import FilesError
from calculate.update.update import UpdateError
from calculate.update.emerge_parser import EmergeError
from calculate.lib.utils.portage import (GitError, EmergeLog,
from calculate.lib.utils.git import GitError
from calculate.lib.utils.portage import (EmergeLog,
EmergeLogNamedTask, PackageList)
from calculate.update.update_tasks import EmergeMark



+ 1
- 1
pym/update/utils/cl_update_profile.py View File

@@ -20,7 +20,7 @@ from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate
from calculate.lib.cl_template import TemplatesError
from calculate.lib.utils.files import FilesError
from calculate.update.update import UpdateError
from calculate.lib.utils.portage import GitError
from calculate.lib.utils.git import GitError

_ = lambda x: x
setLocalTranslate('cl_update3', sys.modules[__name__])


+ 7
- 5
pym/update/variables/update.py View File

@@ -21,13 +21,15 @@ from os import path
from calculate.lib.datavars import (Variable, VariableError,
ReadonlyVariable, ReadonlyTableVariable,
TableVariable, FieldValue,
HumanReadable,
SimpleDataVars, DataVarsError)
from calculate.lib.utils.files import readFile, listDirectory, process, pathJoin

from calculate.lib.configparser import ConfigParser
from calculate.lib.cl_lang import setLocalTranslate
from calculate.lib.utils.text import simplify_profiles
from calculate.lib.utils.portage import Git, GitError, Layman
from calculate.lib.utils.git import Git, GitError
from calculate.lib.utils.portage import Layman
from ..profile import (RepositoryStorageSet, DEFAULT_BRANCH,
LocalStorage, ProfileRepository, CacheStorage)

@@ -306,7 +308,7 @@ class VariableClUpdateBinhostData(ReadonlyTableVariable):
pass
return "", -1

def get(self, hr=False):
def get(self, hr=HumanReadable.No):
binhost = self.Get('cl_update_binhost')
recheck = self.GetBool('cl_update_binhost_recheck_set')

@@ -551,7 +553,7 @@ class VariableClUpdateOtherRepData(ReadonlyTableVariable):
if rname in layman_overlays and rname not in repNames:
yield (rname, rpath)

def get(self, hr=False):
def get(self, hr=HumanReadable.No):
return list(self.generator())

class VariableClUpdateOtherRepName(FieldValue,ReadonlyVariable):
@@ -714,7 +716,7 @@ class VariableClUpdateProfileDependData(ReadonlyTableVariable):
return False


def get(self, hr=False):
def get(self, hr=HumanReadable.No):
dv = self.Get(self.datavars)
# TODO: неиспользуемая переменная возможно
# испольуется для инициализации
@@ -992,7 +994,7 @@ class VariableClProfileData(ReadonlyTableVariable):
arch = self.Get('os_arch_machine_gentoo')
return [x for x in profiles if x.arch == arch]

def get(self, hr=False):
def get(self, hr=HumanReadable.No):
rep = self.Get(self.repository)
if not rep:
return [[]]


+ 1
- 1
pym/update/wsdl_update.py View File

@@ -21,7 +21,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 calculate.lib.utils.portage import GitError
from calculate.lib.utils.git import GitError
from utils.cl_update import ClUpdateAction
from utils.cl_update_profile import ClUpdateProfileAction
from utils.cl_setup_update import ClSetupUpdateAction


Loading…
Cancel
Save