python-zulip-api/examples/get-subscriptions
Tim Abbott eb8a9f5ad5 Fix descriptions of some API examples.
(imported from commit 105211905b27d03906506af41522854cbb53479a)
2012-10-11 16:20:45 -04:00

34 lines
1 KiB
Python

#!/usr/bin/python
import sys
import os
import optparse
usage = """get-subscriptions --user=<email address> [options]
Prints out a list of the user's subscriptions.
Example: get-subscriptions --user=tabbott@humbughq.com --site=http://127.0.0.1:8000
"""
parser = optparse.OptionParser(usage=usage)
parser.add_option('--site',
dest='site',
default="https://app.humbughq.com",
action='store')
parser.add_option('--api-key',
dest='api_key',
default="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
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)
print client.get_subscriptions()