from setuptools import setup
from setuptools.command.install import install

class PostInstallCommand(install):
    user_options = install.user_options + [
        ('noservice', None, None),
    ]

    def initialize_options(self):
        install.initialize_options(self)
        self.noservice = None

    def finalize_options(self):
        install.finalize_options(self)

    def run(self):
        install.run(self)
        if not self.noservice:
            from xmediusmailrelayserver import console
            console.install_service(['--startup', 'auto', 'install'])

setup(
    name='xmediusmailrelayserver',
    version='1.0.0',
    description='The Python module to be used to relay mail to different servers depending on patterns',
    long_description='See https://github.com/xmedius/xmedius-mailrelayserver for more information',
    url='https://github.com/xmedius/xmedius-mailrelayserver/',
    author='XMedius R&D',
    license='MIT',
    classifiers=[
        'Programming Language :: Python :: 3.6',
        'Environment :: Win32 (MS Windows)',
        'Operating System :: Microsoft :: Windows'
    ],
    cmdclass={
        'install': PostInstallCommand
    },
    packages=['xmediusmailrelayserver'],
    package_data={'xmediusmailrelayserver': ['config.yml']},
    install_requires=['pyyaml', 'aiosmtpd'],
    dependency_links=[]
)


[((578, 1309), 'setuptools.setup', 'setup', ([], {'name': '"""xmediusmailrelayserver"""', 'version': '"""1.0.0"""', 'description': '"""The Python module to be used to relay mail to different servers depending on patterns"""', 'long_description': '"""See https://github.com/xmedius/xmedius-mailrelayserver for more information"""', 'url': '"""https://github.com/xmedius/xmedius-mailrelayserver/"""', 'author': '"""XMedius R&D"""', 'license': '"""MIT"""', 'classifiers': "['Programming Language :: Python :: 3.6',\n    'Environment :: Win32 (MS Windows)',\n    'Operating System :: Microsoft :: Windows']", 'cmdclass': "{'install': PostInstallCommand}", 'packages': "['xmediusmailrelayserver']", 'package_data': "{'xmediusmailrelayserver': ['config.yml']}", 'install_requires': "['pyyaml', 'aiosmtpd']", 'dependency_links': '[]'}), "(name='xmediusmailrelayserver', version='1.0.0', description=\n    'The Python module to be used to relay mail to different servers depending on patterns'\n    , long_description=\n    'See https://github.com/xmedius/xmedius-mailrelayserver for more information'\n    , url='https://github.com/xmedius/xmedius-mailrelayserver/', author=\n    'XMedius R&D', license='MIT', classifiers=[\n    'Programming Language :: Python :: 3.6',\n    'Environment :: Win32 (MS Windows)',\n    'Operating System :: Microsoft :: Windows'], cmdclass={'install':\n    PostInstallCommand}, packages=['xmediusmailrelayserver'], package_data=\n    {'xmediusmailrelayserver': ['config.yml']}, install_requires=['pyyaml',\n    'aiosmtpd'], dependency_links=[])\n", (583, 1309), False, 'from setuptools import setup\n'), ((240, 272), 'setuptools.command.install.install.initialize_options', 'install.initialize_options', (['self'], {}), '(self)\n', (266, 272), False, 'from setuptools.command.install import install\n'), ((344, 374), 'setuptools.command.install.install.finalize_options', 'install.finalize_options', (['self'], {}), '(self)\n', (368, 374), False, 'from setuptools.command.install import install\n'), ((403, 420), 'setuptools.command.install.install.run', 'install.run', (['self'], {}), '(self)\n', (414, 420), False, 'from setuptools.command.install import install\n'), ((519, 576), 'xmediusmailrelayserver.console.install_service', 'console.install_service', (["['--startup', 'auto', 'install']"], {}), "(['--startup', 'auto', 'install'])\n", (542, 576), False, 'from xmediusmailrelayserver import console\n')]