Rename api.common to humbug

Fixes #482.

(imported from commit 1bd6a7fd993d8d5e225e0311c288dbce0c369a40)
This commit is contained in:
Keegan McAllister 2012-12-03 12:23:06 -05:00
parent 4bfd784423
commit f9f8a6e603
14 changed files with 97 additions and 80 deletions

View file

@ -6,6 +6,7 @@ import os
import random
import logging
import subprocess
from os import path
parser = optparse.OptionParser()
parser.add_option('--verbose',
@ -33,9 +34,10 @@ mit_user = 'tabbott/extra@ATHENA.MIT.EDU'
humbug_user = 'tabbott/extra@mit.edu'
sys.path.append(".")
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import api.common
humbug_client = api.common.HumbugAPI(email=humbug_user,
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
humbug_client = humbug.HumbugAPI(
email=humbug_user,
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
verbose=True,
client="test: Humbug API",

View file

@ -2,14 +2,17 @@
import sys
import os
import optparse
from os import path
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
import api.common
prod_client = api.common.HumbugAPI(email="feedback@humbughq.com",
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
prod_client = humbug.HumbugAPI(
email="feedback@humbughq.com",
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
verbose=True,
site="https://humbughq.com")
staging_client = api.common.HumbugAPI(email="feedback@humbughq.com",
staging_client = humbug.HumbugAPI(
email="feedback@humbughq.com",
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
verbose=True,
site="https://staging.humbughq.com")

View file

@ -10,8 +10,8 @@ import itertools
import traceback
from os import path
sys.path.append(path.join(path.dirname(__file__), '../..'))
import api.common
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
parser = optparse.OptionParser(r"""
@ -91,7 +91,8 @@ def get_calendar_url():
calendar_url = get_calendar_url()
humbug = api.common.HumbugAPI(email=options.user,
humbug = humbug.HumbugAPI(
email=options.user,
api_key=options.api_key,
site=options.site,
verbose=True)

View file

@ -18,9 +18,10 @@ from trac.core import Component, implements
from trac.ticket import ITicketChangeListener
import sys
sys.path.append("/home/humbug/humbug")
import api.common
client = api.common.HumbugAPI(email="humbug+trac@humbughq.com",
sys.path.append("/home/humbug/humbug/api")
import humbug
client = humbug.HumbugAPI(
email="humbug+trac@humbughq.com",
site="https://staging.humbughq.com",
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")

View file

@ -3,8 +3,8 @@ import sys
import optparse
from os import path
sys.path.append(path.join(path.dirname(__file__), '../..'))
import api.common
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
# Nagios passes the notification details as command line options.
# In Nagios, "output" means "first line of output", and "long
@ -43,7 +43,7 @@ if output:
# Block-quote any command output.
msg['content'] += ('\n\n' + '\n'.join('> ' + ln for ln in output.splitlines()))
client = api.common.HumbugAPI(
client = humbug.HumbugAPI(
email = 'humbug+nagios@humbughq.com',
api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
site = 'https://staging.humbughq.com')

View file

@ -774,7 +774,9 @@ if __name__ == "__main__":
(options, args) = parse_args()
sys.path[:0] = [options.root_path, os.path.join(options.root_path, "python-zephyr"),
sys.path[:0] = [options.root_path,
os.path.join(options.root_path, 'api'),
os.path.join(options.root_path, "python-zephyr"),
os.path.join(options.root_path, "python-zephyr/build/lib.linux-x86_64-2.6/")]
# In case this is an automated restart of the mirroring script,
@ -794,8 +796,9 @@ or specify the --api-key-file option.""" % (options.api_key_file,)))
# don't need to read it in
os.environ["HUMBUG_API_KEY"] = api_key
import api.common
humbug_client = api.common.HumbugAPI(email=options.user + "@mit.edu",
import humbug
humbug_client = humbug.HumbugAPI(
email=options.user + "@mit.edu",
api_key=api_key,
verbose=True,
client="zephyr_mirror",

View file

@ -37,9 +37,10 @@ parser.add_option('--api-key')
parser.add_option('--user')
(options, args) = parser.parse_args()
sys.path.append(path.join(path.dirname(__file__), '../..'))
import api.common
client = api.common.HumbugAPI(email=options.user,
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
client = humbug.HumbugAPI(
email=options.user,
api_key=options.api_key,
verbose=True,
site=options.site)

View file

@ -37,9 +37,10 @@ parser.add_option('--api-key')
parser.add_option('--user')
(options, args) = parser.parse_args()
sys.path.append(path.join(path.dirname(__file__), '../..'))
import api.common
client = api.common.HumbugAPI(email=options.user,
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
client = humbug.HumbugAPI(
email=options.user,
api_key=options.api_key,
verbose=True,
site=options.site)

View file

@ -37,9 +37,10 @@ parser.add_option('--api-key')
parser.add_option('--user')
(options, args) = parser.parse_args()
sys.path.append(path.join(path.dirname(__file__), '../..'))
import api.common
client = api.common.HumbugAPI(email=options.user,
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
client = humbug.HumbugAPI(
email=options.user,
api_key=options.api_key,
verbose=True,
site=options.site)

View file

@ -37,9 +37,10 @@ parser.add_option('--api-key')
parser.add_option('--user')
(options, args) = parser.parse_args()
sys.path.append(path.join(path.dirname(__file__), '../..'))
import api.common
client = api.common.HumbugAPI(email=options.user,
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
client = humbug.HumbugAPI(
email=options.user,
api_key=options.api_key,
verbose=True,
site=options.site)

View file

@ -44,9 +44,10 @@ parser.add_option('--type', default='private')
if len(args) == 0:
parser.error("You must specify recipients")
sys.path.append(path.join(path.dirname(__file__), '../..'))
import api.common
client = api.common.HumbugAPI(email=options.sender,
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
client = humbug.HumbugAPI(
email=options.sender,
api_key=options.api_key,
verbose=True,
site=options.site)

View file

@ -38,9 +38,10 @@ parser.add_option('--site', default='https://humbughq.com')
parser.add_option('--streams', default='')
(options, args) = parser.parse_args()
sys.path.append(path.join(path.dirname(__file__), '../..'))
import api.common
client = api.common.HumbugAPI(email=options.user,
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
client = humbug.HumbugAPI(
email=options.user,
api_key=options.api_key,
verbose=True,
site=options.site)

View file

@ -38,9 +38,10 @@ parser.add_option('--site', default='https://humbughq.com')
parser.add_option('--streams', default='')
(options, args) = parser.parse_args()
sys.path.append(path.join(path.dirname(__file__), '../..'))
import api.common
client = api.common.HumbugAPI(email=options.user,
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug
client = humbug.HumbugAPI(
email=options.user,
api_key=options.api_key,
verbose=True,
site=options.site)