From d8f13837d95742f87eae31c900b808f11fba290d Mon Sep 17 00:00:00 2001
From: Luke Faraone <lfaraone@humbughq.com>
Date: Thu, 31 Jan 2013 14:09:01 -0500
Subject: [PATCH] Move files around in the API.

Bots are not part of what we distribute, so put them in the repo root.

We also updated some of the bots to use relative path names.

(imported from commit 0471d863450712fd0cdb651f39f32e9041df52ba)
---
 humbug/README => README                          | 0
 {humbug/bin => bin}/humbug-send                  | 0
 {humbug/bots => bots}/__init__.py                | 0
 {humbug/bots => bots}/check-mirroring            | 0
 {humbug/bots => bots}/check_send_receive.py      | 0
 {humbug/bots => bots}/feedback-bot               | 0
 {humbug/bots => bots}/gcal-bot                   | 2 +-
 {humbug/bots => bots}/humbug_trac.py             | 1 +
 {humbug/bots => bots}/send-nagios-notification   | 2 +-
 {humbug/bots => bots}/tddium-notify-humbug       | 2 +-
 {humbug/bots => bots}/twitter-bot.py             | 2 +-
 {humbug/bots => bots}/zephyr-mirror-crontab      | 0
 {humbug/bots => bots}/zephyr_mirror.py           | 0
 {humbug/bots => bots}/zephyr_mirror_backend.py   | 0
 {humbug/examples => examples}/curl-examples      | 0
 {humbug/examples => examples}/get-public-streams | 0
 {humbug/examples => examples}/humbugrc           | 0
 {humbug/examples => examples}/list-subscriptions | 0
 {humbug/examples => examples}/print-messages     | 0
 {humbug/examples => examples}/print-next-message | 0
 {humbug/examples => examples}/send-message       | 0
 {humbug/examples => examples}/subscribe          | 0
 {humbug/examples => examples}/unsubscribe        | 0
 23 files changed, 5 insertions(+), 4 deletions(-)
 rename humbug/README => README (100%)
 rename {humbug/bin => bin}/humbug-send (100%)
 rename {humbug/bots => bots}/__init__.py (100%)
 rename {humbug/bots => bots}/check-mirroring (100%)
 rename {humbug/bots => bots}/check_send_receive.py (100%)
 rename {humbug/bots => bots}/feedback-bot (100%)
 rename {humbug/bots => bots}/gcal-bot (98%)
 rename {humbug/bots => bots}/humbug_trac.py (98%)
 rename {humbug/bots => bots}/send-nagios-notification (96%)
 rename {humbug/bots => bots}/tddium-notify-humbug (97%)
 rename {humbug/bots => bots}/twitter-bot.py (98%)
 rename {humbug/bots => bots}/zephyr-mirror-crontab (100%)
 rename {humbug/bots => bots}/zephyr_mirror.py (100%)
 rename {humbug/bots => bots}/zephyr_mirror_backend.py (100%)
 rename {humbug/examples => examples}/curl-examples (100%)
 rename {humbug/examples => examples}/get-public-streams (100%)
 rename {humbug/examples => examples}/humbugrc (100%)
 rename {humbug/examples => examples}/list-subscriptions (100%)
 rename {humbug/examples => examples}/print-messages (100%)
 rename {humbug/examples => examples}/print-next-message (100%)
 rename {humbug/examples => examples}/send-message (100%)
 rename {humbug/examples => examples}/subscribe (100%)
 rename {humbug/examples => examples}/unsubscribe (100%)

diff --git a/humbug/README b/README
similarity index 100%
rename from humbug/README
rename to README
diff --git a/humbug/bin/humbug-send b/bin/humbug-send
similarity index 100%
rename from humbug/bin/humbug-send
rename to bin/humbug-send
diff --git a/humbug/bots/__init__.py b/bots/__init__.py
similarity index 100%
rename from humbug/bots/__init__.py
rename to bots/__init__.py
diff --git a/humbug/bots/check-mirroring b/bots/check-mirroring
similarity index 100%
rename from humbug/bots/check-mirroring
rename to bots/check-mirroring
diff --git a/humbug/bots/check_send_receive.py b/bots/check_send_receive.py
similarity index 100%
rename from humbug/bots/check_send_receive.py
rename to bots/check_send_receive.py
diff --git a/humbug/bots/feedback-bot b/bots/feedback-bot
similarity index 100%
rename from humbug/bots/feedback-bot
rename to bots/feedback-bot
diff --git a/humbug/bots/gcal-bot b/bots/gcal-bot
similarity index 98%
rename from humbug/bots/gcal-bot
rename to bots/gcal-bot
index f51d5f93..45c0f772 100755
--- a/humbug/bots/gcal-bot
+++ b/bots/gcal-bot
@@ -10,7 +10,7 @@ import itertools
 import traceback
 from os import path
 
