From 2884bd7273c63fad42e7a286482799dd90f2b4b0 Mon Sep 17 00:00:00 2001 From: Martin Baeuml Date: Tue, 14 Jun 2011 19:40:13 +0200 Subject: [PATCH] save reference to the labeltool in the command --- sloth/core/cli.py | 2 +- sloth/core/labeltool.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sloth/core/cli.py b/sloth/core/cli.py index 9503c76..904397c 100644 --- a/sloth/core/cli.py +++ b/sloth/core/cli.py @@ -97,7 +97,7 @@ class BaseCommand(object): def __init__(self): #self.style = color_style() - pass + self.labeltool = None def usage(self, subcommand): """ diff --git a/sloth/core/labeltool.py b/sloth/core/labeltool.py index cd72105..8017d6d 100755 --- a/sloth/core/labeltool.py +++ b/sloth/core/labeltool.py @@ -161,6 +161,10 @@ class LabelTool(QObject): else: # TODO implement load_command_class klass = load_command_class(app_name, subcommand) + + # set labeltool reference + klass.labeltool = self + return klass def init_from_config(self, config_module_path=""):