import os
import sys

from os.path import join as pjoin

from setuptools import setup
from setuptools import Command
from subprocess import call


def read_version_string():
    version = None
    sys.path.insert(0, pjoin(os.getcwd()))
    from file_syncer import __version__
    version = __version__
    sys.path.pop(0)
    return version


class Pep8Command(Command):
    description = 'run pep8 script'
    user_options = []

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        try:
            import pep8

            pep8
        except ImportError:
            print ('Missing "pep8" library. You can install it using pip: '
                   'pip install pep8')
            sys.exit(1)

        cwd = os.getcwd()
        retcode = call(('pep8 %s/file_syncer' % (cwd)).split(' '))
        sys.exit(retcode)

setup(
    name='file_syncer',
    version=read_version_string(),
    scripts=[os.path.join(os.getcwd(), 'bin/file-syncer')],
    packages=[
        'file_syncer'
    ],
    package_dir={
        'file_syncer': 'file_syncer'
    },
    install_requires=[
        'apache-libcloud>=0.13.0',
        'gevent'
    ],
    url='https://github.com/Kami/python-file-syncer/',
    license='Apache License (2.0)',
    author='Tomaz Muraus',
    author_email='tomaz+pypi@tomaz.me',
    description='Python program which synchronizes files from a local ' +
                 'directory to one of the storage providers supported by ' +
                 'Libcloud.',
    cmdclass={
        'pep8': Pep8Command
    }
)

@@ -945,16 +945,106 @@
 ring(),%0A
+    long_description=open('README.rst').read() + '%5Cn%5Cn' +%0A    open('CHANGES.rst').read(),%0A
     scri
@@ -1670,11 +1670,597 @@
 nd%0A    %7D
+,%0A    classifiers=%5B%0A        'Development Status :: 4 - Beta',%0A        'Environment :: Console',%0A        'Intended Audience :: Developers',%0A        'Intended Audience :: System Administrators',%0A        'Operating System :: OS Independent',%0A        'License :: OSI Approved :: Apache Software License',%0A        'Programming Language :: Python',%0A        'Programming Language :: Python :: 2.6',%0A        'Programming Language :: Python :: 2.7',%0A        'Programming Language :: Python :: Implementation :: PyPy',%0A        'Topic :: Software Development :: Libraries :: Python Modules',%0A    %5D
 %0A)%0A

Update setup.py.