From af5ce6c595b6d57c1a0a470519fc0e4084a34ac8 Mon Sep 17 00:00:00 2001 From: Mike khiretskiy Date: Thu, 15 May 2014 17:55:03 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BF=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=D1=8B?= =?UTF-8?q?,=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=BF=D0=BE=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D0=BE=D0=B5?= =?UTF-8?q?=20=D1=81=D0=BA=D0=B0=D1=87=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update/package_tools.py | 3 ++- update/update.py | 18 +++++++++++++----- update/utils/cl_update.py | 4 ++-- update/variables/update.py | 6 +++--- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/update/package_tools.py b/update/package_tools.py index 5826ac4..dd86cbd 100644 --- a/update/package_tools.py +++ b/update/package_tools.py @@ -588,7 +588,8 @@ class PackageInformation: self.query_packages.append(pkg) def __getitem__(self, item): - if not self._pkg['CATEGORY/PN'] in self.information_cache: + if not self._pkg['CATEGORY/PN'] in self.information_cache and \ + self.query_packages: self.query_information() try: return self.information_cache[self._pkg['CATEGORY/PN']][item] diff --git a/update/update.py b/update/update.py index 1dddd39..2f867f4 100644 --- a/update/update.py +++ b/update/update.py @@ -25,7 +25,6 @@ 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 pexpect from package_tools import Git, Layman,\ EmergeLogNamedTask, EmergeLog, GitError, \ @@ -134,7 +133,8 @@ class Update: "cl_update_rep_rev", "cl_update_branch_name"], where="cl_update_rep_name", eq=repname, limit=1)) if not url or not rpath: - raise UpdateError(_("Repositories variables is not configured")) + raise UpdateError(_("Variables with repositories settings " + "is not configured")) self.addProgress() if clean_on_error: try: @@ -160,6 +160,9 @@ class Update: raise UpdateError(_("Permission denied to change " "{repname} repository").format( repname=repname)) + finally: + if path.exists(rpath_new): + removeDir(rpath_new) else: if not self._syncRepository(repname, url, rpath, revision, branch): return "skip" @@ -292,7 +295,9 @@ class Update: else: _print = _print.foreground(Colors.GREEN) - self.startTask(_("Emerging%s %s") % (part, _print(str(pkg)))) + self.startTask( + _("Emerging{part} {package}").format(part=part, + package=_print(str(pkg)))) def _printInstallPackage(self, pkg, binary=False): """ @@ -316,12 +321,15 @@ class Update: if max_num > 1: one = _print.foreground(Colors.YELLOW).bold("{0}", num) two = _print.foreground(Colors.YELLOW).bold("{0}", max_num) - part = " (%s of %s)" % (one, two) + part = _(" ({current} of {maximum})").format(current=one, + maximum=two) else: part = "" _print = _print.foreground(Colors.RED) - self.startTask(_("Unmerging%s %s") % (part, _print.bold(str(pkg)))) + self.startTask( + _("Unmerging{part} {package}").format(part=part, + package=_print.bold(str(pkg)))) def emergelike(self, cmd, *params): """ diff --git a/update/utils/cl_update.py b/update/utils/cl_update.py index 1034449..2ac2c36 100644 --- a/update/utils/cl_update.py +++ b/update/utils/cl_update.py @@ -205,7 +205,7 @@ class ClUpdateAction(Action): {'name': 'check_run', 'method': 'Update.checkRun(cl_update_wait_another_set)'}, {'name': 'reps_synchronization', - 'group': __("Repository synchronization"), + 'group': __("Repositories synchronization"), 'tasks': [ {'name': 'sync_reps', 'foreach': 'cl_update_sync_rep', @@ -231,7 +231,7 @@ class ClUpdateAction(Action): }, {'name': 'sync_other_reps:regen_other_cache', 'foreach': 'cl_update_other_rep_name', - 'message': __("Updating cache {eachvar:capitalize} repository"), + 'message': __("Updating {eachvar:capitalize} repository cache"), 'method': 'Update.regenCache(eachvar)', 'essential': False, }, diff --git a/update/variables/update.py b/update/variables/update.py index f8e4851..01eedf8 100644 --- a/update/variables/update.py +++ b/update/variables/update.py @@ -185,7 +185,7 @@ class VariableClUpdateBranch(TableVariable): def init(self): self.help = _("set branches for repository (REPOSITORY:BRANCH)") - self.label = _("Repository branch") + self.label = _("Repositories branches") def raiseReadonlyIndexError(self,fieldname="",variablename="", value=""): @@ -201,7 +201,7 @@ class VariableClUpdateBranchRep(ReadonlyVariable): type = "list" def init(self): - self.label = _("Repository") + self.label = _("Repositories") def get(self): return self.Get('cl_update_rep_name') @@ -214,7 +214,7 @@ class VariableClUpdateBranchName(Variable): type = "choiceedit-list" def init(self): - self.label = _("Branch") + self.label = _("Branches") def choice(self): return ["master", "develop", "update"]