<commit_before>"""Calxeda: setup.py"""

# Copyright (c) 2012-2013, Calxeda Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Calxeda Inc. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.

from setuptools import setup

setup(
    name='cxmanage',
    version='0.10.0',
    packages=[
        'cxmanage_api',
        'cxmanage_api.cli',
        'cxmanage_api.cli.commands',
        'cxmanage_test'
    ],
    scripts=['scripts/cxmanage', 'scripts/sol_tabs', 'scripts/cxmux'],
    description='Calxeda Management Utility',
    # NOTE: As of right now, the pyipmi version requirement needs to be updated
    # at the top of scripts/cxmanage as well.
    install_requires=[
                        'tftpy',
                        'pexpect',
                        'pyipmi>=0.9.0',
                        'argparse',
                        'unittest-xml-reporting<1.6.0'
    ],
    extras_require={
        'docs': ['sphinx', 'cloud_sptheme'],
    },
    classifiers=[
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python :: 2.7']
)
<commit_msg>nojira: Bump to v0.10.1<commit_after>"""Calxeda: setup.py"""

# Copyright (c) 2012-2013, Calxeda Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Calxeda Inc. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.

from setuptools import setup

setup(
    name='cxmanage',
    version='0.10.1',
    packages=[
        'cxmanage_api',
        'cxmanage_api.cli',
        'cxmanage_api.cli.commands',
        'cxmanage_test'
    ],
    scripts=['scripts/cxmanage', 'scripts/sol_tabs', 'scripts/cxmux'],
    description='Calxeda Management Utility',
    # NOTE: As of right now, the pyipmi version requirement needs to be updated
    # at the top of scripts/cxmanage as well.
    install_requires=[
                        'tftpy',
                        'pexpect',
                        'pyipmi>=0.9.0',
                        'argparse',
                        'unittest-xml-reporting<1.6.0'
    ],
    extras_require={
        'docs': ['sphinx', 'cloud_sptheme'],
    },
    classifiers=[
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python :: 2.7']
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages

install_requires = [
    'django-modeldict>=1.2.0',
    'nexus>=0.2.3',
    'django-jsonfield>=0.9.2,!=0.9.13',
]

setup(
    name='gargoyle-yplan',
    version='1.0.0',
    author='DISQUS',
    author_email='opensource@disqus.com',
    maintainer='YPlan',
    maintainer_email='adam@yplanapp.com',
    url='https://github.com/yplan/gargoyle',
    description='Gargoyle is a platform built on top of Django which allows you to switch functionality of your application on and off based on conditions.',
    packages=find_packages(exclude=["example_project", "tests"]),
    zip_safe=False,
    install_requires=install_requires,
    license='Apache License 2.0',
    include_package_data=True,
    classifiers=[
        'Framework :: Django',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Operating System :: OS Independent',
        'Topic :: Software Development'
    ],
)
<commit_msg>Require nexus-yplan not nexus<commit_after>#!/usr/bin/env python
from setuptools import setup, find_packages

install_requires = [
    'django-modeldict>=1.2.0',
    'nexus-yplan>=1.0.0',
    'django-jsonfield>=0.9.2,!=0.9.13',
]

setup(
    name='gargoyle-yplan',
    version='1.0.0',
    author='DISQUS',
    author_email='opensource@disqus.com',
    maintainer='YPlan',
    maintainer_email='adam@yplanapp.com',
    url='https://github.com/yplan/gargoyle',
    description='Gargoyle is a platform built on top of Django which allows you to switch functionality of your application on and off based on conditions.',
    packages=find_packages(exclude=["example_project", "tests"]),
    zip_safe=False,
    install_requires=install_requires,
    license='Apache License 2.0',
    include_package_data=True,
    classifiers=[
        'Framework :: Django',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Operating System :: OS Independent',
        'Topic :: Software Development'
    ],
)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
"""`ushahidi_sphinx_rtd_theme` lives on `Github`_.

.. _github: https://www.github.com/snide/ushahidi_sphinx_rtd_theme

"""
from setuptools import setup
from ushahidi_sphinx_rtd_theme import __version__

setup(
    name='ushahidi_sphinx_rtd_theme',
    version=__version__,
    url='https://github.com/snide/ushahidi_sphinx_rtd_theme/',
    license='MIT',
    author='Dave Snider',
    author_email='dave.snider@gmail.com',
    description='ReadTheDocs.org theme for Sphinx, 2013 version.',
    long_description=open('README.rst').read(),
    zip_safe=False,
    packages=['ushahidi_sphinx_rtd_theme'],
    package_data={'ushahidi_sphinx_rtd_theme': [
        'theme.conf',
        '*.html',
        'static/css/*.css',
        'static/js/*.js',
        'static/font/*.*'
    ]},
    include_package_data=True,
    install_requires=open('requirements.txt').read().splitlines(),
    classifiers=[
        'Development Status :: 3 - Alpha',
        'License :: OSI Approved :: BSD License',
        'Environment :: Console',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Operating System :: OS Independent',
        'Topic :: Documentation',
        'Topic :: Software Development :: Documentation',
    ],
)
<commit_msg>changed to using pypi<commit_after># -*- coding: utf-8 -*-
"""`ushahidi_sphinx_rtd_theme` lives on `Github`_.

.. _github: https://www.github.com/snide/ushahidi_sphinx_rtd_theme

"""
from setuptools import setup
from ushahidi_sphinx_rtd_theme import __version__

setup(
    name='ushahidi_sphinx_rtd_theme',
    version=__version__,
    url='https://github.com/snide/ushahidi_sphinx_rtd_theme/',
    license='MIT',
    author='Dave Snider, Will Doran',
    author_email='dave.snider@gmail.com, will@ushahidi.com',
    description='Ushahidi customisation of ReadTheDocs.org theme for Sphinx, 2015 version.',
    long_description=open('README.rst').read(),
    zip_safe=False,
    packages=['ushahidi_sphinx_rtd_theme'],
    package_data={'ushahidi_sphinx_rtd_theme': [
        'theme.conf',
        '*.html',
        'static/css/*.css',
        'static/js/*.js',
        'static/font/*.*'
    ]},
    include_package_data=True,
    install_requires=open('requirements.txt').read().splitlines(),
    classifiers=[
        'Development Status :: 3 - Alpha',
        'License :: OSI Approved :: BSD License',
        'Environment :: Console',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Operating System :: OS Independent',
        'Topic :: Documentation',
        'Topic :: Software Development :: Documentation',
    ],
)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015, 2016 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

"""Invenio module for building and serving JSONSchemas."""

import os

from setuptools import find_packages, setup

readme = open('README.rst').read()
history = open('CHANGES.rst').read()

tests_require = [
    'check-manifest>=0.25',
    'coverage>=4.0',
    'isort>=4.2.2',
    'jsonresolver[jsonschema]>=0.2.1',
    'pydocstyle>=2.0.0',
    'pytest-cache>=1.0',
    'pytest-cov>=1.8.0',
    'pytest-pep8>=1.0.6',
    'pytest>=2.8.0',
    'mock>=1.3.0',
]

extras_require = {
    'docs': [
        'Sphinx>=1.6.2',
    ],
    'tests': tests_require,
}

extras_require['all'] = []
for reqs in extras_require.values():
    extras_require['all'].extend(reqs)

setup_requires = [
    'pytest-runner>=2.6.2',
]

install_requires = [
    'Flask>=0.12.2',
    'jsonref>=0.1',
]

packages = find_packages()

# Get the version string. Cannot be done with import!
g = {}
with open(os.path.join('invenio_jsonschemas', 'version.py'), 'rt') as fp:
    exec(fp.read(), g)
    version = g['__version__']

setup(
    name='invenio-jsonschemas',
    version=version,
    description=__doc__,
    long_description=readme + '\n\n' + history,
    keywords='invenio json schema',
    license='GPLv2',
    author='CERN',
    author_email='info@inveniosoftware.org',
    url='https://github.com/inveniosoftware/invenio-jsonschemas',
    packages=packages,
    zip_safe=False,
    include_package_data=True,
    platforms='any',
    entry_points={
        'invenio_base.apps': [
            'invenio_jsonschemas = invenio_jsonschemas:InvenioJSONSchemas',
        ],
        'invenio_base.api_apps': [
            'invenio_jsonschemas = invenio_jsonschemas:InvenioJSONSchemas',
        ],
        'invenio_records.jsonresolver': [
            'invenio_jsonschemas = invenio_jsonschemas.jsonresolver',
        ]
    },
    extras_require=extras_require,
    install_requires=install_requires,
    setup_requires=setup_requires,
    tests_require=tests_require,
    classifiers=[
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Development Status :: 4 - Beta',
    ],
)
<commit_msg>install: revert sphinx dependency to v0.11.1<commit_after># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015, 2016 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

"""Invenio module for building and serving JSONSchemas."""

import os

from setuptools import find_packages, setup

readme = open('README.rst').read()
history = open('CHANGES.rst').read()

tests_require = [
    'check-manifest>=0.25',
    'coverage>=4.0',
    'isort>=4.2.2',
    'jsonresolver[jsonschema]>=0.2.1',
    'pydocstyle>=2.0.0',
    'pytest-cache>=1.0',
    'pytest-cov>=1.8.0',
    'pytest-pep8>=1.0.6',
    'pytest>=2.8.0',
    'mock>=1.3.0',
]

extras_require = {
    'docs': [
        'Sphinx>=1.6.2',
    ],
    'tests': tests_require,
}

extras_require['all'] = []
for reqs in extras_require.values():
    extras_require['all'].extend(reqs)

setup_requires = [
    'pytest-runner>=2.6.2',
]

install_requires = [
    'Flask>=0.11.1',
    'jsonref>=0.1',
]

packages = find_packages()

# Get the version string. Cannot be done with import!
g = {}
with open(os.path.join('invenio_jsonschemas', 'version.py'), 'rt') as fp:
    exec(fp.read(), g)
    version = g['__version__']

setup(
    name='invenio-jsonschemas',
    version=version,
    description=__doc__,
    long_description=readme + '\n\n' + history,
    keywords='invenio json schema',
    license='GPLv2',
    author='CERN',
    author_email='info@inveniosoftware.org',
    url='https://github.com/inveniosoftware/invenio-jsonschemas',
    packages=packages,
    zip_safe=False,
    include_package_data=True,
    platforms='any',
    entry_points={
        'invenio_base.apps': [
            'invenio_jsonschemas = invenio_jsonschemas:InvenioJSONSchemas',
        ],
        'invenio_base.api_apps': [
            'invenio_jsonschemas = invenio_jsonschemas:InvenioJSONSchemas',
        ],
        'invenio_records.jsonresolver': [
            'invenio_jsonschemas = invenio_jsonschemas.jsonresolver',
        ]
    },
    extras_require=extras_require,
    install_requires=install_requires,
    setup_requires=setup_requires,
    tests_require=tests_require,
    classifiers=[
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Development Status :: 4 - Beta',
    ],
)
<|endoftext|>


<commit_before>#! /usr/bin/env python
"""Setup file for distutils

__author__ = "http://www.gemalto.com"

Copyright 2001-2012 gemalto
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com

This file is part of pyscard.

pyscard is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

pyscard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with pyscard; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
"""

from distutils import core, dir_util, file_util
from distutils.core import Extension
from distutils.util import get_platform
from distutils.command.build_ext import build_ext
import glob
import os
import sys

if sys.version[0:1] == '1':
    raise RuntimeError("pyscard requires Python 2.x to build.")

if 'win32' == get_platform():
    platform__cc_defines = [('WIN32', '100')]
    platform_swig_opts = ['-DWIN32']
    platform_sources = ['smartcard/scard/scard.rc']
    platform_libraries = ['winscard']
    platform_include_dirs = []
    platform_extra_compile_args = []
    platform_extra_link_args = []

elif 'win-amd64' == get_platform():
    platform__cc_defines = [('WIN32', '100')]
    platform_swig_opts = ['-DWIN32']
    platform_sources = ['smartcard/scard/scard.rc']
    platform_libraries = ['winscard']
    platform_include_dirs = []
    platform_extra_compile_args = []
    platform_extra_link_args = []

#
# Mac OS X Tiger has python 2.3 preinstalled
# get_platform() returns a string similar to 'darwin-8.11.1-i386' with
# python 2.3
# if python 2.5 is installed, get_platform() returns a string similar to
# 'macosx-10.3-fat'
elif 'darwin' in get_platform() \
     or 'macosx-10.3' in get_platform() \
     or 'macosx-10.4' in get_platform():
        platform__cc_defines = [('PCSCLITE', '1'),
                                ('__APPLE__', '1'),
                                ('__TIGER__', '1')]
        platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__TIGER__']
        platform_sources = []
        platform_libraries = []
        platform_include_dirs = []
        platform_extra_compile_args = ['-v', '-framework', 'PCSC',
                                       '-arch', 'i386', '-arch',
                                       'ppc', '-ggdb', '-O0']
        platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb']

#
# Mac OS X Lion (and above), python 2.7
# PowerPC is no more supported, x86_64 is new
#
# x86_64 and i386
#
elif 'macosx-10.' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'),
                            ('__APPLE__', '1'),
                            ('__LION__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LION__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-arch', 'i386',
                                   '-arch', 'x86_64', '-ggdb']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'x86_64', '-ggdb']

#
# Mac OS X Snow Leopard, python 2.6
# PowerPC is no more supported, x86_64 is new
#
elif 'macosx-10.6' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'),
                            ('__APPLE__', '1'),
                            ('__LEOPARD__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-arch', 'i386',
                                   '-arch', 'x86_64', '-ggdb']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'x86_64', '-ggdb']

#
# Mac OS X Leopard has python 2.5 preinstalled
# get_platform() returns a string similar to 'macosx-10.5-i386'
#
elif 'macosx-10.5' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'),
                            ('__APPLE__', '1'),
                            ('__LEOPARD__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-framework', 'PCSC',
                                   '-arch', 'i386',
                                   '-arch', 'ppc', '-ggdb', '-O0']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb']
#
# Other (GNU/Linux, etc.)
#
else:
    platform__cc_defines = [('PCSCLITE', '1')]
    platform_swig_opts = ['-DPCSCLITE']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = ['/usr/include/PCSC']
    platform_extra_compile_args = []    # ['-ggdb', '-O0']
    platform_extra_link_args = []   # ['-ggdb']

class _pyscardBuildExt(build_ext):
    '''Specialization of build_ext to enable swig_opts
    for python 2.3 distutils'''
if sys.version_info < (2, 4):

    # This copy of swig_sources is from Python 2.3.
    # This is to add support of swig_opts for Python 2.3 distutils
    # (in particular for MacOS X darwin that comes with Python 2.3)

    def swig_sources(self, sources):

        """Walk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        """

        new_sources = []
        swig_sources = []
        swig_targets = {}

        # XXX this drops generated C/C++ files into the source tree, which
        # is fine for developers who want to distribute the generated
        # source -- but there should be an option to put SWIG output in
        # the temp dir.

        if self.swig_cpp:
            target_ext = '.cpp'
        else:
            target_ext = '.c'

        for source in sources:
            (base, ext) = os.path.splitext(source)
            if ext == ".i":             # SWIG interface file
                new_sources.append(base + target_ext)
                swig_sources.append(source)
                swig_targets[source] = new_sources[-1]
            else:
                new_sources.append(source)

        if not swig_sources:
            return new_sources

        swig = self.find_swig()
        swig_cmd = [swig, "-python"]
        if self.swig_cpp:
            swig_cmd.append("-c++")

        swig_cmd += platform_swig_opts

        for source in swig_sources:
            target = swig_targets[source]
            self.announce("swigging %s to %s" % (source, target))
            self.spawn(swig_cmd + ["-o", target, source])

        return new_sources

    build_ext.swig_sources = swig_sources

kw = {'name': "pyscard",
      'version': "1.6.16",
      'description': "Smartcard module for Python.",
      'author': "Jean-Daniel Aussel",
      'author_email': "aussel.jean-daniel@gemalto.com",
      'url': "http://www.gemalto.com",
      'long_description': 'Smartcard package for Python',
      'license': 'GNU LESSER GENERAL PUBLIC LICENSE',
      'platforms': ['linux', 'win32'],
      'packages': ["smartcard",
                   "smartcard/pcsc",
                   "smartcard/reader",
                   "smartcard/scard",
                   "smartcard/sw",
                   "smartcard/util",
                   "smartcard/wx",
                   ],
      'package_dir': {"": "."},
      'package_data': {
                         "smartcard": [
                                        "ACKS",
                                        "ChangeLog",
                                        "LICENSE",
                                        "README",
                                        "TODO",
                                        ],
                         "smartcard/wx": ["resources/*.ico"],
                       },

      # the _scard.pyd extension to build
      'ext_modules': [Extension("smartcard.scard._scard",
                             define_macros=platform__cc_defines,
                             include_dirs=['smartcard/scard/'] \
                                           + platform_include_dirs,
                             sources=["smartcard/scard/helpers.c",
                                      "smartcard/scard/winscarddll.c",
                                      "smartcard/scard/scard.i"] \
                                      + platform_sources,
                             libraries=platform_libraries,
                             extra_compile_args=platform_extra_compile_args,
                             extra_link_args=platform_extra_link_args,
                             swig_opts=['-outdir',
                                        'smartcard/scard'] \
                                        + platform_swig_opts)],
      'cmdclass': {'build_ext': _pyscardBuildExt},
     }

# If we're running >Python 2.3, add extra information
if hasattr(core, 'setup_keywords'):
    if 'classifiers' in core.setup_keywords:
        kw['classifiers'] = [
          'Development Status :: 1.6.16 - Release',
          'License :: GNU LESSER GENERAL PUBLIC LICENSE',
          'Intended Audience :: Developers',
          'Operating System :: Unix',
          'Operating System :: Microsoft :: Windows',
          'Topic :: Security :: Smartcards',
          ]
    if 'download_url' in core.setup_keywords:
        kw['download_url'] = ('http://sourceforge.net/projects/pyscard/'
                              '%s-%s.zip' % (kw['name'], kw['version']))

pyscard_dist = core.setup(**kw)

# Python 2.3 distutils does not support package_data
# copy manually package_data
if sys.version_info < (2, 4):
    from distutils.util import convert_path
    from glob import glob
    if "install" in sys.argv:
        targetdir = pyscard_dist.command_obj['install'].install_purelib
        package_data = kw['package_data']
        files = []
        for directory in package_data:
            for pattern in package_data[directory]:
                filelist = glob(os.path.join(directory, convert_path(pattern)))
                files.extend([fn for fn in filelist if fn not in files])
        for file in files:
            newdir = os.path.dirname(file)
            dir_util.mkpath(os.path.join(targetdir, newdir))
            file_util.copy_file(file, os.path.join(targetdir, file))
<commit_msg>Add support of cygwin as a build plateform<commit_after>#! /usr/bin/env python
"""Setup file for distutils

__author__ = "http://www.gemalto.com"

Copyright 2001-2012 gemalto
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com

This file is part of pyscard.

pyscard is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

pyscard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with pyscard; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
"""

from distutils import core, dir_util, file_util
from distutils.core import Extension
from distutils.util import get_platform
from distutils.command.build_ext import build_ext
import glob
import os
import sys

if sys.version[0:1] == '1':
    raise RuntimeError("pyscard requires Python 2.x to build.")

if 'win32' == get_platform():
    platform__cc_defines = [('WIN32', '100')]
    platform_swig_opts = ['-DWIN32']
    platform_sources = ['smartcard/scard/scard.rc']
    platform_libraries = ['winscard']
    platform_include_dirs = []
    platform_extra_compile_args = []
    platform_extra_link_args = []

elif 'win-amd64' == get_platform():
    platform__cc_defines = [('WIN32', '100')]
    platform_swig_opts = ['-DWIN32']
    platform_sources = ['smartcard/scard/scard.rc']
    platform_libraries = ['winscard']
    platform_include_dirs = []
    platform_extra_compile_args = []
    platform_extra_link_args = []

elif 'cygwin-' in get_platform():
    platform__cc_defines = [('WIN32', '100')]
    platform_swig_opts = ['-DWIN32']
    platform_sources = []
    platform_libraries = ['winscard']
    platform_include_dirs = []
    platform_extra_compile_args = []
    platform_extra_link_args = []

#
# Mac OS X Tiger has python 2.3 preinstalled
# get_platform() returns a string similar to 'darwin-8.11.1-i386' with
# python 2.3
# if python 2.5 is installed, get_platform() returns a string similar to
# 'macosx-10.3-fat'
elif 'darwin' in get_platform() \
     or 'macosx-10.3' in get_platform() \
     or 'macosx-10.4' in get_platform():
        platform__cc_defines = [('PCSCLITE', '1'),
                                ('__APPLE__', '1'),
                                ('__TIGER__', '1')]
        platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__TIGER__']
        platform_sources = []
        platform_libraries = []
        platform_include_dirs = []
        platform_extra_compile_args = ['-v', '-framework', 'PCSC',
                                       '-arch', 'i386', '-arch',
                                       'ppc', '-ggdb', '-O0']
        platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb']

#
# Mac OS X Lion (and above), python 2.7
# PowerPC is no more supported, x86_64 is new
#
# x86_64 and i386
#
elif 'macosx-10.' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'),
                            ('__APPLE__', '1'),
                            ('__LION__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LION__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-arch', 'i386',
                                   '-arch', 'x86_64', '-ggdb']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'x86_64', '-ggdb']

