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 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']: 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: