Display detail error when over 140 character limit
authorvunhat_minh <vunhat_minh@dwango.co.jp>
Fri, 31 Jul 2015 07:43:03 +0000 (16:43 +0900)
committervunhat_minh <vunhat_minh@dwango.co.jp>
Fri, 31 Jul 2015 07:43:03 +0000 (16:43 +0900)
docs/conf.py
rainbowstream/rainbow.py
setup.py

index b5aaf71c5d0732d647d716e6e8f56e1fd21bc3bb..3c2d6aab138df5df363425a5b177581f57bbe74a 100644 (file)
@@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh'
 # built documents.
 #
 # The short X.Y version.
-version = '1.2.9'
+version = '1.3.0'
 # The full version, including alpha/beta/rc tags.
-release = '1.2.9'
+release = '1.3.0'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index e7eede6a765dd1dacd6e3ff3a61863f031e7c8b1..114e42514d7fe71aa3930041bc84dee75975ba87 100644 (file)
@@ -1950,33 +1950,22 @@ def listen():
             # Save cmd to global variable and call process
             g['stuff'] = ' '.join(line.split()[1:])
             # Check tweet length
-            if check_tweet_length():
-                # Process the command
-                process(cmd)()
-                # Not re-display
-                if cmd in ['switch', 't', 'rt', 'rep']:
-                    g['prefix'] = False
-                else:
-                    g['prefix'] = True
+            # Process the command
+            process(cmd)()
+            # Not re-display
+            if cmd in ['switch', 't', 'rt', 'rep']:
+                g['prefix'] = False
+            else:
+                g['prefix'] = True
             # Release the semaphore lock
             c['lock'] = False
         except EOFError:
             printNicely('')
+        except TwitterHTTPError as e:
+            detail_twitter_error(e)
         except Exception:
             debug_option()
-            printNicely(red('OMG something is wrong with Twitter right now.'))
-
-
-def check_tweet_length():
-    """
-    Check tweet length (should be <= 140 chars)
-    """
-    length = len(g['stuff'])
-    if length <= 140:
-        return True
-
-    printNicely(red("Message is too long: %s chars" % length))
-    return False
+            printNicely(red('OMG something is wrong with Twitter API right now.'))
 
 
 def reconn_notice():
index 9a28b1ed62adf4074dc2116d2faefefcbc4deebf..74c671df1af697f4b27917931f2cfa31c47e602c 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import os
 import os.path
 
 # Bumped version
-version = '1.2.9'
+version = '1.3.0'
 
 # Require
 install_requires = [