mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-03-14 01:23:21 -06:00
Strings are unicode now.
This commit is contained in:
parent
885829a930
commit
1c4db4a10e
@ -947,8 +947,8 @@ class Controller(object):
|
||||
x = tweet["coordinates"]["coordinates"][0]
|
||||
y = tweet["coordinates"]["coordinates"][1]
|
||||
address = geocoder.reverse_geocode(y, x)
|
||||
if event == None: output.speak(address[0].__str__().decode("utf-8"))
|
||||
else: self.view.show_address(address[0].__str__().decode("utf-8"))
|
||||
if event == None: output.speak(address[0].__str__())
|
||||
else: self.view.show_address(address[0].__str__())
|
||||
else:
|
||||
output.speak(_(u"There are no coordinates in this tweet"))
|
||||
except GeocoderError:
|
||||
|
@ -232,7 +232,7 @@ class viewTweet(basicTweet):
|
||||
rt_count = str(tweet["retweet_count"])
|
||||
favs_count = str(tweet["favorite_count"])
|
||||
# Gets the client from where this tweet was made.
|
||||
source = str(re.sub(r"(?s)<.*?>", "", tweet["source"].encode("utf-8")))
|
||||
source = str(re.sub(r"(?s)<.*?>", "", str(tweet["source"])))
|
||||
if text == "":
|
||||
if "message" in tweet:
|
||||
value = "message"
|
||||
@ -254,7 +254,7 @@ class viewTweet(basicTweet):
|
||||
for z in tweet["retweeted_status"]["extended_entities"]["media"]:
|
||||
if "ext_alt_text" in z and z["ext_alt_text"] != None:
|
||||
image_description.append(z["ext_alt_text"])
|
||||
self.message = message.viewTweet(text, rt_count, favs_count, source.decode("utf-8"))
|
||||
self.message = message.viewTweet(text, rt_count, favs_count, source)
|
||||
self.message.set_title(len(text))
|
||||
[self.message.set_image_description(i) for i in image_description]
|
||||
else:
|
||||
|
@ -29,7 +29,7 @@ def StripChars(s):
|
||||
Else, a unicode string will be returned."""
|
||||
if match.group(1).startswith('#'): return chr(int(match.group(1)[1:]))
|
||||
replacement = html.entities.entitydefs.get(match.group(1), "&%s;" % match.group(1))
|
||||
return replacement.decode('iso-8859-1')
|
||||
return replacement
|
||||
return str(entity_re.sub(matchFunc, s))
|
||||
|
||||
chars = "abcdefghijklmnopqrstuvwxyz"
|
||||
|
@ -13,7 +13,7 @@ class TinyArrowsShortener (URLShortener):
|
||||
def _shorten (self, url):
|
||||
answer = url
|
||||
answer = urllib.request.urlopen("http://tinyarro.ws/api-create.php?utfpure=1&url=%s" % urllib.parse.quote(url)).read()
|
||||
return answer.decode('UTF-8')
|
||||
return answer
|
||||
|
||||
def created_url(self, url):
|
||||
return False
|
||||
|
Loading…
x
Reference in New Issue
Block a user