mirror of
				https://github.com/MCV-Software/TWBlue.git
				synced 2025-10-31 04:12:00 +00:00 
			
		
		
		
	Added source in view tweet dialogue. @masonasons
This commit is contained in:
		| @@ -1,4 +1,5 @@ | |||||||
| # -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||||
|  | import re | ||||||
| import platform | import platform | ||||||
| system = platform.system() | system = platform.system() | ||||||
| import widgetUtils | import widgetUtils | ||||||
| @@ -173,13 +174,14 @@ class viewTweet(basicTweet): | |||||||
|      text = text + "@%s: %s\n" % (tweetList[i]["user"]["screen_name"], tweetList[i]["text"]) |      text = text + "@%s: %s\n" % (tweetList[i]["user"]["screen_name"], tweetList[i]["text"]) | ||||||
|    rt_count = str(tweet["retweet_count"]) |    rt_count = str(tweet["retweet_count"]) | ||||||
|    favs_count = str(tweet["favorite_count"]) |    favs_count = str(tweet["favorite_count"]) | ||||||
|  |    source = str(re.sub(r"(?s)<.*?>", "", tweet["source"])) | ||||||
|    if text == "": |    if text == "": | ||||||
|     if tweet.has_key("retweeted_status"): |     if tweet.has_key("retweeted_status"): | ||||||
|      text = "rt @%s: %s" % (tweet["retweeted_status"]["user"]["screen_name"], tweet["retweeted_status"]["text"]) |      text = "rt @%s: %s" % (tweet["retweeted_status"]["user"]["screen_name"], tweet["retweeted_status"]["text"]) | ||||||
|     else: |     else: | ||||||
|      text = tweet["text"] |      text = tweet["text"] | ||||||
|    text = self.clear_text(text) |    text = self.clear_text(text) | ||||||
|    self.message = message.viewTweet(text, rt_count, favs_count) |    self.message = message.viewTweet(text, rt_count, favs_count,source) | ||||||
|    self.message.set_title(len(text)) |    self.message.set_title(len(text)) | ||||||
|   else: |   else: | ||||||
|    text = tweet |    text = tweet | ||||||
|   | |||||||
| @@ -245,7 +245,7 @@ class viewTweet(widgetUtils.BaseDialog): | |||||||
|  def set_title(self, lenght): |  def set_title(self, lenght): | ||||||
|   self.SetTitle(_(u"Tweet - %i characters ") % (lenght,)) |   self.SetTitle(_(u"Tweet - %i characters ") % (lenght,)) | ||||||
|  |  | ||||||
|  def __init__(self, text, rt_count, favs_count): |  def __init__(self, text, rt_count, favs_count,source): | ||||||
|   super(viewTweet, self).__init__(None, size=(850,850)) |   super(viewTweet, self).__init__(None, size=(850,850)) | ||||||
|   panel = wx.Panel(self) |   panel = wx.Panel(self) | ||||||
|   label = wx.StaticText(panel, -1, _(u"Tweet")) |   label = wx.StaticText(panel, -1, _(u"Tweet")) | ||||||
| @@ -270,9 +270,15 @@ class viewTweet(widgetUtils.BaseDialog): | |||||||
|   favsBox = wx.BoxSizer(wx.HORIZONTAL) |   favsBox = wx.BoxSizer(wx.HORIZONTAL) | ||||||
|   favsBox.Add(favsCountLabel, 0, wx.ALL, 5) |   favsBox.Add(favsCountLabel, 0, wx.ALL, 5) | ||||||
|   favsBox.Add(favsCount, 0, wx.ALL, 5) |   favsBox.Add(favsCount, 0, wx.ALL, 5) | ||||||
|  |   sourceLabel = wx.StaticText(panel, -1, _(u"Source: ")) | ||||||
|  |   sourceTweet = wx.TextCtrl(panel, -1, source, size=wx.DefaultSize, style=wx.TE_READONLY|wx.TE_MULTILINE) | ||||||
|  |   sourceBox = wx.BoxSizer(wx.HORIZONTAL) | ||||||
|  |   sourceBox.Add(sourceLabel, 0, wx.ALL, 5) | ||||||
|  |   sourceBox.Add(sourceTweet, 0, wx.ALL, 5) | ||||||
|   infoBox = wx.BoxSizer(wx.HORIZONTAL) |   infoBox = wx.BoxSizer(wx.HORIZONTAL) | ||||||
|   infoBox.Add(rtBox, 0, wx.ALL, 5) |   infoBox.Add(rtBox, 0, wx.ALL, 5) | ||||||
|   infoBox.Add(favsBox, 0, wx.ALL, 5) |   infoBox.Add(favsBox, 0, wx.ALL, 5) | ||||||
|  |   infoBox.Add(sourceBox, 0, wx.ALL, 5) | ||||||
|   mainBox.Add(infoBox, 0, wx.ALL, 5) |   mainBox.Add(infoBox, 0, wx.ALL, 5) | ||||||
|   self.spellcheck = wx.Button(panel, -1, _("Spelling correction"), size=wx.DefaultSize) |   self.spellcheck = wx.Button(panel, -1, _("Spelling correction"), size=wx.DefaultSize) | ||||||
|   self.unshortenButton = wx.Button(panel, -1, _(u"Expand URL"), size=wx.DefaultSize) |   self.unshortenButton = wx.Button(panel, -1, _(u"Expand URL"), size=wx.DefaultSize) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user