<commit_before>#!/usr/bin/env python
# $Id$

import sys
from distutils.core import setup, Extension

if 'sunos' in sys.platform:
    libraries = ["sendfile"]
else:
    libraries = []

def main():
    setup(name = 'py-sendfile',
          version = '2.0.0',
          description = 'A Python interface to sendfile(2)',
          url = 'http://code.google.com/p/py-sendfile/',
          classifiers = [
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Operating System :: POSIX :: Linux',
              'Operating System :: MacOS :: MacOS X',
              'Operating System :: POSIX :: BSD :: FreeBSD',
              'Operating System :: POSIX :: SunOS/Solaris',
              'Operating System :: POSIX :: AIX',
              'Programming Language :: C',
              'Programming Language :: Python :: 2.4',
              'Programming Language :: Python :: 2.5',
              'Programming Language :: Python :: 2.6',
              'Programming Language :: Python :: 2.7',
              'Programming Language :: Python :: 3',
              'Programming Language :: Python :: 3.0',
              'Programming Language :: Python :: 3.1',
              'Programming Language :: Python :: 3.2',
              'Topic :: System :: Networking',
              'Topic :: System :: Operating System',
              'Topic :: Internet :: File Transfer Protocol (FTP)',
              'Topic :: Internet :: WWW/HTTP',
              'License :: OSI Approved :: GNU Library or Lesser General ' \
                                          'Public License (LGPL)',
               ],
          ext_modules = [Extension('sendfile',
                                   sources=['sendfilemodule.c'],
                                   libraries=libraries)],
          )
    # check for NotImplementedError exception if platform is not supported
    import sendfile
    try:
        sendfile.sendfile(0, 0, 0, 0)
    except NotImplementedError:
        raise NotImplementedError("platform %r not supported" % sys.platform)
    except:
        pass


if __name__ == '__main__':
    main()

<commit_msg>use setuptools in setup.py, if possible<commit_after>#!/usr/bin/env python
# $Id$

import sys
try:
    from setuptools import setup, Extension
except ImportError:
    from distutils.core import setup, Extension

if 'sunos' in sys.platform:
    libraries = ["sendfile"]
else:
    libraries = []

def main():
    setup(name = 'py-sendfile',
          version = '2.0.0',
          description = 'A Python interface to sendfile(2)',
          url = 'http://code.google.com/p/py-sendfile/',
          classifiers = [
              'Development Status :: 4 - Beta',
              'Intended Audience :: Developers',
              'Operating System :: POSIX :: Linux',
              'Operating System :: MacOS :: MacOS X',
              'Operating System :: POSIX :: BSD :: FreeBSD',
              'Operating System :: POSIX :: SunOS/Solaris',
              'Operating System :: POSIX :: AIX',
              'Programming Language :: C',
              'Programming Language :: Python :: 2.4',
              'Programming Language :: Python :: 2.5',
              'Programming Language :: Python :: 2.6',
              'Programming Language :: Python :: 2.7',
              'Programming Language :: Python :: 3',
              'Programming Language :: Python :: 3.0',
              'Programming Language :: Python :: 3.1',
              'Programming Language :: Python :: 3.2',
              'Programming Language :: Python :: 3.3',
              'Topic :: System :: Networking',
              'Topic :: System :: Operating System',
              'Topic :: Internet :: File Transfer Protocol (FTP)',
              'Topic :: Internet :: WWW/HTTP',
              'License :: OSI Approved :: GNU Library or Lesser General ' \
                                          'Public License (LGPL)',
               ],
          ext_modules = [Extension('sendfile',
                                   sources=['sendfilemodule.c'],
                                   libraries=libraries)],
          )
    # check for NotImplementedError exception if platform is not supported
    import sendfile
    try:
        sendfile.sendfile(0, 0, 0, 0)
    except NotImplementedError:
        raise NotImplementedError("platform %r not supported" % sys.platform)
    except:
        pass


if __name__ == '__main__':
    main()


{'fraction_non_alphanumeric': 0.12274774774774774, 'fraction_numerical': 0.01126126126126126, 'mean_word_length': 1.7212009803921569, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6210999', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1119, 'n_words': 333}