Skip to content

Commit

Permalink
Added setup.py w/ entry_point, updated README.rst, edits to reflect n…
Browse files Browse the repository at this point in the history
…ame change.
  • Loading branch information
bkjones committed Feb 20, 2012
1 parent a8a898f commit c7f0f50
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 7 deletions.
14 changes: 12 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
=================
What is Bunny?
What is Bunnyq?
=================


Bunny aims to be a RabbitMQ administration and testing/development swiss
Bunnyq aims to be a RabbitMQ administration and testing/development swiss
army knife. It allows you to do a large (and growing) number of tasks that are
supported by RabbitMQ's RESTful HTTP Management API. To get a list of current
tasks that are supported, run '?' from within the shell. Here's the output
Expand Down Expand Up @@ -41,5 +41,15 @@ Requirements
- pyrabbit (I wrote this too: http://pypi.python.org/pypi/pyrabbit)
- PyYaml (http://pypi.python.org/pypi/PyYAML)

Installation
------------------

::

$ sudo pip install bunnyq

Installation puts a command called 'bunnyq' in your path, so running
'bunnyq' at a command line should get you where you want to go. For help
run 'bunnyq --help', and for help with commands within the bunnyq shell, type
'?' in the bunnyq shell.

12 changes: 7 additions & 5 deletions bunny.py → bunnyq.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def wrapper(inst, args):

class Bunny(cmd.Cmd):
"""Represents a session between a client and a RabbitMQ server, so you can
pass commands using syntax like "bunny.connect(), bunny.delete_queue" etc.
pass commands using syntax like "bunnyq.connect(), bunnyq.delete_queue" etc.
"""

Expand Down Expand Up @@ -310,7 +310,7 @@ def do_exit(self):
return True

def do_options():
parser = argparse.ArgumentParser(prog='bunny',
parser = argparse.ArgumentParser(prog='bunnyq',
description="A CLI for interacting w/ the " \
"RabbitMQ Management API.")
parser.add_argument('-c', '--config', type=str, default=None,
Expand All @@ -335,14 +335,13 @@ def do_options():
args = parser.parse_args()
return args


if __name__ == '__main__':
def main():
args = do_options()

if args.config:
# if there's a config arg, there should also be a host arg.
if not args.rabbithost:
raise Exception("Specify a '-r' option so bunny knows where in "
raise Exception("Specify a '-r' option so bunnyq knows where in "
"the config to look for connection parameters.")
with open(args.config, 'r') as conf:
config = yaml.load(conf)
Expand All @@ -365,3 +364,6 @@ def do_options():
shell.onecmd(args.execute)
else:
shell.cmdloop()

if __name__ == '__main__':
main()
33 changes: 33 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from setuptools import setup, find_packages

version = '1.0'

setup(name='bunnyq',
version=version,
description="A command shell for testing/administering RabbitMQ " \
"using its RESTful HTTP Management API.",
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Topic :: Internet :: WWW/HTTP",
],
keywords='python http amqp rabbit rabbitmq management',
install_requires = ['pyyaml', 'pyrabbit', 'argparse'],
author='Brian K. Jones',
author_email='[email protected]',
url='http://www.github.com/bkjones/bunnyq',
download_url='http://www.github.com/bkjones/bunnyq',
license='MIT',
packages=find_packages(exclude='tests'),
include_package_data=False,
py_modules=['bunnyq'],
entry_points=dict(console_scripts=['bunnyq=bunnyq:main']),
zip_safe=False
)

0 comments on commit c7f0f50

Please sign in to comment.