cliff/demoapp/cliffdemo/simple.py
Doug Hellmann 83469ad81a Doc updates for API changes.
Clean up docstrings.
Bump version to 1.0.

Change-Id: I1047c637ffed4ffac8bffbdaa1bddc56895716d9
2012-06-20 17:27:08 -04:00

25 lines
551 B
Python

import logging
from cliff.command import Command
class Simple(Command):
"A simple command that prints a message."
log = logging.getLogger(__name__)
def take_action(self, parsed_args):
self.log.info('sending greeting')
self.log.debug('debugging')
self.app.stdout.write('hi!\n')
class Error(Command):
"Always raises an error"
log = logging.getLogger(__name__)
def take_action(self, parsed_args):
self.log.info('causing error')
raise RuntimeError('this is the expected exception')