summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@gmail.com>2012-06-18 14:07:35 -0700
committerDoug Hellmann <doug.hellmann@gmail.com>2012-06-18 14:07:35 -0700
commit122fa558b8b7b99541ee1bca433ad87b1b3650ff (patch)
treecece183b67c8a4bfce55ee2601fb9d4c54dfc6ad
parent748ef2b230588c66e240ceb93471b0ceaeca1f8e (diff)
parent62724e12dc51b054a8f7f5698749cb464b7b873c (diff)
downloadcliff-tablib-122fa558b8b7b99541ee1bca433ad87b1b3650ff.tar.gz
Merge pull request #2 from dtroyer/refactor-run
Tweak refactor run
-rw-r--r--cliff/command.py7
-rw-r--r--cliff/display.py6
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
@@ -70,12 +70,6 @@ class DisplayCommandBase(Command):
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.