2012-10-11 13:31:21 -04:00
|
|
|
#!/usr/bin/python
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import optparse
|
|
|
|
|
2012-11-16 13:40:03 -05:00
|
|
|
usage = """list-subscriptions --user=<email address> [options]
|
2012-10-11 13:31:21 -04:00
|
|
|
|
2012-10-11 15:53:50 -04:00
|
|
|
Prints out a list of the user's subscriptions.
|
2012-10-11 13:31:21 -04:00
|
|
|
|
2012-11-16 13:40:03 -05:00
|
|
|
Example: list-subscriptions --user=tabbott@humbughq.com --site=http://127.0.0.1:8000
|
2012-10-11 13:31:21 -04:00
|
|
|
"""
|
|
|
|
parser = optparse.OptionParser(usage=usage)
|
|
|
|
parser.add_option('--site',
|
|
|
|
dest='site',
|
2012-10-27 11:36:55 -04:00
|
|
|
default="https://humbughq.com",
|
2012-10-11 13:31:21 -04:00
|
|
|
action='store')
|
|
|
|
parser.add_option('--api-key',
|
|
|
|
dest='api_key',
|
2012-11-26 10:30:26 -05:00
|
|
|
default=None,
|
2012-10-11 13:31:21 -04:00
|
|
|
action='store')
|
|
|
|
parser.add_option('--user',
|
|
|
|
dest='user',
|
|
|
|
action='store')
|
|
|
|
(options, args) = parser.parse_args()
|
|
|
|
|
|
|
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
|
|
|
import api.common
|
|
|
|
client = api.common.HumbugAPI(email=options.user,
|
|
|
|
api_key=options.api_key,
|
|
|
|
verbose=True,
|
|
|
|
site=options.site)
|
|
|
|
|
2012-11-16 13:40:03 -05:00
|
|
|
print client.list_subscriptions()
|