diff --git a/.gitignore b/.gitignore index 5ebd21a..bcb706d 100644 --- a/.gitignore +++ b/.gitignore @@ -145,6 +145,7 @@ var sdist develop-eggs .installed.cfg +MANIFEST # Installer logs pip-log.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..8defce4 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2012 K R Ericson +Inspired & derived from Daniel R. Craig's pingdom wrapper + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..f218bf2 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include *.rst +include *.txt diff --git a/README.rst b/README.rst index 4c45d63..c668581 100644 --- a/README.rst +++ b/README.rst @@ -14,9 +14,13 @@ None beyond the Python standard library. Usage ----- +Install:: + + pip install python-simple-hipchat + Instantiate:: - import hipchat.py + import hipchat hipster = hipchat.HipChat(token=YourHipChatToken) Request a URI endpoint as described in the HipChat API docs:: @@ -27,10 +31,10 @@ Example methods:: # List rooms hipster.method('rooms/list') - + # Post a message to a HipChat room hipster.method('rooms/message', method='POST', parameters={'room_id': 8675309, 'from': 'HAL', 'message': 'All your base...'}) - + Two handy shortcut methods:: # List rooms, print response JSON diff --git a/hipchat.py b/hipchat/__init__.py similarity index 67% rename from hipchat.py rename to hipchat/__init__.py index b8b87c5..9381a25 100644 --- a/hipchat.py +++ b/hipchat/__init__.py @@ -1,26 +1,3 @@ -# The MIT License -# -# Copyright (c) 2012 K R Ericson -# Inspired & derived from Daniel R. Craig's pingdom wrapper -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - from urlparse import urljoin from urllib import urlencode import urllib2 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..1183a81 --- /dev/null +++ b/setup.py @@ -0,0 +1,11 @@ +from distutils.core import setup + +setup( + name='python-simple-hipchat', + url='https://github.com/kurttheviking/python-simple-hipchat', + version='0.1', + packages=['hipchat'], + author='Kurt Ericson', + license='MIT', + long_description=open('README.rst').read() +)