Update style of client strings.
(imported from commit 1516461cf53b2715de68e01f16bb8a8cc33c48ad)
This commit is contained in:
parent
a1cf1f04a2
commit
c03ac5e3ce
|
@ -49,7 +49,7 @@ At the top of the file:
|
||||||
|
|
||||||
# Make sure the Zulip API distribution's root directory is in sys.path, then:
|
# Make sure the Zulip API distribution's root directory is in sys.path, then:
|
||||||
import zulip
|
import zulip
|
||||||
zulip_client = zulip.Client(email="your-bot@example.com")
|
zulip_client = zulip.Client(email="your-bot@example.com", client="MyTestClient/0.1")
|
||||||
|
|
||||||
When you want to send a message:
|
When you want to send a message:
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ zulip_client = zulip.Client(
|
||||||
email=zulip_user,
|
email=zulip_user,
|
||||||
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
||||||
verbose=True,
|
verbose=True,
|
||||||
client="test: Zulip monitoring",
|
client="ZulipMonitoring/0.1",
|
||||||
site=options.site)
|
site=options.site)
|
||||||
|
|
||||||
# Configure logging
|
# Configure logging
|
||||||
|
|
|
@ -10,7 +10,7 @@ import unicodedata
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'api'))
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'api'))
|
||||||
import zulip
|
import zulip
|
||||||
|
|
||||||
zulip_client = zulip.Client()
|
zulip_client = zulip.Client(client="ZulipSyncPublicStreamsBot/0.1")
|
||||||
|
|
||||||
def fetch_public_streams():
|
def fetch_public_streams():
|
||||||
public_streams = set()
|
public_streams = set()
|
||||||
|
|
|
@ -49,6 +49,7 @@ sys.path.append(zulip_directory)
|
||||||
import zulip
|
import zulip
|
||||||
|
|
||||||
client = zulip.Client(
|
client = zulip.Client(
|
||||||
|
client = "ZulipTddiumNotifier/0.1",
|
||||||
email = os.environ['ZULIP_USER'],
|
email = os.environ['ZULIP_USER'],
|
||||||
api_key = os.environ.get('ZULIP_API_KEY'))
|
api_key = os.environ.get('ZULIP_API_KEY'))
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ else:
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
client = zulip.Client(email=config.ZULIP_USER, api_key=config.ZULIP_API_KEY,
|
client = zulip.Client(email=config.ZULIP_USER, api_key=config.ZULIP_API_KEY,
|
||||||
site=config.ZULIP_SITE, client="asana " + VERSION)
|
site=config.ZULIP_SITE, client="ZulipAsana/" + VERSION)
|
||||||
|
|
||||||
def fetch_from_asana(path):
|
def fetch_from_asana(path):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -48,7 +48,7 @@ client = zulip.Client(
|
||||||
email=config.ZULIP_USER,
|
email=config.ZULIP_USER,
|
||||||
site=config.ZULIP_SITE,
|
site=config.ZULIP_SITE,
|
||||||
api_key=config.ZULIP_API_KEY,
|
api_key=config.ZULIP_API_KEY,
|
||||||
client="basecamp " + VERSION)
|
client="ZulipBasecamp/" + VERSION)
|
||||||
user_agent = "Basecamp To Zulip Mirroring script (support@zulip.com)"
|
user_agent = "Basecamp To Zulip Mirroring script (support@zulip.com)"
|
||||||
htmlParser = HTMLParser()
|
htmlParser = HTMLParser()
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ client = zulip.Client(
|
||||||
email=config.ZULIP_USER,
|
email=config.ZULIP_USER,
|
||||||
site=config.ZULIP_SITE,
|
site=config.ZULIP_SITE,
|
||||||
api_key=config.ZULIP_API_KEY,
|
api_key=config.ZULIP_API_KEY,
|
||||||
client="codebase " + VERSION)
|
client="ZulipCodebase/" + VERSION)
|
||||||
user_agent = "Codebase To Zulip Mirroring script (support@zulip.com)"
|
user_agent = "Codebase To Zulip Mirroring script (support@zulip.com)"
|
||||||
|
|
||||||
# find some form of JSON loader/dumper, with a preference order for speed.
|
# find some form of JSON loader/dumper, with a preference order for speed.
|
||||||
|
|
|
@ -46,7 +46,7 @@ client = zulip.Client(
|
||||||
email=config.ZULIP_USER,
|
email=config.ZULIP_USER,
|
||||||
site=config.ZULIP_SITE,
|
site=config.ZULIP_SITE,
|
||||||
api_key=config.ZULIP_API_KEY,
|
api_key=config.ZULIP_API_KEY,
|
||||||
client="git " + VERSION)
|
client="ZulipGit/" + VERSION)
|
||||||
|
|
||||||
# check_output is backported from subprocess.py in Python 2.7
|
# check_output is backported from subprocess.py in Python 2.7
|
||||||
def check_output(*popenargs, **kwargs):
|
def check_output(*popenargs, **kwargs):
|
||||||
|
|
|
@ -87,7 +87,7 @@ def send_zulip(email, api_key, site, stream, subject, content):
|
||||||
"""
|
"""
|
||||||
client = zulip.Client(email=email, api_key=api_key,
|
client = zulip.Client(email=email, api_key=api_key,
|
||||||
site=site,
|
site=site,
|
||||||
client="mercurial " + VERSION)
|
client="ZulipMercurial/" + VERSION)
|
||||||
|
|
||||||
message_data = {
|
message_data = {
|
||||||
"type": "stream",
|
"type": "stream",
|
||||||
|
|
|
@ -15,7 +15,7 @@ for opt in ('type', 'host', 'service', 'state'):
|
||||||
parser.add_option('--' + opt)
|
parser.add_option('--' + opt)
|
||||||
(opts, args) = parser.parse_args()
|
(opts, args) = parser.parse_args()
|
||||||
|
|
||||||
client = zulip.Client(config_file=opts.config, client="nagios " + VERSION)
|
client = zulip.Client(config_file=opts.config, client="ZulipNagios/" + VERSION)
|
||||||
|
|
||||||
msg = dict(type='stream', to=opts.stream)
|
msg = dict(type='stream', to=opts.stream)
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,8 @@ import zulip
|
||||||
client = zulip.Client(
|
client = zulip.Client(
|
||||||
email=config.ZULIP_USER,
|
email=config.ZULIP_USER,
|
||||||
site=config.ZULIP_SITE,
|
site=config.ZULIP_SITE,
|
||||||
api_key=config.ZULIP_API_KEY)
|
api_key=config.ZULIP_API_KEY,
|
||||||
|
client="ZulipPerforce/" + __version__)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
changelist = int(sys.argv[1])
|
changelist = int(sys.argv[1])
|
||||||
|
|
|
@ -164,7 +164,7 @@ except IOError:
|
||||||
log_error_and_exit("Unable to read feed file at %s." % (opts.feed_file,))
|
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,
|
client = zulip.Client(email=opts.email, api_key=opts.api_key,
|
||||||
site=opts.site, client="rss " + VERSION)
|
site=opts.site, client="ZulipRSS/" + VERSION)
|
||||||
|
|
||||||
first_message = True
|
first_message = True
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ client = zulip.Client(
|
||||||
email=config.ZULIP_USER,
|
email=config.ZULIP_USER,
|
||||||
site=config.ZULIP_SITE,
|
site=config.ZULIP_SITE,
|
||||||
api_key=config.ZULIP_API_KEY,
|
api_key=config.ZULIP_API_KEY,
|
||||||
client="svn " + VERSION)
|
client="ZulipSVN/" + VERSION)
|
||||||
svn = pysvn.Client()
|
svn = pysvn.Client()
|
||||||
|
|
||||||
path, rev = sys.argv[1:]
|
path, rev = sys.argv[1:]
|
||||||
|
|
|
@ -50,7 +50,7 @@ client = zulip.Client(
|
||||||
email=config.ZULIP_USER,
|
email=config.ZULIP_USER,
|
||||||
site=config.ZULIP_SITE,
|
site=config.ZULIP_SITE,
|
||||||
api_key=config.ZULIP_API_KEY,
|
api_key=config.ZULIP_API_KEY,
|
||||||
client="trac " + VERSION)
|
client="ZulipTrac/" + VERSION)
|
||||||
|
|
||||||
def markdown_ticket_url(ticket, heading="ticket"):
|
def markdown_ticket_url(ticket, heading="ticket"):
|
||||||
return "[%s #%s](%s/%s)" % (heading, ticket.id, config.TRAC_BASE_TICKET_URL, ticket.id)
|
return "[%s #%s](%s/%s)" % (heading, ticket.id, config.TRAC_BASE_TICKET_URL, ticket.id)
|
||||||
|
|
|
@ -129,7 +129,7 @@ client = zulip.Client(
|
||||||
email=options.email,
|
email=options.email,
|
||||||
api_key=options.api_key,
|
api_key=options.api_key,
|
||||||
site=options.site,
|
site=options.site,
|
||||||
client="twitter " + VERSION,
|
client="ZulipTwitter/" + VERSION,
|
||||||
verbose=True)
|
verbose=True)
|
||||||
|
|
||||||
if since_id < 0 or options.twitter_id != user_id:
|
if since_id < 0 or options.twitter_id != user_id:
|
||||||
|
|
|
@ -146,7 +146,7 @@ client = zulip.Client(
|
||||||
email=opts.email,
|
email=opts.email,
|
||||||
api_key=opts.api_key,
|
api_key=opts.api_key,
|
||||||
site=opts.site,
|
site=opts.site,
|
||||||
client="twitter search " + VERSION,
|
client="ZulipTwitterSearch/" + VERSION,
|
||||||
verbose=True)
|
verbose=True)
|
||||||
|
|
||||||
search_query = " OR ".join(opts.search_terms.split(","))
|
search_query = " OR ".join(opts.search_terms.split(","))
|
||||||
|
|
Loading…
Reference in a new issue