Switch to the option group pattern for API examples.

(imported from commit 67d0164df822a56f06d5f959297cc2efa9706001)
This commit is contained in:
Luke Faraone 2012-12-12 14:39:12 -05:00
parent ea27fbae11
commit f1d60f5417
6 changed files with 34 additions and 63 deletions

View file

@ -31,19 +31,14 @@ Prints out each message received by the indicated user.
Example: print-messages --user=tabbott@humbughq.com --site=https://zephyr.humbughq.com
"""
parser = optparse.OptionParser(usage=usage)
parser.add_option('--site', default='https://humbughq.com')
parser.add_option('--api-key')
parser.add_option('--user')
(options, args) = parser.parse_args()
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
client = humbug.Client(
email=options.user,
api_key=options.api_key,
verbose=True,
site=options.site)
parser = optparse.OptionParser(usage=usage)
parser.add_option_group(humbug.generate_option_group(parser))
(options, args) = parser.parse_args()
client = humbug.init_from_options(options)
def print_message(message):
print message