transifex / setup.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import glob
from codecs import BOM

from setuptools import setup, find_packages
from setuptools.command.build_py import build_py as _build_py

from transifex.txcommon import version

readme_file = open(u'README')
long_description = readme_file.read()
readme_file.close()
if long_description.startswith(BOM):
    long_description = long_description.lstrip(BOM)
long_description = long_description.decode('utf-8')

package_data = {
    '': ['LICENCE', 'README'],
}

def buildlanguages():
    import django.core.management.commands.compilemessages as c
    oldpath = os.getcwd()
    os.chdir(os.path.join(os.path.dirname(__FILE__), 'transifex',
        'locale'))
    c.compile_messages()
    os.chdir(oldpath)

class build_py(_build_py):
    def run(self):
        buildlanguages()
        _build_py.run(self)

setup(
#    cmdclass={
#        'build_py': build_py,
#    },
    name="transifex",
    version=version,
    description="A platform for distributed translation submissions",
    long_description=long_description,
    author="The Transifex community and the staff of Indifex",
    author_email="transifex-devel@googlegroups.com",
    url="http://transifex.org/",
    license="GPLv2",
    dependency_links = [
        "http://dist.repoze.org/",
        "http://www.aeracode.org/releases/south/",
        "http://transifex.org/files/deps/",
        "http://pypi.python.org/simple",
    ],
    setup_requires = [
        "Django >= 1.0",
        "Pygments >= 0.9",
        "Sphinx >= 0.4.2",
    ],
    install_requires = [
        "Django >= 1.0",
        "urlgrabber",
        "markdown",
        "userprofile",
        "httplib2",
        "polib >= 0.5.1",
        "Pygments >= 0.9",
        "PIL == 1.1.6",
        "contact_form >= 0.3", # hg 97559a887345 or newer
        "django-authority",
        "django-filter >= 0.1",
        "django-notification >= 0.1.2",
        "django-pagination >= 1.0.5",
        "django-piston",
        "django-sorting >= 0.1.2",
        "tagging >= 0.3_pre",
        "South >= 0.6-rc1",
        "django-ajax-selects",
    ],
    data_files=[
        ('templates', glob.glob('transifex/templates/*.html')),
    ],

    zip_safe=False,
    packages=find_packages(),
    include_package_data=True,
    package_data = package_data,
    keywords = (
        'django.app',
        'translation localization internationalization vcs',),
    classifiers = [line for line in '''
Development Status :: 5 - Production/Stable
Environment :: Web Environment
Framework :: Django
Intended Audience :: Developers
License :: OSI Approved :: GNU General Public License (GPL)
Operating System :: OS Independent
Programming Language :: Python
Topic :: Software Development :: Localization
Topic :: Software Development :: Internationalization
#84 Natural Language :: Catalan
#84 Natural Language :: Chinese (Simplified)
Natural Language :: English
#84 Natural Language :: German
#84 Natural Language :: Greek
#84 Natural Language :: Hungarian
#84 Natural Language :: Italian
#84 Natural Language :: Macedonian
#84 Natural Language :: Malay
#84 Natural Language :: Persian
Natural Language :: Polish
#84 Natural Language :: Portuguese (Brazilian)
#84 Natural Language :: Romanian
#84 Natural Language :: Russian
#84 Natural Language :: Slovak
#84 Natural Language :: Spanish
#84 Natural Language :: Swedish'''.strip().split('\n')
        if not line.startswith('#')
    ],
)
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.