From 4db2dab6453d7f553f19f6bf6d11f038371742bc Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Fri, 21 Feb 2014 14:11:29 -0500 Subject: [PATCH] api: Disambiguate the names of Zulip options (imported from commit 67525764cc2f2a26081640063e2d78852f6229ca) --- bots/gcal-bot | 2 +- integrations/twitter/twitter-bot | 6 +++--- zulip/__init__.py | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bots/gcal-bot b/bots/gcal-bot index 650c2d4..ff33d7b 100755 --- a/bots/gcal-bot +++ b/bots/gcal-bot @@ -47,7 +47,7 @@ parser.add_option_group(zulip.generate_option_group(parser)) (options, args) = parser.parse_args() -if not (options.user and options.calendar): +if not (options.zulip_email and options.calendar): parser.error('You must specify --user and --calendar') try: diff --git a/integrations/twitter/twitter-bot b/integrations/twitter/twitter-bot index a848c25..30c890f 100755 --- a/integrations/twitter/twitter-bot +++ b/integrations/twitter/twitter-bot @@ -126,9 +126,9 @@ except ConfigParser.NoOptionError: user_id = options.twitter_id client = zulip.Client( - email=options.email, - api_key=options.api_key, - site=options.site, + email=options.zulip_email, + api_key=options.zulip_api_key, + site=options.zulip_site, client="ZulipTwitter/" + VERSION, verbose=True) diff --git a/zulip/__init__.py b/zulip/__init__.py index 137c1fb..6f0bf81 100644 --- a/zulip/__init__.py +++ b/zulip/__init__.py @@ -51,18 +51,18 @@ def _default_client(): def generate_option_group(parser, prefix=''): group = optparse.OptionGroup(parser, 'Zulip API configuration') group.add_option('--%ssite' % (prefix,), - dest="site", + dest="zulip_site", help="Zulip Enterprise server URI (if using Zulip Enterprise)", default=None) group.add_option('--%sapi-key' % (prefix,), - dest="api_key", + dest="zulip_api_key", action='store') group.add_option('--%suser' % (prefix,), - dest='email', + dest='zulip_email', help='Email address of the calling bot or user.') group.add_option('--%sconfig-file' % (prefix,), action='store', - dest="config_file", + dest="zulip_config_file", help='Location of an ini file containing the\nabove information. (default ~/.zuliprc)') group.add_option('-v', '--verbose', action='store_true', @@ -70,18 +70,18 @@ def generate_option_group(parser, prefix=''): group.add_option('--%sclient' % (prefix,), action='store', default=None, - dest="client", + dest="zulip_client", help=optparse.SUPPRESS_HELP) return group def init_from_options(options, client=None): - if options.client is not None: - client = options.client + if options.zulip_client is not None: + client = options.zulip_client elif client is None: client = _default_client() - return Client(email=options.email, api_key=options.api_key, - config_file=options.config_file, verbose=options.verbose, - site=options.site, client=client) + return Client(email=options.zulip_email, api_key=options.zulip_api_key, + config_file=options.zulip_config_file, verbose=options.verbose, + site=options.zulip_site, client=client) class Client(object): def __init__(self, email=None, api_key=None, config_file=None,