Browse Source

Изменен блок удаляемых пакетов с --verbose

tags/3.2.0_alpha11
Mike khiretskiy 7 years ago
parent
commit
7ade54a7e5
2 changed files with 15 additions and 6 deletions
  1. +13
    -5
      update/emerge_parser.py
  2. +2
    -1
      update/update.py

+ 13
- 5
update/emerge_parser.py View File

@@ -219,16 +219,24 @@ class UninstallPackagesBlock(EmergeInformationBlock):
Блок emerge содержащий список удаляемых пакетов
"""
list = PackageList([])
verbose_result = ""
_new_line = EmergeInformationBlock._new_line
_color_block = EmergeInformationBlock._color_block
token = ["These are the packages that would be unmerged",
"Calculating removal order"]
token = ["Calculating removal order",
"These are the packages that would be unmerged",]
end_token = re.compile("All selected packages:.*\n")
re_block = re.compile(r"All selected packages: (.*?){nl}".
format(nl=_new_line, c=_color_block), re.DOTALL)
re_block = re.compile(
r"(?:{token}).*?{nl}(.*){nl}All selected packages: (.*?){nl}".
format(token="|".join(token),
nl=_new_line, c=_color_block), re.DOTALL)

def get_data(self, match):
super(UninstallPackagesBlock, self).get_data(match)
re_clean = re.compile(
"^.*?({token}).*?{c}{nl}".format(token="|".join(self.token),
nl=self._new_line,c=self._color_block),re.DOTALL)
verbose_result = re_clean.sub("", match.group(1))
self.verbose_result = self._get_text(verbose_result)
self.result = self._get_text(match.group(2))
list_block = XmlConverter().transform(self.result).split()
self.list = PackageList(map(EmergePackage, list_block))



+ 2
- 1
update/update.py View File

@@ -428,7 +428,8 @@ class Update:
"""
# подробный список пакетов
if self.clVars.Get('cl_verbose_set') == 'on':
self.printPre(str(emerge.uninstall_packages))
self.printPre(self._emerge_translate(
emerge.uninstall_packages.verbose_result))
else:
_print = self.color_print
pkglist = emerge.uninstall_packages.list


Loading…
Cancel
Save