Browse Source

Исправлено определение стадии получения бинарных пакетов

tags/3.3.2_alpha2
Mike Khiretskiy 6 years ago
parent
commit
e15842fe7c
2 changed files with 11 additions and 2 deletions
  1. +8
    -1
      pym/update/emerge_parser.py
  2. +3
    -1
      pym/update/update.py

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

@@ -377,6 +377,13 @@ class NotifierInformationBlock(EmergeInformationBlock):
def add_observer(self, f):
self.observers.append(f)

def clear_observers(self):
self.observers = []

def remove_observer(self, f):
if f in self.observers:
self.observers.remove(f)

def notify(self, observer, groups):
observer(groups)

@@ -425,7 +432,7 @@ class FetchingTarball(NotifierInformationBlock):
Происходит скачивание архивов
"""
token = "Saving to:"
re_block = re.compile("Saving to:\s*‘(\S+)?’")
re_block = re.compile("Saving to:\s*['](\S+)?[']")

def notify(self, observer, groups):
observer(groups[0])


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

@@ -528,7 +528,6 @@ class Update(object):
self.endTask()
self.startTask(_("Fetching binary packages"))


def _printUninstallPackage(self, pkg, num=1, max_num=1):
"""
Вывод сообщения удаления пакета
@@ -791,6 +790,9 @@ class Update(object):
emerge.installing.add_observer(self._printInstallPackage)
emerge.uninstalling.add_observer(self._printUninstallPackage)
emerge.fetching.add_observer(self._printFetching)
def cancel_observing_fetch(fn):
emerge.fetching.clear_observers()
emerge.fetching.add_observer(cancel_observing_fetch)
try:
emerge.run()
except EmergeError:


Loading…
Cancel
Save