Browse Source

Исправлено определние второго update

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

+ 2
- 1
update/emerge_parser.py View File

@@ -233,7 +233,8 @@ class UninstallPackagesBlock(EmergeInformationBlock):
def get_data(self, match):
re_clean = re.compile(
"^.*?({token}).*?{c}{nl}".format(token="|".join(self.token),
nl=self._new_line,c=self._color_block),re.DOTALL)
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))


+ 13
- 4
update/update.py View File

@@ -14,17 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from itertools import ifilter
import random

import sys
from os import path
import os
import time
from calculate.core.server.gen_pid import search_worked_process
from calculate.core.server.gen_pid import search_worked_process, ProcessStatus

from calculate.lib.utils.tools import AddonError
from calculate.lib.utils.colortext.palette import TextState
from calculate.lib.utils.colortext import get_color_print
from calculate.update.emerge_parser import RevdepPercentBlock
import math

from package_tools import Git, Layman,\
EmergeLogNamedTask, EmergeLog, GitError, \
@@ -120,9 +122,16 @@ class Update:
"Try to run later."))
else:
self.startTask(_("Waiting for another update to be complete"))
while any(ifilter(lambda x: os.getpid() != x,
search_worked_process('update', dv))):
time.sleep(0.3)

while filter(lambda x: os.getpid() != x,
search_worked_process('update', dv)):
self.pauseProcess()
while any(ifilter(lambda x: os.getpid() != x,
search_worked_process('update', dv))):
time.sleep(0.3)
self.resumeProcess()
time.sleep(random.random()*3)

self.endTask()
return True



Loading…
Cancel
Save