Browse Source

list compr, general improvements

tags/3.7.1
idziubenko 2 months ago
parent
commit
1f2b817d6e
4 changed files with 6 additions and 8 deletions
  1. +1
    -1
      pym/update/profile.py
  2. +2
    -3
      pym/update/update.py
  3. +1
    -1
      pym/update/update_info.py
  4. +2
    -3
      pym/update/variables/update.py

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

@@ -158,7 +158,7 @@ class Profile(object):

@classmethod
def from_string(cls, repository, s):
parts = list(filter(None, s.split()))
parts = [x for x in s.split() if x]
if len(parts) == 3 and parts[0] in cls.available_arch:
return Profile(repository, parts[1], parts[0])
return None


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

@@ -156,8 +156,8 @@ class Update(MethodsInterface):
EmergeCache.logger.logger.setLevel(logging.WARNING)
self.emerge_cache.check_list = (
self.emerge_cache.check_list +
map(lambda x:emerge_parser.GitCheckvalue(x, self.getGit()),
self.clVars.Get('update.cl_update_rep_path')))
[emerge_parser.GitCheckvalue(x, self.getGit()) for x
in self.clVars.Get('update.cl_update_rep_path')])
self.update_map = {}
self.refresh_binhost = False
self.pkgnum = None
@@ -370,7 +370,6 @@ class Update(MethodsInterface):
makeDirectory(reposdir)
os.rename(layman_fullname, repos_fullname)
os.symlink(symlink_target, layman_fullname)
#print "MYDEBUG", reposdir, laymandir, rpath_orig
self.endTask(True)
return True



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

@@ -70,7 +70,7 @@ class UpdateInfo(object):
"""
Проверить есть ли уже запущенная копия console-gui
"""
return any(list(filter(lambda x: "cl-console-gui" in x, getRunCommands())))
return any([x for x in getRunCommands() if "cl-console-gui" in x])

def update_already_run(self):
"""


+ 2
- 3
pym/update/variables/update.py View File

@@ -453,8 +453,7 @@ class VariableClUpdateSyncOverlayRep(ReadonlyVariable):
type = "list"

def get(self):
return list(filter(lambda x: x not in ("portage", "gentoo"),
self.Get('cl_update_sync_rep')))
return [x for x in self.Get('cl_update_sync_rep') if x not in ("portage", "gentoo")]


class VariableClUpdateOutdateSet(ReadonlyVariable):
@@ -828,7 +827,7 @@ class VariableClUpdateTemplatesLocate(Variable):
def choice(self):
descr = lambda x: self.descriptionMap.get(x,
_("%s overlay templates" % x))
return list(map(lambda x: (x, descr(x)), self.get()))
return [(x, descr(x)) for x in self.get()]


class VariableClUpdateProfileDependName(FieldValue, ReadonlyVariable):


Loading…
Cancel
Save