X-Git-Url: https://vcs.fsf.org/?p=rainbowstream.git;a=blobdiff_plain;f=rainbowstream%2Futil.py;h=03eaf903b91a4ee375a98c98e7379ada48cabce5;hp=232845c031e807709fb368e3142ce5d91cd72bc8;hb=8daad13dbe93e2836d929bf149b695b760d69bf8;hpb=ee82b293885a90d84f4c79ffb67a804ada423208 diff --git a/rainbowstream/util.py b/rainbowstream/util.py index 232845c..03eaf90 100644 --- a/rainbowstream/util.py +++ b/rainbowstream/util.py @@ -1,16 +1,17 @@ import json from twitter.util import printNicely - -from .colors import magenta +from .colors import * def printTwitterErrors(twitterException): + """ + Display Twitter Errors nicely + """ try: loadedJson = json.loads(twitterException.response_data) for m in loadedJson.get('errors', dict()): printNicely( magenta("Error " + str(m.get('code')) + ": " + m.get('message'))) except ValueError: - printNicely( - magenta( "Error: " + twitterException.response_data)) + printNicely(magenta("Error: " + twitterException.response_data))