#
# Mac OS X Snow Leopard, python 2.6
# PowerPC is no more supported, x86_64 is new
#
elif 'macosx-10.6' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'),
                            ('__APPLE__', '1'),
                            ('__LEOPARD__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-arch', 'i386',
                                   '-arch', 'x86_64', '-ggdb']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'x86_64', '-ggdb']

#
# Mac OS X Leopard has python 2.5 preinstalled
# get_platform() returns a string similar to 'macosx-10.5-i386'
#
elif 'macosx-10.5' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'),
                            ('__APPLE__', '1'),
                            ('__LEOPARD__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-framework', 'PCSC',
                                   '-arch', 'i386',
                                   '-arch', 'ppc', '-ggdb', '-O0']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb']
#
# Other (GNU/Linux, etc.)
#
else:
    platform__cc_defines = [('PCSCLITE', '1')]
    platform_swig_opts = ['-DPCSCLITE']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = ['/usr/include/PCSC']
    platform_extra_compile_args = []    # ['-ggdb', '-O0']
    platform_extra_link_args = []   # ['-ggdb']

class _pyscardBuildExt(build_ext):
    '''Specialization of build_ext to enable swig_opts
    for python 2.3 distutils'''
if sys.version_info < (2, 4):

    # This copy of swig_sources is from Python 2.3.
    # This is to add support of swig_opts for Python 2.3 distutils
    # (in particular for MacOS X darwin that comes with Python 2.3)

    def swig_sources(self, sources):

        """Walk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        """

        new_sources = []
        swig_sources = []
        swig_targets = {}

        # XXX this drops generated C/C++ files into the source tree, which
        # is fine for developers who want to distribute the generated
        # source -- but there should be an option to put SWIG output in
        # the temp dir.

        if self.swig_cpp:
            target_ext = '.cpp'
        else:
            target_ext = '.c'

        for source in sources:
            (base, ext) = os.path.splitext(source)
            if ext == ".i":             # SWIG interface file
                new_sources.append(base + target_ext)
                swig_sources.append(source)
                swig_targets[source] = new_sources[-1]
            else:
                new_sources.append(source)

        if not swig_sources:
            return new_sources

        swig = self.find_swig()
        swig_cmd = [swig, "-python"]
        if self.swig_cpp:
            swig_cmd.append("-c++")

        swig_cmd += platform_swig_opts

        for source in swig_sources:
            target = swig_targets[source]
            self.announce("swigging %s to %s" % (source, target))
            self.spawn(swig_cmd + ["-o", target, source])

        return new_sources

    build_ext.swig_sources = swig_sources

