From 53ee90888d2afa435d2afd893a222b23252ca16b Mon Sep 17 00:00:00 2001 From: Alberto Planas Date: Tue, 9 Sep 2014 13:24:53 +0200 Subject: [PATCH 1/3] Sometimes __file__ points to the .pyc file. --- osc-check_repo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osc-check_repo.py b/osc-check_repo.py index 48b4de6e..fa0fdf6c 100644 --- a/osc-check_repo.py +++ b/osc-check_repo.py @@ -31,7 +31,7 @@ from osc import cmdln # Expand sys.path to search modules inside the pluging directory -PLUGINDIR = os.path.expanduser(os.path.dirname(os.path.realpath(__file__))) +PLUGINDIR = os.path.dirname(os.path.realpath(__file__.replace('.pyc', '.py'))) sys.path.append(PLUGINDIR) from osclib.checkrepo import CheckRepo from osclib.cycle import CycleDetector From e759c87e487589c1d42dc39052b675c11c415cbc Mon Sep 17 00:00:00 2001 From: Alberto Planas Date: Tue, 9 Sep 2014 13:34:18 +0200 Subject: [PATCH 2/3] Rename _plugin_dir to PLUGINDIR. --- osc-check_source.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osc-check_source.py b/osc-check_source.py index d4f2f9bb..4a7673bd 100644 --- a/osc-check_source.py +++ b/osc-check_source.py @@ -23,8 +23,8 @@ from osc.core import makeurl from osc import cmdln # Expand sys.path to search modules inside the pluging directory -_plugin_dir = os.path.expanduser('~/.osc-plugins') -sys.path.append(_plugin_dir) +PLUGINDIR = os.path.dirname(os.path.realpath(__file__.replace('.pyc', '.py'))) +sys.path.append(PLUGINDIR) from osclib.stagingapi import StagingAPI @@ -263,8 +263,7 @@ def _checker_one_request(self, rq, opts): self._checker_change_review_state(opts, id_, 'declined', by_group='factory-auto', message=msg) continue - sourcechecker = os.path.dirname(os.path.realpath(os.path.expanduser('~/.osc-plugins/osc-check_source.py'))) - sourcechecker = os.path.join(sourcechecker, 'source-checker.pl') + sourcechecker = os.path.join(PLUGINDIR, 'source-checker.pl') civs = "" new_version = None if old_infos['version'] and old_infos['version'] != new_infos['version']: From 7d54c651ac7fc3879146d76afd5a62ff121aaea1 Mon Sep 17 00:00:00 2001 From: Alberto Planas Date: Tue, 9 Sep 2014 13:48:27 +0200 Subject: [PATCH 3/3] action #3556 - bug in staging select --- osclib/select_command.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osclib/select_command.py b/osclib/select_command.py index 100dd6a4..af85dfac 100644 --- a/osclib/select_command.py +++ b/osclib/select_command.py @@ -92,11 +92,12 @@ class SelectCommand(object): return self.api.move_between_project(fprj, request, self.target_project) elif request in staged_requests and not move: # Previously selected, but not explicit move + fprj = self.api.packages_staged[staged_requests[request]]['prj'] msg = 'Request {} is already tracked in "{}".' - msg = msg.format(request, staged_requests[request]) + msg = msg.format(request, fprj) if staged_requests[request] != self.target_project: msg += '\nUse --move modifier to move the request from "{}" to "{}"' - msg = msg.format(staged_requests[request], self.target_project) + msg = msg.format(fprj, self.target_project) print(msg) return True else: