Browse Source

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

develop
Mike Khiretskiy 7 years ago
parent
commit
e15842fe7c
  1. 9
      pym/update/emerge_parser.py
  2. 4
      pym/update/update.py

9
pym/update/emerge_parser.py

@ -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])

4
pym/update/update.py

@ -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