kw = {'name': "pyscard",
      'version': "1.6.16",
      'description': "Smartcard module for Python.",
      'author': "Jean-Daniel Aussel",
      'author_email': "aussel.jean-daniel@gemalto.com",
      'url': "http://www.gemalto.com",
      'long_description': 'Smartcard package for Python',
      'license': 'GNU LESSER GENERAL PUBLIC LICENSE',
      'platforms': ['linux', 'win32'],
      'packages': ["smartcard",
                   "smartcard/pcsc",
                   "smartcard/reader",
                   "smartcard/scard",
                   "smartcard/sw",
                   "smartcard/util",
                   "smartcard/wx",
                   ],
      'package_dir': {"": "."},
      'package_data': {
                         "smartcard": [
                                        "ACKS",
                                        "ChangeLog",
                                        "LICENSE",
                                        "README",
                                        "TODO",
                                        ],
                         "smartcard/wx": ["resources/*.ico"],
                       },

      # the _scard.pyd extension to build
      'ext_modules': [Extension("smartcard.scard._scard",
                             define_macros=platform__cc_defines,
                             include_dirs=['smartcard/scard/'] \
                                           + platform_include_dirs,
                             sources=["smartcard/scard/helpers.c",
                                      "smartcard/scard/winscarddll.c",
                                      "smartcard/scard/scard.i"] \
                                      + platform_sources,
                             libraries=platform_libraries,
                             extra_compile_args=platform_extra_compile_args,
                             extra_link_args=platform_extra_link_args,
                             swig_opts=['-outdir',
                                        'smartcard/scard'] \
                                        + platform_swig_opts)],
      'cmdclass': {'build_ext': _pyscardBuildExt},
     }

# If we're running >Python 2.3, add extra information
if hasattr(core, 'setup_keywords'):
    if 'classifiers' in core.setup_keywords:
        kw['classifiers'] = [
          'Development Status :: 1.6.16 - Release',
          'License :: GNU LESSER GENERAL PUBLIC LICENSE',
          'Intended Audience :: Developers',
          'Operating System :: Unix',
          'Operating System :: Microsoft :: Windows',
          'Topic :: Security :: Smartcards',
          ]
    if 'download_url' in core.setup_keywords:
        kw['download_url'] = ('http://sourceforge.net/projects/pyscard/'
                              '%s-%s.zip' % (kw['name'], kw['version']))

pyscard_dist = core.setup(**kw)

# Python 2.3 distutils does not support package_data
# copy manually package_data
if sys.version_info < (2, 4):
    from distutils.util import convert_path
    from glob import glob
    if "install" in sys.argv:
        targetdir = pyscard_dist.command_obj['install'].install_purelib
        package_data = kw['package_data']
        files = []
        for directory in package_data:
            for pattern in package_data[directory]:
                filelist = glob(os.path.join(directory, convert_path(pattern)))
                files.extend([fn for fn in filelist if fn not in files])
        for file in files:
            newdir = os.path.dirname(file)
            dir_util.mkpath(os.path.join(targetdir, newdir))
            file_util.copy_file(file, os.path.join(targetdir, file))
<|endoftext|>


<commit_before>#
# Copyright (C) 2009  Camptocamp
#
# This file is part of MapFish Server
#
# MapFish Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# MapFish Server is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with MapFish Server.  If not, see <http://www.gnu.org/licenses/>.
#

try:
    from setuptools import setup, find_packages
except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup, find_packages

import sys

requirements = ['SQLAlchemy>=0.5.0,<=0.5.99',
                'Pylons>=0.9.7,<=0.9.7.99',
                'geojson>=1.0,<=1.0.99']

# Shapely and Psychopg2 cannot be installed on Windows via python eggs
if sys.platform != 'win32':
    requirements.append('Shapely>=1.0.7,<=1.0.99')
    requirements.append('psycopg2>=2.0.10,<=2.0.99')

# add dependency on ctypes only for python < 2.5 wich does not embed ctypes
if sys.version_info < (2, 5):
    requirements.append('ctypes')

setup(name                 = 'mapfish',
      version              = '1.2dev',
      license              = 'LGPLv3',
      install_requires     = requirements,
      zip_safe             = False,
      include_package_data = True,
      packages             = find_packages(),
      keywords             = 'pylons wsgi framework sqlalchemy geojson shapely GIS',
      author               = 'Camptocamp',
      url                  = 'http://www.mapfish.org',
      description          = 'The MapFish web-mapping framework.',
      classifiers          = [
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Framework :: MapFish',
        'Topic :: Scientific/Engineering :: GIS',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Internet :: WWW/HTTP :: WSGI',
        'Topic :: Internet :: Software Development :: Libraries :: Python Modules',
        ],
      entry_points         = """
        [paste.paster_create_template]
        mapfish = mapfish.util:MapFishTemplate
        [paste.paster_command]
        mf-controller = mapfish.commands:MapFishControllerCommand
        mf-model = mapfish.commands:MapFishModelCommand
        mf-layer = mapfish.commands:MapFishLayerCommand
        """,
      long_description           = """
        MapFish
        =======

        MapFish is a Pylons-based web framework with GIS orientations.

        MapFish provides:

        * a geometry type which is to be used when mapping PostGIS tables
        with SQLAlchemy

        * a paster command to generate model and controller mode
        corresponding to layers (PostGIS tables) defined in a configuration
        file

        * an implementation of a RESTful protocols for creating, reading,
        updating, and deleting geographic objects (features)

        MapFish relies on the geojson and shapely packages, see
        http://gispython.org.

        MapFish projects are Pylons projects, the project developer
        therefore fully benefits from the power of Pylons and its
        companion components (SQLAlchemy, Mako, etc.).

        Current status
        --------------

        MapFish 1.2dev described in this page is the current stable version.

        Download and Installation
        -------------------------

        MapFish can be installed with `Easy Install
        <http://peak.telecommunity.com/DevCenter/EasyInstall>`_ by typing::

            > easy_install mapfish
        """
)
<commit_msg>update development version to 1.3dev for trunk of mapfish server<commit_after>#
# Copyright (C) 2009  Camptocamp
#
# This file is part of MapFish Server
#
# MapFish Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# MapFish Server is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with MapFish Server.  If not, see <http://www.gnu.org/licenses/>.
#

try:
    from setuptools import setup, find_packages
except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup, find_packages

import sys

requirements = ['SQLAlchemy>=0.5.0,<=0.5.99',
                'Pylons>=0.9.7,<=0.9.7.99',
                'geojson>=1.0,<=1.0.99']

# Shapely and Psychopg2 cannot be installed on Windows via python eggs
if sys.platform != 'win32':
    requirements.append('Shapely>=1.0.7,<=1.0.99')
    requirements.append('psycopg2>=2.0.10,<=2.0.99')

# add dependency on ctypes only for python < 2.5 wich does not embed ctypes
if sys.version_info < (2, 5):
    requirements.append('ctypes')

setup(name                 = 'mapfish',
      version              = '1.3dev',
      license              = 'LGPLv3',
      install_requires     = requirements,
      zip_safe             = False,
      include_package_data = True,
      packages             = find_packages(),
      keywords             = 'pylons wsgi framework sqlalchemy geojson shapely GIS',
      author               = 'Camptocamp',
      url                  = 'http://www.mapfish.org',
      description          = 'The MapFish web-mapping framework.',
      classifiers          = [
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Framework :: MapFish',
        'Topic :: Scientific/Engineering :: GIS',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Internet :: WWW/HTTP :: WSGI',
        'Topic :: Internet :: Software Development :: Libraries :: Python Modules',
        ],
      entry_points         = """
        [paste.paster_create_template]
        mapfish = mapfish.util:MapFishTemplate
        [paste.paster_command]
        mf-controller = mapfish.commands:MapFishControllerCommand
        mf-model = mapfish.commands:MapFishModelCommand
        mf-layer = mapfish.commands:MapFishLayerCommand
        """,
      long_description           = """
        MapFish
        =======

        MapFish is a Pylons-based web framework with GIS orientations.

        MapFish provides:

        * a geometry type which is to be used when mapping PostGIS tables
        with SQLAlchemy

        * a paster command to generate model and controller mode
        corresponding to layers (PostGIS tables) defined in a configuration
        file

        * an implementation of a RESTful protocols for creating, reading,
        updating, and deleting geographic objects (features)

        MapFish relies on the geojson and shapely packages, see
        http://gispython.org.

        MapFish projects are Pylons projects, the project developer
        therefore fully benefits from the power of Pylons and its
        companion components (SQLAlchemy, Mako, etc.).

        Current status
        --------------

        MapFish 1.3dev described in this page is the current stable version.

        Download and Installation
        -------------------------

        MapFish can be installed with `Easy Install
        <http://peak.telecommunity.com/DevCenter/EasyInstall>`_ by typing::

            > easy_install mapfish
        """
)
<|endoftext|>


<commit_before>from setuptools import setup

DESCRIPTION = """
    Libraty for generating packages
    in OCDS release format from openprocurement data
"""
install_requires = [
    'iso8601',
]

test_requires = [
]

setup(name='ocds.export',
      version='0.0.1',
      description=DESCRIPTION,
      author='Quintagroup, Ltd.',
      author_email='info@quintagroup.com',
      license='Apache License 2.0',
      include_package_data=True,
      packages=['ocds.export'],
      zip_safe=False,
      install_requires=install_requires,
      tests_require=test_requires,
      )
<commit_msg>Fix requirements<commit_after>from setuptools import setup

DESCRIPTION = """
    Libraty for generating packages
    in OCDS release format from openprocurement data
"""
install_requires = [
    'iso8601',
    'voluptuous'
]

test_requires = [
]

setup(name='ocds.export',
      version='0.0.1',
      description=DESCRIPTION,
      author='Quintagroup, Ltd.',
      author_email='info@quintagroup.com',
      license='Apache License 2.0',
      include_package_data=True,
      packages=['ocds.export'],
      zip_safe=False,
      install_requires=install_requires,
      tests_require=test_requires,
      )
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

setup(name='searchengine',
      version='0.1',
      description='A very simple search engine.',
      long_description='Student project',
      classifiers=[
        'Development Status :: 3 - Alpha',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3.4',
        'Topic :: Text Processing :: General',
      ],
      keywords='search indexing',
      url='https://github.com/Neki/searchengine',
      author='Alizée Farshian, Benoît Faucon',
      author_email='faucon.benoit@cegetel.net',
      license='MIT',
      packages=find_packages(),
      include_package_data=True,
      test_suite='nose.collector',
      tests_require=['nose'],
      scripts=['bin/searchengine'],
      )
<commit_msg>Add matplotlib dependency.<commit_after>from setuptools import setup, find_packages

setup(name='searchengine',
      version='0.1',
      description='A very simple search engine.',
      long_description='Student project',
      classifiers=[
        'Development Status :: 3 - Alpha',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3.4',
        'Topic :: Text Processing :: General',
      ],
      keywords='search indexing',
      url='https://github.com/Neki/searchengine',
      author='Alizée Farshian, Benoît Faucon',
      author_email='faucon.benoit@cegetel.net',
      license='MIT',
      packages=find_packages(),
      include_package_data=True,
      test_suite='nose.collector',
      tests_require=['nose'],
      scripts=['bin/searchengine'],
      install_requires=['matplotlib']
      )
<|endoftext|>


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

"""Install Mapchete."""

from setuptools import setup
import os

on_rtd = os.environ.get('READTHEDOCS') == 'True'

setup(
    name='mapchete',
    version='0.4',
    description='tile-based geodata processing',
    author='Joachim Ungar',
    author_email='joachim.ungar@gmail.com',
    url='https://github.com/ungarj/mapchete',
    license='MIT',
    packages=[
        'mapchete',
        'mapchete.cli',
        'mapchete.commons',
        'mapchete.config',
        'mapchete.formats',
        'mapchete.io',
        'mapchete.log',
        'mapchete.static'
    ],
    entry_points={
        'console_scripts': [
            'mapchete=mapchete.cli.main:main'
        ],
        'mapchete.formats.drivers': [
            'geojson=mapchete.formats.default.geojson',
            'gtiff=mapchete.formats.default.gtiff',
            'mapchete_input=mapchete.formats.default.mapchete_input',
            'png_hillshade=mapchete.formats.default.png_hillshade',
            'png=mapchete.formats.default.png',
            'raster_file=mapchete.formats.default.raster_file',
            'vector_file=mapchete.formats.default.vector_file'
        ]
    },
    package_dir={'static': 'static'},
    package_data={'static': [
        'index.html', 'process_template.py', 'mapchete_template.mapchete']},
    install_requires=[
        'tilematrix>=0.4',
        'fiona',
        'pyyaml',
        'flask',
        'Pillow',
        'scipy',
        'rasterio>=0.36.0',
        'matplotlib',
        'gdal',
        'cached_property',
        'pyproj',
        'cachetools'
    ] if not on_rtd else [],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Topic :: Scientific/Engineering :: GIS',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2.7',
    ]
)
<commit_msg>fix installation<commit_after>#!/usr/bin/env python

"""Install Mapchete."""

from setuptools import setup
import os

on_rtd = os.environ.get('READTHEDOCS') == 'True'

setup(
    name='mapchete',
    version='0.4',
    description='tile-based geodata processing',
    author='Joachim Ungar',
    author_email='joachim.ungar@gmail.com',
    url='https://github.com/ungarj/mapchete',
    license='MIT',
    packages=[
        'mapchete',
        'mapchete.cli',
        'mapchete.commons',
        'mapchete.config',
        'mapchete.formats',
        'mapchete.formats.default',
        'mapchete.io',
        'mapchete.log',
        'mapchete.static'
    ],
    entry_points={
        'console_scripts': [
            'mapchete=mapchete.cli.main:main'
        ],
        'mapchete.formats.drivers': [
            'geojson=mapchete.formats.default.geojson',
            'gtiff=mapchete.formats.default.gtiff',
            'mapchete_input=mapchete.formats.default.mapchete_input',
            'png_hillshade=mapchete.formats.default.png_hillshade',
            'png=mapchete.formats.default.png',
            'raster_file=mapchete.formats.default.raster_file',
            'vector_file=mapchete.formats.default.vector_file'
        ]
    },
    package_dir={'static': 'static'},
    package_data={'mapchete.static': ['*']},
    install_requires=[
        'tilematrix>=0.4',
        'fiona',
        'pyyaml',
        'flask',
        'Pillow',
        'scipy',
        'rasterio>=1.0a2',
        'matplotlib',
        'gdal',
        'cached_property',
        'pyproj',
        'cachetools'
    ] if not on_rtd else [],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Topic :: Scientific/Engineering :: GIS',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2.7',
    ]
)
<|endoftext|>


<commit_before>from __future__ import unicode_literals
import json
import pytz

from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponse
from django.shortcuts import render, get_object_or_404, redirect
from django.template import loader, Context
from django.conf import settings

from django.contrib.auth.models import User
from django.contrib import messages
from django.contrib.sites.models import Site

from django_ical.views import ICalFeed

from account.decorators import login_required

from symposion.schedule.forms import SlotEditForm, ScheduleSectionForm
from symposion.schedule.models import Schedule, Day, Slot, Presentation, Session, SessionRole
from symposion.schedule.timetable import TimeTable

def fetch_schedule(slug):
    qs = Schedule.objects.all()

    if slug is None:
        if qs.count() > 1:
            raise Http404()
        schedule = next(iter(qs), None)
        if schedule is None:
            raise Http404()
    else:
        schedule = get_object_or_404(qs, section__slug=slug)

    return schedule

def schedule_conference(request):

    if request.user.is_staff:
        schedules = Schedule.objects.filter(hidden=False)
    else:
        schedules = Schedule.objects.filter(published=True, hidden=False)

    sections = []
    for schedule in schedules:
        days_qs = Day.objects.filter(schedule=schedule)
        days = [TimeTable(day) for day in days_qs]
        sections.append({
            "schedule": schedule,
            "days": days,
        })

    day_switch = request.GET.get('day', None)
    ctx = {
        "sections": sections,
        "day_switch": day_switch
    }
    return render(request, "symposion/schedule/schedule_conference.html", ctx)

def schedule_detail(request, slug=None):

    schedule = fetch_schedule(slug)
    if not schedule.published and not request.user.is_staff:
        raise Http404()

    days_qs = Day.objects.filter(schedule=schedule)
    days = [TimeTable(day) for day in days_qs]

    ctx = {
        "schedule": schedule,
        "days": days,
    }
    return render(request, "symposion/schedule/schedule_detail.html", ctx)

def schedule_list(request, slug=None):
    schedule = fetch_schedule(slug)
    if not schedule.published and not request.user.is_staff:
        raise Http404()

    presentations = Presentation.objects.filter(section=schedule.section)
    presentations = presentations.exclude(cancelled=True)

    if not request.user.is_staff:
        presentations = presentations.exclude(unpublish=True)

    ctx = {
        "schedule": schedule,
        "presentations": presentations,
    }
    return render(request, "symposion/schedule/schedule_list.html", ctx)

def schedule_list_csv(request, slug=None):
    schedule = fetch_schedule(slug)
    if not schedule.published and not request.user.is_staff:
        raise Http404()

    presentations = Presentation.objects.filter(section=schedule.section)
    presentations = presentations.exclude(cancelled=True)
    if not request.user.is_staff:
        presentations = presentations.exclude(unpublish=True)
    presentations = presentations.order_by("id")
    response = HttpResponse(content_type="text/csv")

    if slug:
        file_slug = slug
    else:
        file_slug = "presentations"
    response["Content-Disposition"] = 'attachment; filename="%s.csv"' % file_slug

    response.write(loader.get_template("symposion/schedule/schedule_list.csv").render(Context({
        "presentations": presentations,

    })))
    return response

@login_required
def schedule_edit(request, slug=None):

    if not request.user.is_staff:
        raise Http404()

    schedule = fetch_schedule(slug)

    if request.method == "POST":
        form = ScheduleSectionForm(
            request.POST, request.FILES, schedule=schedule
        )
        if form.is_valid():
            if 'submit' in form.data:
                msg = form.build_schedule()
            elif 'delete' in form.data:
                msg = form.delete_schedule()
            messages.add_message(request, msg[0], msg[1])
    else:
        form = ScheduleSectionForm(schedule=schedule)
    days_qs = Day.objects.filter(schedule=schedule)
    days = [TimeTable(day) for day in days_qs]
    ctx = {
        "schedule": schedule,
        "days": days,
        "form": form
    }
    return render(request, "symposion/schedule/schedule_edit.html", ctx)

@login_required
def schedule_slot_edit(request, slug, slot_pk):

    if not request.user.is_staff:
        raise Http404()

    slot = get_object_or_404(Slot, day__schedule__section__slug=slug, pk=slot_pk)

    if request.method == "POST":
        form = SlotEditForm(request.POST, slot=slot)
        if form.is_valid():
            save = False
            if "content_override" in form.cleaned_data:
                slot.content_override = form.cleaned_data["content_override"]
                save = True
            if "presentation" in form.cleaned_data:
                presentation = form.cleaned_data["presentation"]
                if presentation is None:
                    slot.unassign()
                else:
                    slot.assign(presentation)
            if save:
                slot.save()
        return redirect("schedule_edit", slug)
    else:
        form = SlotEditForm(slot=slot)
        ctx = {
            "slug": slug,
            "form": form,
            "slot": slot,
        }
        return render(request, "symposion/schedule/_slot_edit.html", ctx)

def schedule_presentation_detail(request, pk):

    presentation = get_object_or_404(Presentation, pk=pk)

    if presentation.slot:
        # 1) Schedule from presentation's slot
        schedule = presentation.slot.day.schedule
    else:
        # 2) Fall back to the schedule for this proposal
        schedule = presentation.proposal.kind.section.schedule

    if not request.user.is_staff:
        # 3) Is proposal unpublished?
        if presentation.unpublish or not (schedule and schedule.published):
            raise Http404()

    ctx = {
        "presentation": presentation,
        "schedule": schedule,
    }
    return render(request, "symposion/schedule/presentation_detail.html", ctx)

def schedule_json(request):
    slots = Slot.objects.filter(
        day__schedule__published=True,
        day__schedule__hidden=False
    ).order_by("start")

    protocol = request.META.get('HTTP_X_FORWARDED_PROTO', 'http')
    data = []
    for slot in slots:
        slot_data = {
            "room": ", ".join(room["name"] for room in slot.rooms.values()),
            "rooms": [room["name"] for room in slot.rooms.values()],
            "start": slot.start_datetime.isoformat(),
            "end": slot.end_datetime.isoformat(),
            "duration": slot.length_in_minutes,
            "kind": slot.kind.label,
            "section": slot.day.schedule.section.slug,
            "conf_key": slot.pk,
            # TODO: models should be changed.
            # these are model features from other conferences that have forked symposion
            # these have been used almost everywhere and are good candidates for
            # base proposals
            "license": "CC BY",
            "tags": "",
            "released": True,
            "contact": [],
        }
        if hasattr(slot.content, "proposal"):
            if slot.content.unpublish and not request.user.is_staff:
                continue

            slot_data.update({
                "name": slot.content.title,
                "authors": [s.name for s in slot.content.speakers()],
                "contact": [
                    s.email for s in slot.content.speakers()
                ] if request.user.has_perm('symposion_speakers.can_view_contact_details') or request.user.is_staff else ["redacted"],
                "abstract": slot.content.abstract,
                "conf_url": "%s://%s%s" % (
                    protocol,
                    Site.objects.get_current().domain,
                    reverse("schedule_presentation_detail", args=[slot.content.pk])
                ),
                "cancelled": slot.content.cancelled,
            })
        else:
            slot_data.update({
                "name": slot.content_override if slot.content_override else "Slot",
            })
        data.append(slot_data)

    return HttpResponse(
        json.dumps({"schedule": data}, indent=2),
        content_type="application/json"
    )

class EventFeed(ICalFeed):

    product_id = '-//linux.conf.au/schedule//EN'
    timezone = settings.TIME_ZONE
    filename = 'conference.ics'

    def items(self):
        return Slot.objects.filter(
            day__schedule__published=True,
            day__schedule__hidden=False
        ).exclude(
            kind__label='shortbreak'
        ).order_by("start")

    def item_title(self, item):
        if hasattr(item.content, 'proposal'):
            title =  item.content.title
        else:
            title = item.kind if item.kind else "Slot"
        return title

    def item_description(self, item):
        if hasattr(item.content, 'proposal'):
            description = "Speaker: %s\n%s" % (
                item.content.speaker, item.content.abstract)
        else:
            description = item.content_override if item.content_override else "No description"
        return description

    def item_start_datetime(self, item):
        return pytz.timezone(settings.TIME_ZONE).localize(item.start_datetime)

    def item_end_datetime(self, item):
        return pytz.timezone(settings.TIME_ZONE).localize(item.end_datetime)

    def item_location(self, item):
        return ", ".join(room["name"] for room in item.rooms.values())

    def item_link(self, item):
        if hasattr(item.content, 'proposal'):
            return 'http://%s%s' % (
                                    Site.objects.get_current().domain,
                                    reverse('schedule_presentation_detail', args=[item.content.pk])
                                    )
        else:
            return 'http://%s' % Site.objects.get_current().domain

    def item_guid(self, item):
        return '%d@%s' % (item.pk, Site.objects.get_current().domain)

def session_list(request):
    sessions = Session.objects.all().order_by('pk')

    return render(request, "symposion/schedule/session_list.html", {
        "sessions": sessions,
    })

@login_required
def session_staff_email(request):

    if not request.user.is_staff:
        return redirect("schedule_session_list")

    data = "\n".join(user.email for user in User.objects.filter(sessionrole__isnull=False).distinct())

    return HttpResponse(data, content_type="text/plain;charset=UTF-8")

def session_detail(request, session_id):

    session = get_object_or_404(Session, id=session_id)

    chair = None
    chair_denied = False
    chairs = SessionRole.objects.filter(session=session, role=SessionRole.SESSION_ROLE_CHAIR).exclude(status=False)
    if chairs:
        chair = chairs[0].user
    else:
        if request.user.is_authenticated():
            # did the current user previously try to apply and got rejected?
            if SessionRole.objects.filter(session=session, user=request.user, role=SessionRole.SESSION_ROLE_CHAIR, status=False):
                chair_denied = True

    runner = None
    runner_denied = False
    runners = SessionRole.objects.filter(session=session, role=SessionRole.SESSION_ROLE_RUNNER).exclude(status=False)
    if runners:
        runner = runners[0].user
    else:
        if request.user.is_authenticated():
            # did the current user previously try to apply and got rejected?
            if SessionRole.objects.filter(session=session, user=request.user, role=SessionRole.SESSION_ROLE_RUNNER, status=False):
                runner_denied = True

    if request.method == "POST" and request.user.is_authenticated():
        if not hasattr(request.user, "attendee") or not request.user.attendee.completed_registration:
            response = redirect("guided_registration")
            response["Location"] += "?next=%s" % request.path
            return response

        role = request.POST.get("role")
        if role == "chair":
            if chair is None and not chair_denied:
                SessionRole(session=session, role=SessionRole.SESSION_ROLE_CHAIR, user=request.user).save()
        elif role == "runner":
            if runner is None and not runner_denied:
                SessionRole(session=session, role=SessionRole.SESSION_ROLE_RUNNER, user=request.user).save()
        elif role == "un-chair":
            if chair == request.user:
                session_role = SessionRole.objects.filter(session=session, role=SessionRole.SESSION_ROLE_CHAIR, user=request.user)
                if session_role:
                    session_role[0].delete()
        elif role == "un-runner":
            if runner == request.user:
                session_role = SessionRole.objects.filter(session=session, role=SessionRole.SESSION_ROLE_RUNNER, user=request.user)
                if session_role:
                    session_role[0].delete()

        return redirect("schedule_session_detail", session_id)

    return render(request, "symposion/schedule/session_detail.html", {
        "session": session,
        "chair": chair,
        "chair_denied": chair_denied,
        "runner": runner,
        "runner_denied": runner_denied,
    })
<commit_msg>Add description to ICal feed to help Giggety app identify conference<commit_after>from __future__ import unicode_literals
import json
import pytz

from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponse
from django.shortcuts import render, get_object_or_404, redirect
from django.template import loader, Context
from django.conf import settings

from django.contrib.auth.models import User
from django.contrib import messages
from django.contrib.sites.models import Site

from django_ical.views import ICalFeed

from account.decorators import login_required

from symposion.schedule.forms import SlotEditForm, ScheduleSectionForm
from symposion.schedule.models import Schedule, Day, Slot, Presentation, Session, SessionRole
from symposion.schedule.timetable import TimeTable
from symposion.conference.models import Conference

def fetch_schedule(slug):
    qs = Schedule.objects.all()

    if slug is None:
        if qs.count() > 1:
            raise Http404()
        schedule = next(iter(qs), None)
        if schedule is None:
            raise Http404()
    else:
        schedule = get_object_or_404(qs, section__slug=slug)

    return schedule

def schedule_conference(request):

    if request.user.is_staff:
        schedules = Schedule.objects.filter(hidden=False)
    else:
        schedules = Schedule.objects.filter(published=True, hidden=False)

    sections = []
    for schedule in schedules:
        days_qs = Day.objects.filter(schedule=schedule)
        days = [TimeTable(day) for day in days_qs]
        sections.append({
            "schedule": schedule,
            "days": days,
        })

    day_switch = request.GET.get('day', None)
    ctx = {
        "sections": sections,
        "day_switch": day_switch
    }
    return render(request, "symposion/schedule/schedule_conference.html", ctx)

def schedule_detail(request, slug=None):

    schedule = fetch_schedule(slug)
    if not schedule.published and not request.user.is_staff:
        raise Http404()

    days_qs = Day.objects.filter(schedule=schedule)
    days = [TimeTable(day) for day in days_qs]

    ctx = {
        "schedule": schedule,
        "days": days,
    }
    return render(request, "symposion/schedule/schedule_detail.html", ctx)

def schedule_list(request, slug=None):
    schedule = fetch_schedule(slug)
    if not schedule.published and not request.user.is_staff:
        raise Http404()

    presentations = Presentation.objects.filter(section=schedule.section)
    presentations = presentations.exclude(cancelled=True)

    if not request.user.is_staff:
        presentations = presentations.exclude(unpublish=True)

    ctx = {
        "schedule": schedule,
        "presentations": presentations,
    }
    return render(request, "symposion/schedule/schedule_list.html", ctx)

def schedule_list_csv(request, slug=None):
    schedule = fetch_schedule(slug)
    if not schedule.published and not request.user.is_staff:
        raise Http404()

    presentations = Presentation.objects.filter(section=schedule.section)
    presentations = presentations.exclude(cancelled=True)
    if not request.user.is_staff:
        presentations = presentations.exclude(unpublish=True)
    presentations = presentations.order_by("id")
    response = HttpResponse(content_type="text/csv")

    if slug:
        file_slug = slug
    else:
        file_slug = "presentations"
    response["Content-Disposition"] = 'attachment; filename="%s.csv"' % file_slug

    response.write(loader.get_template("symposion/schedule/schedule_list.csv").render(Context({
        "presentations": presentations,

    })))
    return response

@login_required
def schedule_edit(request, slug=None):

    if not request.user.is_staff:
        raise Http404()

    schedule = fetch_schedule(slug)

    if request.method == "POST":
        form = ScheduleSectionForm(
            request.POST, request.FILES, schedule=schedule
        )
        if form.is_valid():
            if 'submit' in form.data:
                msg = form.build_schedule()
            elif 'delete' in form.data:
                msg = form.delete_schedule()
            messages.add_message(request, msg[0], msg[1])
    else:
        form = ScheduleSectionForm(schedule=schedule)
    days_qs = Day.objects.filter(schedule=schedule)
    days = [TimeTable(day) for day in days_qs]
    ctx = {
        "schedule": schedule,
        "days": days,
        "form": form
    }
    return render(request, "symposion/schedule/schedule_edit.html", ctx)

@login_required
def schedule_slot_edit(request, slug, slot_pk):

    if not request.user.is_staff:
        raise Http404()

    slot = get_object_or_404(Slot, day__schedule__section__slug=slug, pk=slot_pk)

    if request.method == "POST":
        form = SlotEditForm(request.POST, slot=slot)
        if form.is_valid():
            save = False
            if "content_override" in form.cleaned_data:
                slot.content_override = form.cleaned_data["content_override"]
                save = True
            if "presentation" in form.cleaned_data:
                presentation = form.cleaned_data["presentation"]
                if presentation is None:
                    slot.unassign()
                else:
                    slot.assign(presentation)
            if save:
                slot.save()
        return redirect("schedule_edit", slug)
    else:
        form = SlotEditForm(slot=slot)
        ctx = {
            "slug": slug,
            "form": form,
            "slot": slot,
        }
        return render(request, "symposion/schedule/_slot_edit.html", ctx)

def schedule_presentation_detail(request, pk):

    presentation = get_object_or_404(Presentation, pk=pk)

    if presentation.slot:
        # 1) Schedule from presentation's slot
        schedule = presentation.slot.day.schedule
    else:
        # 2) Fall back to the schedule for this proposal
        schedule = presentation.proposal.kind.section.schedule

    if not request.user.is_staff:
        # 3) Is proposal unpublished?
        if presentation.unpublish or not (schedule and schedule.published):
            raise Http404()

    ctx = {
        "presentation": presentation,
        "schedule": schedule,
    }
    return render(request, "symposion/schedule/presentation_detail.html", ctx)

def schedule_json(request):
    slots = Slot.objects.filter(
        day__schedule__published=True,
        day__schedule__hidden=False
    ).order_by("start")

    protocol = request.META.get('HTTP_X_FORWARDED_PROTO', 'http')
    data = []
    for slot in slots:
        slot_data = {
            "room": ", ".join(room["name"] for room in slot.rooms.values()),
            "rooms": [room["name"] for room in slot.rooms.values()],
            "start": slot.start_datetime.isoformat(),
            "end": slot.end_datetime.isoformat(),
            "duration": slot.length_in_minutes,
            "kind": slot.kind.label,
            "section": slot.day.schedule.section.slug,
            "conf_key": slot.pk,
            # TODO: models should be changed.
            # these are model features from other conferences that have forked symposion
            # these have been used almost everywhere and are good candidates for
            # base proposals
            "license": "CC BY",
            "tags": "",
            "released": True,
            "contact": [],
        }
        if hasattr(slot.content, "proposal"):
            if slot.content.unpublish and not request.user.is_staff:
                continue

            slot_data.update({
                "name": slot.content.title,
                "authors": [s.name for s in slot.content.speakers()],
                "contact": [
                    s.email for s in slot.content.speakers()
                ] if request.user.has_perm('symposion_speakers.can_view_contact_details') or request.user.is_staff else ["redacted"],
                "abstract": slot.content.abstract,
                "conf_url": "%s://%s%s" % (
                    protocol,
                    Site.objects.get_current().domain,
                    reverse("schedule_presentation_detail", args=[slot.content.pk])
                ),
                "cancelled": slot.content.cancelled,
            })
        else:
            slot_data.update({
                "name": slot.content_override if slot.content_override else "Slot",
            })
        data.append(slot_data)

    return HttpResponse(
        json.dumps({"schedule": data}, indent=2),
        content_type="application/json"
    )

class EventFeed(ICalFeed):

    product_id = '-//linux.conf.au/schedule//EN'
    timezone = settings.TIME_ZONE
    filename = 'conference.ics'
    description = Conference.objects.all().first().title

    def items(self):
        return Slot.objects.filter(
            day__schedule__published=True,
            day__schedule__hidden=False
        ).exclude(
            kind__label='shortbreak'
        ).order_by("start")

    def item_title(self, item):
        if hasattr(item.content, 'proposal'):
            title =  item.content.title
        else:
            title = item.kind if item.kind else "Slot"
        return title

    def item_description(self, item):
        if hasattr(item.content, 'proposal'):
            description = "Speaker: %s\n%s" % (
                item.content.speaker, item.content.abstract)
        else:
            description = item.content_override if item.content_override else "No description"
        return description

    def item_start_datetime(self, item):
        return pytz.timezone(settings.TIME_ZONE).localize(item.start_datetime)

    def item_end_datetime(self, item):
        return pytz.timezone(settings.TIME_ZONE).localize(item.end_datetime)

    def item_location(self, item):
        return ", ".join(room["name"] for room in item.rooms.values())

    def item_link(self, item):
        if hasattr(item.content, 'proposal'):
            return 'http://%s%s' % (
                                    Site.objects.get_current().domain,
                                    reverse('schedule_presentation_detail', args=[item.content.pk])
                                    )
        else:
            return 'http://%s' % Site.objects.get_current().domain

    def item_guid(self, item):
        return '%d@%s' % (item.pk, Site.objects.get_current().domain)

def session_list(request):
    sessions = Session.objects.all().order_by('pk')

    return render(request, "symposion/schedule/session_list.html", {
        "sessions": sessions,
    })

@login_required
def session_staff_email(request):

    if not request.user.is_staff:
        return redirect("schedule_session_list")

    data = "\n".join(user.email for user in User.objects.filter(sessionrole__isnull=False).distinct())

    return HttpResponse(data, content_type="text/plain;charset=UTF-8")

def session_detail(request, session_id):

    session = get_object_or_404(Session, id=session_id)

    chair = None
    chair_denied = False
    chairs = SessionRole.objects.filter(session=session, role=SessionRole.SESSION_ROLE_CHAIR).exclude(status=False)
    if chairs:
        chair = chairs[0].user
    else:
        if request.user.is_authenticated():
            # did the current user previously try to apply and got rejected?
            if SessionRole.objects.filter(session=session, user=request.user, role=SessionRole.SESSION_ROLE_CHAIR, status=False):
                chair_denied = True

    runner = None
    runner_denied = False
    runners = SessionRole.objects.filter(session=session, role=SessionRole.SESSION_ROLE_RUNNER).exclude(status=False)
    if runners:
        runner = runners[0].user
    else:
        if request.user.is_authenticated():
            # did the current user previously try to apply and got rejected?
            if SessionRole.objects.filter(session=session, user=request.user, role=SessionRole.SESSION_ROLE_RUNNER, status=False):
                runner_denied = True

    if request.method == "POST" and request.user.is_authenticated():
        if not hasattr(request.user, "attendee") or not request.user.attendee.completed_registration:
            response = redirect("guided_registration")
            response["Location"] += "?next=%s" % request.path
            return response

        role = request.POST.get("role")
        if role == "chair":
            if chair is None and not chair_denied:
                SessionRole(session=session, role=SessionRole.SESSION_ROLE_CHAIR, user=request.user).save()
        elif role == "runner":
            if runner is None and not runner_denied:
                SessionRole(session=session, role=SessionRole.SESSION_ROLE_RUNNER, user=request.user).save()
        elif role == "un-chair":
            if chair == request.user:
                session_role = SessionRole.objects.filter(session=session, role=SessionRole.SESSION_ROLE_CHAIR, user=request.user)
                if session_role:
                    session_role[0].delete()
        elif role == "un-runner":
            if runner == request.user:
                session_role = SessionRole.objects.filter(session=session, role=SessionRole.SESSION_ROLE_RUNNER, user=request.user)
                if session_role:
                    session_role[0].delete()

        return redirect("schedule_session_detail", session_id)

    return render(request, "symposion/schedule/session_detail.html", {
        "session": session,
        "chair": chair,
        "chair_denied": chair_denied,
        "runner": runner,
        "runner_denied": runner_denied,
    })
<|endoftext|>


<commit_before>#!/usr/bin/env python
from setuptools import setup

setup(
    name='rostrace',
    version='2.0.1',
    description='Allows detailed logging and debugging of running ROS systems',
    long_description='TBA',
    # need to modify to have multiple authors!
    author='Chris Timperley, Afsoon Afsal',
    author_email='christimperley@gmail.com, afsafzal@cs.cmu.edu',
    # TODO: move to Squares organisation
    url='https://github.com/ChrisTimperley/rostrace',
    license='mit',
    packages=['rostrace'],
    entry_points = {
        'console_scripts': [ 'rostrace = rostrace.rostrace:main' ]
    }
)
<commit_msg>Corrected author's name and email address.<commit_after>#!/usr/bin/env python
from setuptools import setup

setup(
    name='rostrace',
    version='2.0.1',
    description='Allows detailed logging and debugging of running ROS systems',
    long_description='TBA',
    # need to modify to have multiple authors!
    author='Chris Timperley, Afsoon Afzal',
    author_email='christimperley@gmail.com, afsoona@cs.cmu.edu',
    # TODO: move to Squares organisation
    url='https://github.com/ChrisTimperley/rostrace',
    license='mit',
    packages=['rostrace'],
    entry_points = {
        'console_scripts': [ 'rostrace = rostrace.rostrace:main' ]
    }
)
<|endoftext|>