irc / pavement.py

import os
import re

from paver.easy import *
from paver.setuputils import setup

def get_version():
    """
    Grab the version from irclib.py.
    """
    here = os.path.dirname(__file__)
    irclib = os.path.join(here, 'irclib.py')
    with open(irclib) as f:
        content = f.read()
    VERSION = eval(re.search('VERSION = (.*)', content).group(1))
    VERSION = '.'.join(map(str, VERSION))
    return VERSION

def read_long_description():
    f = open('README')
    try:
        data = f.read()
    finally:
        f.close()
    return data

setup(
        name="python-irclib",
        description="IRC (Internet Relay Chat) protocol client library for Python",
        long_description=read_long_description(),
        version=get_version(),
        py_modules=["irclib", "ircbot"],
        author="Joel Rosdahl",
        author_email="joel@rosdahl.net",
        maintainer="Jason R. Coombs",
        maintainer_email="jaraco@jaraco.com",
        url="http://python-irclib.sourceforge.net",
        classifiers = [
                "Development Status :: 5 - Production/Stable",
                "Intended Audience :: Developers",
                "Programming Language :: Python :: 2.3",
                "Programming Language :: Python :: 2.4",
                "Programming Language :: Python :: 2.5",
                "Programming Language :: Python :: 2.6",
                "Programming Language :: Python :: 2.7",
        ],
)

@task
def generate_specfile():
    with open('python-irclib.spec.in', 'rb') as f:
        content = f.read()
    content = content.replace('%%VERSION%%', get_version())
    with open('python-irclib.spec', 'wb') as f:
        f.write(content)

@task
@needs('generate_setup', 'generate_specfile', 'minilib', 'distutils.command.sdist')
def sdist():
    "Override sdist to make sure the setup.py gets generated"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.