From 0c3eba53317bc20e051c09cf20c3ea2953cac6f8 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 7 Aug 2013 12:01:49 -0400 Subject: [PATCH] Rename Humbug-based variables in Trac plugin. (imported from commit 5d406cb6c5fe7b1fbd4da706f7ac6bb6e381cadb) --- bots/zulip_trac_config.py | 11 +++++------ .../trac/{humbug_trac.py => zulip_trac.py} | 18 +++++++++--------- integrations/trac/zulip_trac_config.py | 13 ++++++------- 3 files changed, 20 insertions(+), 22 deletions(-) rename integrations/trac/{humbug_trac.py => zulip_trac.py} (92%) diff --git a/bots/zulip_trac_config.py b/bots/zulip_trac_config.py index f413298..7769058 100644 --- a/bots/zulip_trac_config.py +++ b/bots/zulip_trac_config.py @@ -4,12 +4,11 @@ # Leaving all the instructions out of this file to avoid having to # sync them as we update the comments. -HUMBUG_USER = "trac-bot@zulip.com" -HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +ZULIP_USER = "trac-bot@zulip.com" +ZULIP_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" STREAM_FOR_NOTIFICATIONS = "trac" TRAC_BASE_TICKET_URL = "https://trac.humbughq.com/ticket" -TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment", - "owner"] -HUMBUG_API_PATH = "/home/humbug/humbug/api" -HUMBUG_SITE = "https://staging.zulip.com" +TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment", "owner"] +ZULIP_API_PATH = "/home/humbug/humbug/api" +ZULIP_SITE = "https://staging.zulip.com" diff --git a/integrations/trac/humbug_trac.py b/integrations/trac/zulip_trac.py similarity index 92% rename from integrations/trac/humbug_trac.py rename to integrations/trac/zulip_trac.py index 3478f4e..0c21002 100644 --- a/integrations/trac/humbug_trac.py +++ b/integrations/trac/zulip_trac.py @@ -21,15 +21,15 @@ # THE SOFTWARE. -# Zulip trac plugin -- sends humbugs when tickets change. +# Zulip trac plugin -- sends zulips when tickets change. # # Install by copying this file and zulip_trac_config.py to the trac # plugins/ subdirectory, customizing the constants in -# zulip_trac_config.py, and then adding "humbug_trac" to the +# zulip_trac_config.py, and then adding "zulip_trac" to the # components section of the conf/trac.ini file, like so: # # [components] -# humbug_trac = enabled +# zulip_trac = enabled # # You may then need to restart trac (or restart Apache) for the bot # (or changes to the bot) to actually be loaded by trac. @@ -41,14 +41,14 @@ import os.path sys.path.insert(0, os.path.dirname(__file__)) import zulip_trac_config as config -if config.HUMBUG_API_PATH is not None: - sys.path.append(config.HUMBUG_API_PATH) +if config.ZULIP_API_PATH is not None: + sys.path.append(config.ZULIP_API_PATH) import zulip client = zulip.Client( - email=config.HUMBUG_USER, - site=config.HUMBUG_SITE, - api_key=config.HUMBUG_API_KEY) + email=config.ZULIP_USER, + site=config.ZULIP_SITE, + api_key=config.ZULIP_API_KEY) def markdown_ticket_url(ticket, heading="ticket"): return "[%s #%s](%s/%s)" % (heading, ticket.id, config.TRAC_BASE_TICKET_URL, ticket.id) @@ -72,7 +72,7 @@ def send_update(ticket, content): "subject": trac_subject(ticket) }) -class HumbugPlugin(Component): +class ZulipPlugin(Component): implements(ITicketChangeListener) def ticket_created(self, ticket): diff --git a/integrations/trac/zulip_trac_config.py b/integrations/trac/zulip_trac_config.py index ee27d92..8636008 100644 --- a/integrations/trac/zulip_trac_config.py +++ b/integrations/trac/zulip_trac_config.py @@ -20,11 +20,11 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# See humbug_trac.py for installation and configuration instructions +# See zulip_trac.py for installation and configuration instructions # Change these constants to configure the plugin: -HUMBUG_USER = "trac-bot@example.com" -HUMBUG_API_KEY = "0123456789abcdef0123456789abcdef" +ZULIP_USER = "trac-bot@example.com" +ZULIP_API_KEY = "0123456789abcdef0123456789abcdef" STREAM_FOR_NOTIFICATIONS = "trac" TRAC_BASE_TICKET_URL = "https://trac.example.com/ticket" @@ -41,12 +41,11 @@ TRAC_BASE_TICKET_URL = "https://trac.example.com/ticket" # The following is the list of fields which can be changed without # triggering a Zulip notification; change these to match your team's # workflow. -TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment", - "owner"] +TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment", "owner"] ## If properly installed, the Zulip API should be in your import ## path, but if not, set a custom path below -HUMBUG_API_PATH = None +ZULIP_API_PATH = None # This should not need to change unless you have a custom Zulip subdomain. -HUMBUG_SITE = "https://api.zulip.com" +ZULIP_SITE = "https://api.zulip.com"