Change Humbug => Zulip in text/comments.

(imported from commit 2f9d73431ae40e1b9e9e11bc2f4f62f566ae758a)
This commit is contained in:
Tim Abbott 2013-08-06 15:32:15 -04:00
parent 42616682d5
commit 4cd4c6897b
29 changed files with 76 additions and 76 deletions

View file

@ -1,6 +1,6 @@
#### Dependencies
The Humbug API Python bindings require the following Python libraries:
The Zulip API Python bindings require the following Python libraries:
* simplejson
* requests (version >= 0.12.1)
@ -34,14 +34,14 @@ Alternatively, you may explicitly use "--user" and "--api-key" in our
examples, which is especially useful if you are running several bots
which share a home directory.
You can obtain your Humbug API key, create bots, and manage bots all
from your Humbug [settings page](https://zulip.com/#settings).
You can obtain your Zulip API key, create bots, and manage bots all
from your Zulip [settings page](https://zulip.com/#settings).
A typical simple bot sending API messages will look as follows:
At the top of the file:
# Make sure the Humbug 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 humbug
humbug_client = humbug.Client(email="your-bot@example.com")
@ -57,9 +57,9 @@ When you want to send a message:
Additional examples:
client.send_message({'type': 'stream', 'content': 'Humbug rules!',
client.send_message({'type': 'stream', 'content': 'Zulip rules!',
'subject': 'feedback', 'to': ['support']})
client.send_message({'type': 'private', 'content': 'Humbug rules!',
client.send_message({'type': 'private', 'content': 'Zulip rules!',
'to': ['user1@example.com', 'user2@example.com']})
send_message() returns a dict guaranteed to contain the following

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# humbug-send -- Sends a message to the specified recipients.
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -60,8 +60,8 @@ logger.addHandler(file_handler)
# Initialize list of streams to test
if options.sharded:
# NOTE: Streams in this list must be in humbug_user's Humbug
# subscriptions, or we won't receive messages via Humbug.
# NOTE: Streams in this list must be in humbug_user's Zulip
# subscriptions, or we won't receive messages via Zulip.
# The sharded stream list has a bunch of pairs
# (stream, shard_name), where sha1sum(stream).startswith(shard_name)
@ -105,7 +105,7 @@ def print_status_and_exit(status):
def send_humbug(message):
result = humbug_client.send_message(message)
if result["result"] != "success":
logger.error("Error sending humbug, args were:")
logger.error("Error sending zulip, args were:")
logger.error(message)
logger.error(result)
print_status_and_exit(1)
@ -126,16 +126,16 @@ def send_zephyr(zwrite_args, content):
print_status_and_exit(1)
return False
# Subscribe to Humbugs
# Subscribe to Zulip
try:
res = humbug_client.get_profile()
max_message_id = res.get('max_message_id')
if max_message_id is None:
logging.error("Error subscribing to Humbugs!")
logging.error("Error subscribing to Zulips!")
logging.error(res)
print_status_and_exit(1)
except Exception:
logger.exception("Unexpected error subscribing to Humbugs")
logger.exception("Unexpected error subscribing to Zulips")
print_status_and_exit(1)
# Subscribe to Zephyrs
@ -234,7 +234,7 @@ for key, (stream, test) in zhkeys.items():
receive_zephyrs()
logger.info("Sent Zephyr messages!")
# Send Humbugs
# Send Zulips
for key, (stream, test) in hzkeys.items():
if stream == "message":
send_humbug({
@ -251,7 +251,7 @@ for key, (stream, test) in hzkeys.items():
})
receive_zephyrs()
logger.info("Sent Humbug messages!")
logger.info("Sent Zulip messages!")
# Normally messages manage to forward through in under 3 seconds, but
# sleep 10 to give a safe margin since the messages do need to do 2
@ -263,9 +263,9 @@ receive_zephyrs()
logger.info("Starting receiving messages!")
# receive humbugs
# receive zulips
messages = humbug_client.get_messages({'last': str(max_message_id)})['messages']
logger.info("Finished receiving Humbug messages!")
logger.info("Finished receiving Zulip messages!")
receive_zephyrs()
logger.info("Finished receiving Zephyr messages!")
@ -286,7 +286,7 @@ def process_keys(content_list):
success = all(val == 1 for val in key_counts.values())
return key_counts, z_missing, h_missing, duplicates, success
# The h_foo variables are about the messages we _received_ in Humbug
# The h_foo variables are about the messages we _received_ in Zulip
# The z_foo variables are about the messages we _received_ in Zephyr
h_contents = [message["content"] for message in messages]
z_contents = [notice.message.split('\0')[1] for notice in notices]
@ -299,7 +299,7 @@ if z_success and h_success:
elif z_success:
logger.info("Received everything correctly in Zephyr!")
elif h_success:
logger.info("Received everything correctly in Humbug!")
logger.info("Received everything correctly in Zulip!")
logger.error("Messages received the wrong number of times:")
for key in all_keys:
@ -311,37 +311,37 @@ for key in all_keys:
(key, z_key_counts[key], h_key_counts[key], test, stream))
if key in hzkeys:
(stream, test) = hzkeys[key]
logger.warning("%10s: z got %s. h got %s. Sent via Humbug(%s): class %s" % \
logger.warning("%10s: z got %s. h got %s. Sent via Zulip(%s): class %s" % \
(key, z_key_counts[key], h_key_counts[key], test, stream))
logger.error("")
logger.error("Summary of specific problems:")
if h_duplicates:
logger.error("humbug: Received duplicate messages!")
logger.error("humbug: This is probably a bug in our message loop detection.")
logger.error("humbug: where Humbugs go humbug=>zephyr=>humbug")
logger.error("zulip: Received duplicate messages!")
logger.error("zulip: This is probably a bug in our message loop detection.")
logger.error("zulip: where Zulips go zulip=>zephyr=>zulip")
if z_duplicates:
logger.error("zephyr: Received duplicate messages!")
logger.error("zephyr: This is probably a bug in our message loop detection.")
logger.error("zephyr: where Zephyrs go zephyr=>humbug=>zephyr")
logger.error("zephyr: where Zephyrs go zephyr=>zulip=>zephyr")
if z_missing_z:
logger.error("zephyr: Didn't receive all the Zephyrs we sent on the Zephyr end!")
logger.error("zephyr: This is probably an issue with check-mirroring sending or receiving Zephyrs.")
if h_missing_h:
logger.error("humbug: Didn't receive all the Humbugs we sent on the Humbug end!")
logger.error("humbug: This is probably an issue with check-mirroring sending or receiving Humbugs.")
logger.error("zulip: Didn't receive all the Zulips we sent on the Zulip end!")
logger.error("zulip: This is probably an issue with check-mirroring sending or receiving Zulips.")
if z_missing_h:
logger.error("zephyr: Didn't receive all the Humbugs we sent on the Zephyr end!")
logger.error("zephyr: Didn't receive all the Zulips we sent on the Zephyr end!")
if z_missing_h == h_missing_h:
logger.error("zephyr: Including some Humbugs that we did receive on the Humbug end.")
logger.error("zephyr: This suggests we have a humbug=>zephyr mirroring problem.")
logger.error("zephyr: Including some Zulips that we did receive on the Zulip end.")
logger.error("zephyr: This suggests we have a zulip=>zephyr mirroring problem.")
logger.error("zephyr: aka the personals mirroring script has issues.")
if h_missing_z:
logger.error("humbug: Didn't receive all the Zephyrs we sent on the Humbug end!")
logger.error("zulip: Didn't receive all the Zephyrs we sent on the Zulip end!")
if h_missing_z == z_missing_z:
logger.error("humbug: Including some Zephyrs that we did receive on the Zephyr end.")
logger.error("humbug: This suggests we have a zephyr=>humbug mirroring problem.")
logger.error("humbug: aka the global class mirroring script has issues.")
logger.error("zulip: Including some Zephyrs that we did receive on the Zephyr end.")
logger.error("zulip: This suggests we have a zephyr=>zulip mirroring problem.")
logger.error("zulip: aka the global class mirroring script has issues.")
print_status_and_exit(1)

View file

@ -1,4 +1,4 @@
# Humbug Inc's internal git plugin configuration.
# Zulip, Inc's internal git plugin configuration.
# The plugin and example config are under api/integrations/
# Leaving all the instructions out of this file to avoid having to

View file

@ -1,4 +1,4 @@
# Humbug Inc's internal trac plugin configuration.
# Zulip, Inc's internal trac plugin configuration.
# The plugin and example config are under api/integrations/
# Leaving all the instructions out of this file to avoid having to

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python
# Copyright (C) 2012 Humbug, Inc.
# Copyright (C) 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
@ -26,7 +26,7 @@ from os import path, environ
# Configure this script as a Tddium post-build task and it will send
# messages to Humbug when a build finishes.
# messages to Zulip when a build finishes.
#
# Expects Tddium environment variables plus:
#
@ -64,5 +64,5 @@ result = client.send_message(dict(
(repo_name, environ['TDDIUM_BUILD_STATUS'], report_url)))
if result['result'] != 'success':
sys.stderr.write('Error sending to Humbug:\n%s\n' % (result['msg'],))
sys.stderr.write('Error sending to Zulip:\n%s\n' % (result['msg'],))
sys.exit(1)

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python
# Copyright (C) 2012 Humbug, Inc.
# Copyright (C) 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python
# Copyright (C) 2012 Humbug, Inc.
# Copyright (C) 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
@ -143,7 +143,7 @@ def send_humbug(zeph):
message['time'] = zeph['time']
message['sender'] = to_humbug_username(zeph['sender'])
if "subject" in zeph:
# Truncate the subject to the current limit in Humbug. No
# Truncate the subject to the current limit in Zulip. No
# need to do this for stream names, since we're only
# subscribed to valid stream names.
message["subject"] = zeph["subject"][:60]
@ -952,6 +952,6 @@ or specify the --api-key-file option.""" % (options.api_key_file,))))
if options.shard is not None:
logger_name += "(%s)" % (options.shard,)
configure_logger(logger, logger_name)
# Have the kernel reap children for when we fork off processes to send Humbugs
# Have the kernel reap children for when we fork off processes to send Zulips
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
zephyr_to_humbug(options)

View file

@ -16,7 +16,7 @@ import humbug
RSS_DATA_DIR = os.path.expanduser(os.path.join('~', '.cache', 'humbug-rss'))
OLDNESS_THRESHOLD = 30 # days
usage = """Usage: Send summaries of RSS entries for your favorite feeds to Humbug.
usage = """Usage: Send summaries of RSS entries for your favorite feeds to Zulip.
This bot requires the feedparser module.

View file

@ -19,7 +19,7 @@ parser = optparse.OptionParser(r"""
%prog --user foo@zulip.com --api-key a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5 --search="@nprnews,quantum physics"
Send Twitter search results to a Humbug stream.
Send Twitter search results to a Zulip stream.
Depends on: twitter-python

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2013 Humbug, Inc.
# Copyright © 2013 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2013 Humbug, Inc.
# Copyright © 2013 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -49,9 +49,9 @@ def commit_notice_destination(repo, branch, commit):
# Return None for cases where you don't want a notice sent
return None
## If properly installed, the Humbug API should be in your import
## If properly installed, the Zulip API should be in your import
## path, but if not, set a custom path below
HUMBUG_API_PATH = None
# This should not need to change unless you have a custom Humbug subdomain.
# This should not need to change unless you have a custom Zulip subdomain.
HUMBUG_SITE = "https://api.zulip.com"

View file

@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Humbug notification post-receive hook.
# Copyright © 2012-2013 Humbug, Inc.
# Zulip notification post-receive hook.
# Copyright © 2012-2013 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Humbug, Inc
* Copyright (c) 2013 Zulip, Inc
*/
package org.humbug.jira
@ -20,7 +20,7 @@ import org.apache.commons.httpclient.NameValuePair
class HumbugListener extends AbstractIssueEventListener {
Logger LOGGER = Logger.getLogger(HumbugListener.class.getName());
// The email address of one of the bots you created on your Humbug settings page.
// The email address of one of the bots you created on your Zulip settings page.
String humbugEmail = ""
// That bot's API key.
String humbugAPIKey = ""
@ -113,7 +113,7 @@ class HumbugListener extends AbstractIssueEventListener {
for (NameValuePair pair: parameters) {
params += "\n" + pair.getName() + ":" + pair.getValue()
}
LOGGER.log(Level.SEVERE, "Error sending Humbug message:\n" + response + "\n\n" +
LOGGER.log(Level.SEVERE, "Error sending Zulip message:\n" + response + "\n\n" +
"We sent:" + params)
}
return response;

View file

@ -9,7 +9,7 @@ define contact{
host_notification_commands notify-host-by-humbug
}
# Humbug commands
# Zulip commands
define command {
command_name notify-host-by-humbug
command_line /usr/local/share/humbug/integrations/nagios/nagios-notify-humbug --stream=nagios --type="$NOTIFICATIONTYPE$" --host="$HOSTADDRESS$" --state="$HOSTSTATE$" --output="$HOSTOUTPUT$" --long-output="$LONGHOSTOUTPUT$"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2013 Humbug, Inc.
# Copyright © 2013 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -49,9 +49,9 @@ def commit_notice_destination(path, commit):
# Return None for cases where you don't want a notice sent
return None
## If properly installed, the Humbug API should be in your import
## If properly installed, the Zulip API should be in your import
## path, but if not, set a custom path below
HUMBUG_API_PATH = None
# This should not need to change unless you have a custom Humbug subdomain.
# This should not need to change unless you have a custom Zulip subdomain.
HUMBUG_SITE = "https://api.zulip.com"

View file

@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Humbug notification post-commit hook.
# Copyright © 2012-2013 Humbug, Inc.
# Zulip notification post-commit hook.
# Copyright © 2012-2013 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -21,7 +21,7 @@
# THE SOFTWARE.
# Humbug trac plugin -- sends humbugs when tickets change.
# Zulip trac plugin -- sends humbugs when tickets change.
#
# Install by copying this file and humbug_trac_config.py to the trac
# plugins/ subdirectory, customizing the constants in

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Humbug, Inc.
# Copyright © 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -39,14 +39,14 @@ TRAC_BASE_TICKET_URL = "https://trac.example.com/ticket"
# type, versions, description, resolution, summary, comment)
#
# The following is the list of fields which can be changed without
# triggering a Humbug notification; change these to match your team's
# triggering a Zulip notification; change these to match your team's
# workflow.
TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment",
"owner"]
## If properly installed, the Humbug API should be in your import
## If properly installed, the Zulip API should be in your import
## path, but if not, set a custom path below
HUMBUG_API_PATH = None
# This should not need to change unless you have a custom Humbug subdomain.
# This should not need to change unless you have a custom Zulip subdomain.
HUMBUG_SITE = "https://api.zulip.com"

View file

@ -14,8 +14,8 @@ def recur_expand(target_root, dir):
setup(name='humbug',
version=humbug.__version__,
description='Bindings for the Humbug message API',
author='Humbug, Inc.',
description='Bindings for the Zulip message API',
author='Zulip, Inc.',
author_email='humbug@humbughq.com',
classifiers=[
'Development Status :: 3 - Alpha',