Set configuration file ownership
[rainbowstream.git] / setup.py
1 from setuptools import setup, find_packages
2 import os
3 import os.path
4 import sys
5
6 if sys.version[0] == "2":
7 from pipes import quote
8 else:
9 from shlex import quote
10
11 # Bumped version
12 version = '1.3.3'
13
14 # Require
15 install_requires = [
16 "python-dateutil",
17 "arrow",
18 "requests==2.5.3",
19 "pyfiglet",
20 "twitter",
21 "Pillow",
22 "PySocks"
23 ]
24
25 # Default user (considers non virtualenv method)
26 user = os.environ.get('SUDO_USER', os.environ['USER'])
27
28 # Copy default config if not exists
29 default = os.path.expanduser("~") + os.sep + '.rainbow_config.json'
30 if not os.path.isfile(default):
31 cmd = 'cp rainbowstream/colorset/config ' + default
32 os.system(cmd)
33 cmd = 'chown ' + quote(user) + ' ' + default
34 os.system(cmd)
35 cmd = 'chmod 777 ' + default
36 os.system(cmd)
37
38 # Setup
39 setup(name='rainbowstream',
40 version=version,
41 description="A smart and nice Twitter client on terminal.",
42 long_description=open("./README.rst", "r").read(),
43 classifiers=[
44 "Development Status :: 5 - Production/Stable",
45 "Environment :: Console",
46 "Intended Audience :: End Users/Desktop",
47 "Natural Language :: English",
48 "Operating System :: OS Independent",
49 "Programming Language :: Python :: 2.7",
50 "Programming Language :: Python :: 3.2",
51 "Programming Language :: Python :: 3.3",
52 "Programming Language :: Python :: 3.4",
53 "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
54 "Topic :: Utilities",
55 "License :: OSI Approved :: MIT License",
56 ],
57 keywords='twitter, command-line tools, stream API',
58 author='Vu Nhat Minh',
59 author_email='nhatminh179@gmail.com',
60 url='http://www.rainbowstream.org/',
61 license='MIT License',
62 packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
63 include_package_data=True,
64 zip_safe=True,
65 install_requires=install_requires,
66 entry_points="""
67 # -*- Entry points: -*-
68 [console_scripts]
69 rainbowstream=rainbowstream.rainbow:fly
70 """,
71 )