From d7965aa803d9fc81733c622ffb5b94c09237b57a Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Sun, 31 Jul 2011 12:18:25 +0200 Subject: [PATCH] JabberBot 0.14 released --- AUTHORS | 1 + README | 6 +++++- jabberbot.py | 18 ++++++++++++++---- setup.py | 23 ++++++++++++++--------- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/AUTHORS b/AUTHORS index 1c9e1ef..e7a2402 100644 --- a/AUTHORS +++ b/AUTHORS @@ -12,4 +12,5 @@ Matthew Kemp David O'Rourke René Mayrhofer Andreas Zwinkau +Fabian Deutsch diff --git a/README b/README index 4a9f083..607164e 100644 --- a/README +++ b/README @@ -7,7 +7,11 @@ available at [2] (use [3] as Git clone URL). The contributors involved in this release can be found in the file AUTHORS. Example code that you can use to get started can be found in the "examples/" subdirectory. -You need to have the "xmpppy" module installed, as jabberbot depends on it. +Dependencies: + + * xmpppy (http://xmpppy.sf.net/) + On Debian-based systems, xmpppy is packaged as "python-xmpp" + [1] http://thp.io/2007/python-jabberbot/ [2] http://repo.or.cz/w/gpodder.git diff --git a/jabberbot.py b/jabberbot.py index 40d0896..65dd0e2 100644 --- a/jabberbot.py +++ b/jabberbot.py @@ -19,7 +19,14 @@ # along with this program. If not, see . # -"""A simple framework for creating Jabber/XMPP bots and services""" +""" +A framework for writing Jabber/XMPP bots and services + +The JabberBot framework allows you to easily write bots +that use the XMPP protocol. You can create commands by +decorating functions in your subclass or customize the +bot's operation completely. MUCs are also supported. +""" import os import re @@ -29,7 +36,10 @@ import cgi try: import xmpp except ImportError: - print >> sys.stderr, 'You need to install xmpppy from http://xmpppy.sf.net/.' + print >> sys.stderr, """ + You need to install xmpppy from http://xmpppy.sf.net/. + On Debian-based systems, install the python-xmpp package. + """ sys.exit(-1) import time @@ -39,9 +49,9 @@ import traceback # Will be parsed by setup.py to determine package metadata __author__ = 'Thomas Perl ' -__version__ = '0.13' +__version__ = '0.14' __website__ = 'http://thp.io/2007/python-jabberbot/' -__license__ = 'GPLv3 or later' +__license__ = 'GNU General Public License version 3 or later' def botcmd(*args, **kwargs): """Decorator for bot command functions""" diff --git a/setup.py b/setup.py index 81befba..ec630d7 100644 --- a/setup.py +++ b/setup.py @@ -1,29 +1,33 @@ #!/usr/bin/env python -# Setup script for python-jabberbot +# Generic setup script for single-module Python projects # by Thomas Perl from distutils.core import setup import re -jabberbot_py = open('jabberbot.py').read() -metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", jabberbot_py)) -docstrings = re.findall('"""(.*)"""', jabberbot_py) - -# How is the package going to be called? PACKAGE = 'jabberbot' +SCRIPT_FILE = PACKAGE + '.py' + +main_py = open(SCRIPT_FILE).read() +metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py)) +docstrings = re.findall('"""(.*?)"""', main_py, re.DOTALL) # List the modules that need to be installed/packaged MODULES = ( - 'jabberbot', + PACKAGE, ) -# Metadata fields extracted from jabberbot.py +# Metadata fields extracted from SCRIPT_FILE AUTHOR_EMAIL = metadata['author'] VERSION = metadata['version'] WEBSITE = metadata['website'] LICENSE = metadata['license'] -DESCRIPTION = docstrings[0] +DESCRIPTION = docstrings[0].strip() +if '\n\n' in DESCRIPTION: + DESCRIPTION, LONG_DESCRIPTION = DESCRIPTION.split('\n\n', 1) +else: + LONG_DESCRIPTION = None # Extract name and e-mail ("Firstname Lastname ") AUTHOR, EMAIL = re.match(r'(.*) <(.*)>', AUTHOR_EMAIL).groups() @@ -31,6 +35,7 @@ AUTHOR, EMAIL = re.match(r'(.*) <(.*)>', AUTHOR_EMAIL).groups() setup(name=PACKAGE, version=VERSION, description=DESCRIPTION, + long_description=LONG_DESCRIPTION, author=AUTHOR, author_email=EMAIL, license=LICENSE, -- 2.11.4.GIT