From: Matěj Cepl Date: Thu, 31 Oct 2013 17:46:09 +0000 (+0100) Subject: Incorrect accquiring bugdir command line argument X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=49808306c939de24acabc423024970a76055e52b;p=be.git Incorrect accquiring bugdir command line argument The calling below seems like a typo to me. How can we index with a variable which has not been initialized yet? --- diff --git a/libbe/command/new.py b/libbe/command/new.py index 6e94e79..33ede50 100644 --- a/libbe/command/new.py +++ b/libbe/command/new.py @@ -118,7 +118,7 @@ class New (libbe.command.Command): storage = self._get_storage() bugdirs = self._get_bugdirs() if params['bugdir']: - bugdir = bugdirs[bugdir] + bugdir = bugdirs[params['bugdir']] elif len(bugdirs) == 1: bugdir = bugdirs.values()[0] else: diff --git a/libbe/command/set.py b/libbe/command/set.py index 9413a13..d552878 100644 --- a/libbe/command/set.py +++ b/libbe/command/set.py @@ -77,7 +77,7 @@ class Set (libbe.command.Command): def _run(self, **params): bugdirs = self._get_bugdirs() if params['bugdir']: - bugdir = bugdirs[bugdir] + bugdir = bugdirs[params['bugdir']] elif len(bugdirs) == 1: bugdir = bugdirs.values()[0] else: diff --git a/libbe/command/target.py b/libbe/command/target.py index 20ffb57..9f76303 100644 --- a/libbe/command/target.py +++ b/libbe/command/target.py @@ -99,7 +99,7 @@ class Target (libbe.command.Command): bugdirs = self._get_bugdirs() if params['resolve'] == True: if params['bugdir']: - bugdir = bugdirs[bugdir] + bugdir = bugdirs[params['bugdir']] elif len(bugdirs) == 1: bugdir = bugdirs.values()[0] else: