From 62724e12dc51b054a8f7f5698749cb464b7b873c Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 1 Jun 2012 11:08:51 -0500 Subject: Move take_action() to Command --- cliff/command.py | 7 +++++++ cliff/display.py | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cliff/command.py b/cliff/command.py index 7ff526e..e369988 100644 --- a/cliff/command.py +++ b/cliff/command.py @@ -32,6 +32,13 @@ class Command(object): return parser @abc.abstractmethod + def take_action(self, parsed_args): + """Return a two-part tuple with a tuple of column names + and a tuple of values. + """ + def run(self, parsed_args): """Do something useful. """ + self.take_action(parsed_args) + return 0 diff --git a/cliff/display.py b/cliff/display.py index 6d9f522..9dd2718 100644 --- a/cliff/display.py +++ b/cliff/display.py @@ -69,12 +69,6 @@ class DisplayCommandBase(Command): formatter.add_argument_group(parser) return parser - @abc.abstractmethod - def take_action(self, parsed_args): - """Return a two-part tuple with a tuple of column names - and a tuple of values. - """ - @abc.abstractmethod def produce_output(self, parsed_args, column_names, data): """Use the formatter to generate the output. -- cgit v1.2.1