add comments and fix bug in upgrade_center with python3
authorOrakaro <nhatminh_179@hotmail.com>
Fri, 19 Sep 2014 13:17:43 +0000 (22:17 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Fri, 19 Sep 2014 13:17:43 +0000 (22:17 +0900)
README.rst
docs/conf.py
docs/index.rst
rainbowstream/colors.py
rainbowstream/rainbow.py
setup.py

index 35480342f3fb03e92255507ce638b6fc61a5ddc6..7727f720c57ed94c7aaa6fb1813c4ce60e6d69f7 100644 (file)
@@ -182,7 +182,6 @@ steps
        source venv/bin/activate\r
        pip install -e .\r
        which rainbowstream # /this-directory/venv/bin/rainbowstream\r
        source venv/bin/activate\r
        pip install -e .\r
        which rainbowstream # /this-directory/venv/bin/rainbowstream\r
-       pip list | grep rainbowstream # rainbowstream (0.x.x, /this-directory)\r
        # Remove ~/.rainbow_oauth if exists\r
        rainbowstream # local version of rainbowstream\r
 \r
        # Remove ~/.rainbow_oauth if exists\r
        rainbowstream # local version of rainbowstream\r
 \r
index 640b5294f0a9d8ccfef8aff16f5983888428fa5b..12243a63472e790d1df52026debe5030f1e0623e 100644 (file)
@@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh'
 # built documents.
 #
 # The short X.Y version.
 # built documents.
 #
 # The short X.Y version.
-version = '1.0.5'
+version = '1.0.6'
 # The full version, including alpha/beta/rc tags.
 # The full version, including alpha/beta/rc tags.
-release = '1.0.5'
+release = '1.0.6'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index e652ecd89746a8898992ee255743c7b40f54c52d..e42c9276afc5c402b0ecc3a16d93d8a9c2cb8e53 100644 (file)
@@ -373,8 +373,8 @@ You also can view or set a new value of every config key by ``config`` command (
     + ``#recipient_name``: Message's recipient name\r
     + ``#recipient_nick``: Message's recipient screen name\r
 \r
     + ``#recipient_name``: Message's recipient name\r
     + ``#recipient_nick``: Message's recipient screen name\r
 \r
-In every format, you can use unicode characters like ``\u2665``. \r
-Mac users also can use emoji characters as well (Ex: ``::zap::``). \r
+In every format, you can use unicode characters like ``\u2665``.\r
+Mac users also can use emoji characters as well (Ex: ``::zap::``).\r
 See `Emoji cheatsheet`_ for details.\r
 \r
 Development\r
 See `Emoji cheatsheet`_ for details.\r
 \r
 Development\r
@@ -404,7 +404,6 @@ steps
        source venv/bin/activate\r
        pip install -e .\r
        which rainbowstream # /this-directory/venv/bin/rainbowstream\r
        source venv/bin/activate\r
        pip install -e .\r
        which rainbowstream # /this-directory/venv/bin/rainbowstream\r
-       pip list | grep rainbowstream # rainbowstream (0.x.x, /this-directory)\r
        # Remove ~/.rainbow_oauth if exists\r
        rainbowstream # local version of rainbowstream\r
 \r
        # Remove ~/.rainbow_oauth if exists\r
        rainbowstream # local version of rainbowstream\r
 \r
index 335847f620389b0863fe31357155a9a9572fe1f2..a39dcb6b0c41ac9d78e1495c27e92bf4cda17d56 100644 (file)
@@ -3,6 +3,10 @@ def basic_color(code):
     16 colors supported
     """
     def inner(text, rl=False):
     16 colors supported
     """
     def inner(text, rl=False):
+        """
+        Every raw_input with color sequences should be called with
+        rl=True to avoid readline messed up the length calculation
+        """
         c = code
         if rl:
             return "\001\033[%sm\002%s\001\033[0m\002" % (c, text)
         c = code
         if rl:
             return "\001\033[%sm\002%s\001\033[0m\002" % (c, text)
@@ -16,6 +20,10 @@ def term_color(code):
     256 colors supported
     """
     def inner(text, rl=False):
     256 colors supported
     """
     def inner(text, rl=False):
+        """
+        Every raw_input with color sequences should be called with
+        rl=True to avoid readline messed up the length calculation
+        """
         c = code
         if rl:
             return "\001\033[38;5;%sm\002%s\001\033[0m\002" % (c, text)
         c = code
         if rl:
             return "\001\033[38;5;%sm\002%s\001\033[0m\002" % (c, text)
index b4cd5f9b7fca71534c679eaa6480680b15d47e65..d67be609a9378dd515025c7e06e3c5163768ee94 100644 (file)
@@ -126,7 +126,7 @@ def upgrade_center():
     try:
         current = pkg_resources.get_distribution("rainbowstream").version
         url = 'https://raw.githubusercontent.com/DTVD/rainbowstream/master/setup.py'
     try:
         current = pkg_resources.get_distribution("rainbowstream").version
         url = 'https://raw.githubusercontent.com/DTVD/rainbowstream/master/setup.py'
-        readme = requests.get(url).content
+        readme = requests.get(url).text
         latest = readme.split("version = \'")[1].split("\'")[0]
         if current != latest:
             notice = light_magenta('RainbowStream latest version is ')
         latest = readme.split("version = \'")[1].split("\'")[0]
         if current != latest:
             notice = light_magenta('RainbowStream latest version is ')
@@ -291,7 +291,8 @@ def view():
             num = int(g['stuff'].split()[1])
         except:
             num = c['HOME_TWEET_NUM']
             num = int(g['stuff'].split()[1])
         except:
             num = c['HOME_TWEET_NUM']
-        for tweet in reversed(t.statuses.user_timeline(count=num, screen_name=user[1:])):
+        for tweet in reversed(
+                t.statuses.user_timeline(count=num, screen_name=user[1:])):
             draw(t=tweet)
         printNicely('')
     else:
             draw(t=tweet)
         printNicely('')
     else:
index 1e28de91675187c5a91fd21d0c8a411bed1ae7f4..07e5aa5a2ddfb5996047f917ec3392a107f0a7b1 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import os
 import os.path
 
 # Bumped version
 import os.path
 
 # Bumped version
-version = '1.0.5'
+version = '1.0.6'
 
 # Require
 install_requires = [
 
 # Require
 install_requires = [