From a4111a24269d482a0ff248a0ae2f15a5d0baeab0 Mon Sep 17 00:00:00 2001 From: Waseem Daher Date: Thu, 5 Dec 2013 17:42:33 -0500 Subject: [PATCH] Add 'client' string to our missing integrations. Not done: Jira, Nagios (imported from commit 3e2505653b377f8c307745e507bdc40e980dca05) --- api/integrations/asana/zulip_asana_mirror | 3 ++- api/integrations/basecamp/zulip_basecamp_mirror | 4 +++- api/integrations/codebase/zulip_codebase_mirror | 4 +++- api/integrations/git/post-receive | 4 +++- api/integrations/rss/rss-bot | 4 ++-- api/integrations/svn/post-commit | 4 +++- api/integrations/trac/zulip_trac.py | 4 +++- api/integrations/twitter/twitter-bot | 3 ++- api/integrations/twitter/twitter-search-bot | 3 ++- 9 files changed, 23 insertions(+), 10 deletions(-) diff --git a/api/integrations/asana/zulip_asana_mirror b/api/integrations/asana/zulip_asana_mirror index ca7ac2a8bd..c68b98594d 100644 --- a/api/integrations/asana/zulip_asana_mirror +++ b/api/integrations/asana/zulip_asana_mirror @@ -36,6 +36,7 @@ import urllib2 import sys sys.path.insert(0, os.path.dirname(__file__)) import zulip_asana_config as config +VERSION = "0.9" if config.ZULIP_API_PATH is not None: sys.path.append(config.ZULIP_API_PATH) @@ -47,7 +48,7 @@ else: logging.basicConfig(level=logging.INFO) client = zulip.Client(email=config.ZULIP_USER, api_key=config.ZULIP_API_KEY, - site=config.ZULIP_SITE) + site=config.ZULIP_SITE, client="asana " + VERSION) def fetch_from_asana(path): """ diff --git a/api/integrations/basecamp/zulip_basecamp_mirror b/api/integrations/basecamp/zulip_basecamp_mirror index 7f51976446..ff7ab0bd24 100755 --- a/api/integrations/basecamp/zulip_basecamp_mirror +++ b/api/integrations/basecamp/zulip_basecamp_mirror @@ -37,6 +37,7 @@ from HTMLParser import HTMLParser sys.path.insert(0, os.path.dirname(__file__)) import zulip_basecamp_config as config +VERSION = "0.9" if config.ZULIP_API_PATH is not None: sys.path.append(config.ZULIP_API_PATH) @@ -46,7 +47,8 @@ import zulip client = zulip.Client( email=config.ZULIP_USER, site=config.ZULIP_SITE, - api_key=config.ZULIP_API_KEY) + api_key=config.ZULIP_API_KEY, + client="basecamp " + VERSION) user_agent = "Basecamp To Zulip Mirroring script (support@zulip.com)" htmlParser = HTMLParser() diff --git a/api/integrations/codebase/zulip_codebase_mirror b/api/integrations/codebase/zulip_codebase_mirror index babe13cfa5..857098378b 100755 --- a/api/integrations/codebase/zulip_codebase_mirror +++ b/api/integrations/codebase/zulip_codebase_mirror @@ -41,6 +41,7 @@ import dateutil.parser sys.path.insert(0, os.path.dirname(__file__)) import zulip_codebase_config as config +VERSION = "0.9" if config.ZULIP_API_PATH is not None: sys.path.append(config.ZULIP_API_PATH) @@ -49,7 +50,8 @@ import zulip client = zulip.Client( email=config.ZULIP_USER, site=config.ZULIP_SITE, - api_key=config.ZULIP_API_KEY) + api_key=config.ZULIP_API_KEY, + client="codebase " + VERSION) user_agent = "Codebase To Zulip Mirroring script (support@zulip.com)" # find some form of JSON loader/dumper, with a preference order for speed. diff --git a/api/integrations/git/post-receive b/api/integrations/git/post-receive index 0cb5ffe3a6..7ab76d84ba 100755 --- a/api/integrations/git/post-receive +++ b/api/integrations/git/post-receive @@ -36,6 +36,7 @@ import os.path sys.path.insert(0, os.path.dirname(__file__)) import zulip_git_config as config +VERSION = "0.9" if config.ZULIP_API_PATH is not None: sys.path.append(config.ZULIP_API_PATH) @@ -44,7 +45,8 @@ import zulip client = zulip.Client( email=config.ZULIP_USER, site=config.ZULIP_SITE, - api_key=config.ZULIP_API_KEY) + api_key=config.ZULIP_API_KEY, + client="git " + VERSION) # check_output is backported from subprocess.py in Python 2.7 def check_output(*popenargs, **kwargs): diff --git a/api/integrations/rss/rss-bot b/api/integrations/rss/rss-bot index ad2dd70562..9bfdd42eb5 100755 --- a/api/integrations/rss/rss-bot +++ b/api/integrations/rss/rss-bot @@ -36,7 +36,7 @@ import urlparse import feedparser import zulip - +VERSION = "0.9" RSS_DATA_DIR = os.path.expanduser(os.path.join('~', '.cache', 'zulip-rss')) OLDNESS_THRESHOLD = 30 # days @@ -164,7 +164,7 @@ except IOError: log_error_and_exit("Unable to read feed file at %s." % (opts.feed_file,)) client = zulip.Client(email=opts.email, api_key=opts.api_key, - site=opts.site) + site=opts.site, client="rss " + VERSION) first_message = True diff --git a/api/integrations/svn/post-commit b/api/integrations/svn/post-commit index f790711d7c..28f33151b1 100755 --- a/api/integrations/svn/post-commit +++ b/api/integrations/svn/post-commit @@ -36,6 +36,7 @@ import pysvn sys.path.insert(0, os.path.dirname(__file__)) import zulip_svn_config as config +VERSION = "0.9" if config.ZULIP_API_PATH is not None: sys.path.append(config.ZULIP_API_PATH) @@ -44,7 +45,8 @@ import zulip client = zulip.Client( email=config.ZULIP_USER, site=config.ZULIP_SITE, - api_key=config.ZULIP_API_KEY) + api_key=config.ZULIP_API_KEY, + client="svn " + VERSION) svn = pysvn.Client() path, rev = sys.argv[1:] diff --git a/api/integrations/trac/zulip_trac.py b/api/integrations/trac/zulip_trac.py index e726be72f0..67aad24c12 100644 --- a/api/integrations/trac/zulip_trac.py +++ b/api/integrations/trac/zulip_trac.py @@ -40,6 +40,7 @@ import sys import os.path sys.path.insert(0, os.path.dirname(__file__)) import zulip_trac_config as config +VERSION = "0.9" if config.ZULIP_API_PATH is not None: sys.path.append(config.ZULIP_API_PATH) @@ -48,7 +49,8 @@ import zulip client = zulip.Client( email=config.ZULIP_USER, site=config.ZULIP_SITE, - api_key=config.ZULIP_API_KEY) + api_key=config.ZULIP_API_KEY, + client="trac " + VERSION) def markdown_ticket_url(ticket, heading="ticket"): return "[%s #%s](%s/%s)" % (heading, ticket.id, config.TRAC_BASE_TICKET_URL, ticket.id) diff --git a/api/integrations/twitter/twitter-bot b/api/integrations/twitter/twitter-bot index a8857fbd06..7c89c41781 100755 --- a/api/integrations/twitter/twitter-bot +++ b/api/integrations/twitter/twitter-bot @@ -29,7 +29,7 @@ import optparse import ConfigParser import zulip - +VERSION = "0.9" CONFIGFILE = os.path.expanduser("~/.zulip_twitterrc") def write_config(config, since_id, user): @@ -129,6 +129,7 @@ client = zulip.Client( email=options.email, api_key=options.api_key, site=options.site, + client="twitter " + VERSION, verbose=True) if since_id < 0 or options.twitter_id != user_id: diff --git a/api/integrations/twitter/twitter-search-bot b/api/integrations/twitter/twitter-search-bot index ee302dff19..404666e60d 100755 --- a/api/integrations/twitter/twitter-search-bot +++ b/api/integrations/twitter/twitter-search-bot @@ -29,7 +29,7 @@ import optparse import ConfigParser import zulip - +VERSION = "0.9" CONFIGFILE = os.path.expanduser("~/.zulip_twitterrc") def write_config(config, since_id): @@ -146,6 +146,7 @@ client = zulip.Client( email=opts.email, api_key=opts.api_key, site=opts.site, + client="twitter search " + VERSION, verbose=True) search_query = " OR ".join(opts.search_terms.split(","))