open file with encoding (python 2/3 supported)
[rainbowstream.git] / setup.py
index 294fd8672795dec3b2c9725f6edb180261ec376c..f671f4913193709bc6e5a8d200a21ea9bcff792d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,8 +1,13 @@
 from setuptools import setup, find_packages
+from io import open
+import os
+import os.path
 import sys
 
-version = '0.3.4'
+# Bumped version
+version = '0.5.7'
 
+# Require
 install_requires = [
     "python-dateutil",
     "requests",
@@ -11,13 +16,24 @@ install_requires = [
     "twitter",
     "Pillow",
 ]
+
+# Python 3 doesn't have pysqlite
 if sys.version[0] == "2":
     install_requires += ["pysqlite"]
 
+# Copy default config if not exists
+default = os.path.expanduser("~") + os.sep + '.rainbow_config.json'
+if not os.path.isfile(default):
+    cmd = 'cp rainbowstream/colorset/config ' + default
+    os.system(cmd)
+    cmd = 'chmod 777 ' + default
+    os.system(cmd)
+
+# Setup
 setup(name='rainbowstream',
       version=version,
       description="A smart and nice Twitter client on terminal.",
-      long_description=open("./README.rst", "r").read(),
+      long_description=open("./README.rst", "r", encoding='utf-8').read(),
       classifiers=[
           "Development Status :: 5 - Production/Stable",
           "Environment :: Console",