-sys.path.append(path.join(path.dirname(__file__), '..'))
+sys.path.append(path.join(path.dirname(__file__), '../api'))
 import humbug
 
 parser = optparse.OptionParser(r"""
diff --git a/humbug/bots/humbug_trac.py b/bots/humbug_trac.py
similarity index 98%
rename from humbug/bots/humbug_trac.py
rename to bots/humbug_trac.py
index 2e1bf2e5..8b96dc75 100644
--- a/humbug/bots/humbug_trac.py
+++ b/bots/humbug_trac.py
@@ -18,6 +18,7 @@ from trac.core import Component, implements
 from trac.ticket import ITicketChangeListener
 import sys
 
+# This script lives on one machine, so an absolute path is fine.
 sys.path.append("/home/humbug/humbug/api")
 import humbug
 client = humbug.Client(
diff --git a/humbug/bots/send-nagios-notification b/bots/send-nagios-notification
similarity index 96%
rename from humbug/bots/send-nagios-notification
rename to bots/send-nagios-notification
index 3caa0ca8..0efc71d5 100755
--- a/humbug/bots/send-nagios-notification
+++ b/bots/send-nagios-notification
@@ -3,7 +3,7 @@ import sys
 import optparse
 from os import path
 
-sys.path.append(path.join(path.dirname(__file__), '..'))
+sys.path.append(path.join(path.dirname(__file__), '../api'))
 import humbug
 
 # Nagios passes the notification details as command line options.
diff --git a/humbug/bots/tddium-notify-humbug b/bots/tddium-notify-humbug
similarity index 97%
rename from humbug/bots/tddium-notify-humbug
rename to bots/tddium-notify-humbug
index 96f89e54..9c01819c 100755
--- a/humbug/bots/tddium-notify-humbug
+++ b/bots/tddium-notify-humbug
@@ -42,7 +42,7 @@ from os import path, environ
 # Here we assume it's in the parent of the directory
 # where this script lives.
 
-humbug_directory = path.join(path.dirname(__file__), '..')
+humbug_directory = path.join(path.dirname(__file__), '../api')
 
 
 sys.path.append(humbug_directory)
diff --git a/humbug/bots/twitter-bot.py b/bots/twitter-bot.py
similarity index 98%
rename from humbug/bots/twitter-bot.py
rename to bots/twitter-bot.py
index 3cf9c310..29a8dd31 100755
--- a/humbug/bots/twitter-bot.py
+++ b/bots/twitter-bot.py
@@ -7,7 +7,7 @@ from os import path
 
 CONFIGFILE = os.path.expanduser("~/.humbug_twitterrc")
 
-sys.path.append(path.join(path.dirname(__file__), '../..'))
+sys.path.append(path.join(path.dirname(__file__), '../api'))
 import humbug
 
 def write_config(config, since_id, user):
diff --git a/humbug/bots/zephyr-mirror-crontab b/bots/zephyr-mirror-crontab
similarity index 100%
rename from humbug/bots/zephyr-mirror-crontab
rename to bots/zephyr-mirror-crontab
diff --git a/humbug/bots/zephyr_mirror.py b/bots/zephyr_mirror.py
similarity index 100%
rename from humbug/bots/zephyr_mirror.py
rename to bots/zephyr_mirror.py
diff --git a/humbug/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py
similarity index 100%
rename from humbug/bots/zephyr_mirror_backend.py
rename to bots/zephyr_mirror_backend.py
diff --git a/humbug/examples/curl-examples b/examples/curl-examples
similarity index 100%
rename from humbug/examples/curl-examples
rename to examples/curl-examples
diff --git a/humbug/examples/get-public-streams b/examples/get-public-streams
similarity index 100%
rename from humbug/examples/get-public-streams
rename to examples/get-public-streams
diff --git a/humbug/examples/humbugrc b/examples/humbugrc
similarity index 100%
rename from humbug/examples/humbugrc
rename to examples/humbugrc
diff --git a/humbug/examples/list-subscriptions b/examples/list-subscriptions
similarity index 100%
rename from humbug/examples/list-subscriptions
rename to examples/list-subscriptions
diff --git a/humbug/examples/print-messages b/examples/print-messages
similarity index 100%
rename from humbug/examples/print-messages
rename to examples/print-messages
diff --git a/humbug/examples/print-next-message b/examples/print-next-message
similarity index 100%
rename from humbug/examples/print-next-message
rename to examples/print-next-message
diff --git a/humbug/examples/send-message b/examples/send-message
similarity index 100%
rename from humbug/examples/send-message
rename to examples/send-message
diff --git a/humbug/examples/subscribe b/examples/subscribe
similarity index 100%
rename from humbug/examples/subscribe
rename to examples/subscribe
diff --git a/humbug/examples/unsubscribe b/examples/unsubscribe
similarity index 100%
rename from humbug/examples/unsubscribe
rename to examples/unsubscribe