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 b5aaf71..3c2d6aa 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 e7eede6..114e425 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 9a28b1e..74c671d 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 = [