mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-28 10:49:22 +00:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
30f739c42e | |||
eb0679cb96 | |||
45deae3402 | |||
5b0b26799d | |||
ee234b80a7 | |||
0065af2aef | |||
9c086cfa0f | |||
2f263a23b7 | |||
9cb6eafbbc |
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
## changes in this version
|
## changes in this version
|
||||||
|
|
||||||
|
* TWBlue should render correctly retweets of quoted tweets. ([#365,](https://github.com/manuelcortez/TWBlue/issues/365))
|
||||||
|
* Fixed an error that was causing TWBlue to be unable to output to screen readers at times. ([#369,](https://github.com/manuelcortez/TWBlue/issues/369))
|
||||||
|
* Fixed autocomplete users feature. ([#367,](https://github.com/manuelcortez/TWBlue/issues/367))
|
||||||
* Fixed error when displaying an URL at the end of a line, when the tweet or direct message contained multiple lines. Now the URL should be displayed correctly. ([#305,](https://github.com/manuelcortez/TWBlue/issues/305) [#272,](https://github.com/manuelcortez/TWBlue/issues/272))
|
* Fixed error when displaying an URL at the end of a line, when the tweet or direct message contained multiple lines. Now the URL should be displayed correctly. ([#305,](https://github.com/manuelcortez/TWBlue/issues/305) [#272,](https://github.com/manuelcortez/TWBlue/issues/272))
|
||||||
* TWBlue has been migrated completely to Python 3 (currently, the software builds with Python 3.8).
|
* TWBlue has been migrated completely to Python 3 (currently, the software builds with Python 3.8).
|
||||||
* TWBlue should be restarted gracefully. Before, the application was alerting users of not being closed properly every time the application restarted by itself.
|
* TWBlue should be restarted gracefully. Before, the application was alerting users of not being closed properly every time the application restarted by itself.
|
||||||
|
@@ -31,7 +31,7 @@ cx_freeze
|
|||||||
tweepy
|
tweepy
|
||||||
twitter-text-parser
|
twitter-text-parser
|
||||||
pyenchant
|
pyenchant
|
||||||
git+https://github.com/manuelcortez/libloader
|
git+https://github.com/accessibleapps/libloader
|
||||||
git+https://github.com/manuelcortez/platform_utils
|
git+https://github.com/accessibleapps/platform_utils
|
||||||
git+https://github.com/manuelcortez/accessible_output2
|
git+https://github.com/accessibleapps/accessible_output2
|
||||||
git+https://github.com/jmdaweb/sound_lib
|
git+https://github.com/accessibleapps/sound_lib
|
@@ -9,7 +9,7 @@ if snapshot == False:
|
|||||||
update_url = 'https://twblue.es/updates/stable.php'
|
update_url = 'https://twblue.es/updates/stable.php'
|
||||||
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/stable.json'
|
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/stable.json'
|
||||||
else:
|
else:
|
||||||
version = "4"
|
version = "5"
|
||||||
update_url = 'https://twblue.es/updates/snapshot.php'
|
update_url = 'https://twblue.es/updates/snapshot.php'
|
||||||
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/snapshots.json'
|
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/snapshots.json'
|
||||||
authors = ["Manuel Cortéz", "José Manuel Delicado"]
|
authors = ["Manuel Cortéz", "José Manuel Delicado"]
|
||||||
|
@@ -253,7 +253,7 @@ class Controller(object):
|
|||||||
|
|
||||||
# Connection checker executed each minute.
|
# Connection checker executed each minute.
|
||||||
self.checker_function = RepeatingTimer(60, self.check_connection)
|
self.checker_function = RepeatingTimer(60, self.check_connection)
|
||||||
self.checker_function.start()
|
# self.checker_function.start()
|
||||||
self.save_db = RepeatingTimer(300, self.save_data_in_db)
|
self.save_db = RepeatingTimer(300, self.save_data_in_db)
|
||||||
self.save_db.start()
|
self.save_db.start()
|
||||||
log.debug("Setting updates to buffers every %d seconds..." % (60*config.app["app-settings"]["update_period"],))
|
log.debug("Setting updates to buffers every %d seconds..." % (60*config.app["app-settings"]["update_period"],))
|
||||||
@@ -1326,16 +1326,20 @@ class Controller(object):
|
|||||||
i.start_stream()
|
i.start_stream()
|
||||||
else:
|
else:
|
||||||
i.start_stream(play_sound=False)
|
i.start_stream(play_sound=False)
|
||||||
except TweepError:
|
except TweepError as err:
|
||||||
buff = self.view.search(i.name, i.account)
|
log.exception("Error %s starting buffer %s on account %s, with args %r and kwargs %r due to the following reason: %s" % (err.api_code, i.name, i.account, i.args, i.kwargs, err.reason))
|
||||||
i.remove_buffer(force=True)
|
# Determine if this error was caused by a block applied to the current user (IE permission errors).
|
||||||
commonMessageDialogs.blocked_timeline()
|
errors_allowed = [130]
|
||||||
if self.get_current_buffer() == i:
|
if (err.api_code != None and err.api_code not in errors_allowed) or (err.api_code == None and 'Not authorized' in err.reason): # A twitter error, so safely try to remove the buffer.
|
||||||
self.right()
|
buff = self.view.search(i.name, i.account)
|
||||||
self.view.delete_buffer(buff)
|
i.remove_buffer(force=True)
|
||||||
self.buffers.remove(i)
|
commonMessageDialogs.blocked_timeline()
|
||||||
del i
|
if self.get_current_buffer() == i:
|
||||||
continue
|
self.right()
|
||||||
|
self.view.delete_buffer(buff)
|
||||||
|
self.buffers.remove(i)
|
||||||
|
del i
|
||||||
|
continue
|
||||||
if change_title:
|
if change_title:
|
||||||
pub.sendMessage("buffer-title-changed", buffer=i)
|
pub.sendMessage("buffer-title-changed", buffer=i)
|
||||||
|
|
||||||
@@ -1532,15 +1536,19 @@ class Controller(object):
|
|||||||
if i.session != None and i.session.is_logged == True:
|
if i.session != None and i.session.is_logged == True:
|
||||||
try:
|
try:
|
||||||
i.start_stream(mandatory=True)
|
i.start_stream(mandatory=True)
|
||||||
except TweepError:
|
except TweepError as err:
|
||||||
buff = self.view.search(i.name, i.account)
|
log.exception("Error %s starting buffer %s on account %s, with args %r and kwargs %r due to the following reason: %s" % (err.api_code, i.name, i.account, i.args, i.kwargs, err.reason))
|
||||||
i.remove_buffer(force=True)
|
# Determine if this error was caused by a block applied to the current user (IE permission errors).
|
||||||
commonMessageDialogs.blocked_timeline()
|
errors_allowed = [130]
|
||||||
if self.get_current_buffer() == i:
|
if (err.api_code != None and err.api_code not in errors_allowed) or (err.api_code == None and 'Not authorized' in err.reason): # A twitter error, so safely try to remove the buffer.
|
||||||
self.right()
|
buff = self.view.search(i.name, i.account)
|
||||||
self.view.delete_buffer(buff)
|
i.remove_buffer(force=True)
|
||||||
self.buffers.remove(i)
|
commonMessageDialogs.blocked_timeline()
|
||||||
del i
|
if self.get_current_buffer() == i:
|
||||||
|
self.right()
|
||||||
|
self.view.delete_buffer(buff)
|
||||||
|
self.buffers.remove(i)
|
||||||
|
del i
|
||||||
|
|
||||||
def update_buffer(self, *args, **kwargs):
|
def update_buffer(self, *args, **kwargs):
|
||||||
bf = self.get_current_buffer()
|
bf = self.get_current_buffer()
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
from builtins import object
|
|
||||||
import output
|
import output
|
||||||
from . import storage
|
from . import storage
|
||||||
from . import wx_menu
|
from . import wx_menu
|
||||||
|
@@ -1,11 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
from builtins import object
|
|
||||||
from . import storage
|
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
from . import wx_manage
|
from . import storage, wx_manage
|
||||||
from wxUI import commonMessageDialogs
|
from wxUI import commonMessageDialogs
|
||||||
|
|
||||||
class autocompletionManage(object):
|
class autocompletionManage(object):
|
||||||
@@ -32,11 +27,11 @@ class autocompletionManage(object):
|
|||||||
if usr == False:
|
if usr == False:
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
data = self.session.twitter.twitter.show_user(screen_name=usr)
|
data = self.session.twitter.twitter.get_user(screen_name=usr)
|
||||||
except:
|
except:
|
||||||
self.dialog.show_invalid_user_error()
|
self.dialog.show_invalid_user_error()
|
||||||
return
|
return
|
||||||
self.database.set_user(data["screen_name"], data["name"], 0)
|
self.database.set_user(data.screen_name, data.name, 0)
|
||||||
self.update_list()
|
self.update_list()
|
||||||
|
|
||||||
def remove_user(self, ev):
|
def remove_user(self, ev):
|
||||||
|
@@ -1,13 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
from builtins import object
|
|
||||||
from . import storage
|
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
|
import output
|
||||||
from . import wx_settings
|
from . import wx_settings
|
||||||
from . import manage
|
from . import manage
|
||||||
import output
|
from . import storage
|
||||||
from mysc.thread_utils import call_threaded
|
from mysc.thread_utils import call_threaded
|
||||||
|
|
||||||
class autocompletionSettings(object):
|
class autocompletionSettings(object):
|
||||||
@@ -30,14 +26,14 @@ class autocompletionSettings(object):
|
|||||||
database = storage.storage(self.buffer.session.session_id)
|
database = storage.storage(self.buffer.session.session_id)
|
||||||
if self.dialog.get("followers_buffer") == True:
|
if self.dialog.get("followers_buffer") == True:
|
||||||
buffer = self.window.search_buffer("followers", self.config["twitter"]["user_name"])
|
buffer = self.window.search_buffer("followers", self.config["twitter"]["user_name"])
|
||||||
for i in buffer.session.db[buffer.name]["items"]:
|
for i in buffer.session.db[buffer.name]:
|
||||||
database.set_user(i["screen_name"], i["name"], 1)
|
database.set_user(i.screen_name, i.name, 1)
|
||||||
else:
|
else:
|
||||||
database.remove_by_buffer(1)
|
database.remove_by_buffer(1)
|
||||||
if self.dialog.get("friends_buffer") == True:
|
if self.dialog.get("friends_buffer") == True:
|
||||||
buffer = self.window.search_buffer("friends", self.config["twitter"]["user_name"])
|
buffer = self.window.search_buffer("friends", self.config["twitter"]["user_name"])
|
||||||
for i in buffer.session.db[buffer.name]["items"]:
|
for i in buffer.session.db[buffer.name]:
|
||||||
database.set_user(i["screen_name"], i["name"], 2)
|
database.set_user(i.screen_name, i.name, 2)
|
||||||
else:
|
else:
|
||||||
database.remove_by_buffer(2)
|
database.remove_by_buffer(2)
|
||||||
wx_settings.show_success_dialog()
|
wx_settings.show_success_dialog()
|
||||||
@@ -52,12 +48,12 @@ def execute_at_startup(window, buffer, config):
|
|||||||
if config["mysc"]["save_followers_in_autocompletion_db"] == True and config["other_buffers"]["show_followers"] == True:
|
if config["mysc"]["save_followers_in_autocompletion_db"] == True and config["other_buffers"]["show_followers"] == True:
|
||||||
buffer = window.search_buffer("followers", config["twitter"]["user_name"])
|
buffer = window.search_buffer("followers", config["twitter"]["user_name"])
|
||||||
for i in buffer.session.db[buffer.name]:
|
for i in buffer.session.db[buffer.name]:
|
||||||
database.set_user(i["screen_name"], i["name"], 1)
|
database.set_user(i.screen_name, i.name, 1)
|
||||||
else:
|
else:
|
||||||
database.remove_by_buffer(1)
|
database.remove_by_buffer(1)
|
||||||
if config["mysc"]["save_friends_in_autocompletion_db"] == True and config["other_buffers"]["show_friends"] == True:
|
if config["mysc"]["save_friends_in_autocompletion_db"] == True and config["other_buffers"]["show_friends"] == True:
|
||||||
buffer = window.search_buffer("friends", config["twitter"]["user_name"])
|
buffer = window.search_buffer("friends", config["twitter"]["user_name"])
|
||||||
for i in buffer.session.db[buffer.name]:
|
for i in buffer.session.db[buffer.name]:
|
||||||
database.set_user(i["screen_name"], i["name"], 2)
|
database.set_user(i.screen_name, i.name, 2)
|
||||||
else:
|
else:
|
||||||
database.remove_by_buffer(2)
|
database.remove_by_buffer(2)
|
@@ -1,6 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
from builtins import object
|
|
||||||
import os, sqlite3, paths
|
import os, sqlite3, paths
|
||||||
|
|
||||||
class storage(object):
|
class storage(object):
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
import wx
|
import wx
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
from multiplatform_widgets import widgets
|
from multiplatform_widgets import widgets
|
||||||
import application
|
import application
|
||||||
|
|
||||||
class autocompletionManageDialog(widgetUtils.BaseDialog):
|
class autocompletionManageDialog(widgetUtils.BaseDialog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(autocompletionManageDialog, self).__init__(parent=None, id=-1, title=_(u"Manage Autocompletion database"))
|
super(autocompletionManageDialog, self).__init__(parent=None, id=-1, title=_(u"Manage Autocompletion database"))
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
import wx
|
import wx
|
||||||
|
|
||||||
class menu(wx.Menu):
|
class menu(wx.Menu):
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
import wx
|
import wx
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
import application
|
import application
|
||||||
|
@@ -25,7 +25,7 @@ def is_long(tweet):
|
|||||||
returns True if a quote is detected, False otherwise."""
|
returns True if a quote is detected, False otherwise."""
|
||||||
if hasattr(tweet, "quoted_status_id") and hasattr(tweet, "quoted_status"):
|
if hasattr(tweet, "quoted_status_id") and hasattr(tweet, "quoted_status"):
|
||||||
return tweet.quoted_status_id
|
return tweet.quoted_status_id
|
||||||
elif hasattr(tweet, "retweeted_status") and hasattr(tweet, "quoted_status_id") and hasattr(tweet, "quoted_status"):
|
elif hasattr(tweet, "retweeted_status") and hasattr(tweet.retweeted_status, "quoted_status_id") and hasattr(tweet.retweeted_status, "quoted_status"):
|
||||||
return tweet.retweeted_status.quoted_status_id
|
return tweet.retweeted_status.quoted_status_id
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@@ -352,16 +352,16 @@ class Session(base.baseSession):
|
|||||||
return tweet
|
return tweet
|
||||||
|
|
||||||
def get_quoted_tweet(self, tweet):
|
def get_quoted_tweet(self, tweet):
|
||||||
""" Process a tweet and extract all information related to the quote."""
|
""" Process a tweet and extract all information related to the quote. """
|
||||||
quoted_tweet = tweet
|
quoted_tweet = tweet
|
||||||
if hasattr(tweet, "full_text"):
|
if hasattr(tweet, "full_text"):
|
||||||
value = "full_text"
|
value = "full_text"
|
||||||
else:
|
else:
|
||||||
value = "text"
|
value = "text"
|
||||||
setattr(quoted_tweet, value, utils.expand_urls(getattr(quoted_tweet, value), quoted_tweet.entities))
|
setattr(quoted_tweet, value, utils.expand_urls(getattr(quoted_tweet, value), quoted_tweet.entities))
|
||||||
if hasattr(quoted_tweet, "quoted_status"):
|
if quoted_tweet.is_quote_status == True and hasattr(quoted_tweet, "quoted_status"):
|
||||||
original_tweet = quoted_tweet.quoted_status
|
original_tweet = quoted_tweet.quoted_status
|
||||||
elif hasattr(quoted_tweet, "retweeted_status") and hasattr(quoted_tweet.retweeted_status, "quoted_status"):
|
elif hasattr(quoted_tweet, "retweeted_status") and quoted_tweet.retweeted_status.is_quote_status == True and hasattr(quoted_tweet.retweeted_status, "quoted_status"):
|
||||||
original_tweet = quoted_tweet.retweeted_status.quoted_status
|
original_tweet = quoted_tweet.retweeted_status.quoted_status
|
||||||
else:
|
else:
|
||||||
return quoted_tweet
|
return quoted_tweet
|
||||||
@@ -388,7 +388,7 @@ class Session(base.baseSession):
|
|||||||
tweet.quoted_status.twishort = True
|
tweet.quoted_status.twishort = True
|
||||||
for i in tweet.quoted_status.entities["user_mentions"]:
|
for i in tweet.quoted_status.entities["user_mentions"]:
|
||||||
if "@%s" % (i["screen_name"]) not in tweet.quoted_status.message and i["screen_name"] != tweet.user.screen_name:
|
if "@%s" % (i["screen_name"]) not in tweet.quoted_status.message and i["screen_name"] != tweet.user.screen_name:
|
||||||
if hasattr(tweet["quoted_status"], "retweeted_status") and tweet.retweeted_status.user.screen_name == i["screen_name"]:
|
if hasattr(tweet.quoted_status, "retweeted_status") and tweet.retweeted_status.user.screen_name == i["screen_name"]:
|
||||||
continue
|
continue
|
||||||
tweet.quoted_status.message = u"@%s %s" % (i["screen_name"], tweet.message)
|
tweet.quoted_status.message = u"@%s %s" % (i["screen_name"], tweet.message)
|
||||||
else:
|
else:
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{"current_version": "3",
|
{"current_version": "5",
|
||||||
"description": "Snapshot version.",
|
"description": "Snapshot version.",
|
||||||
"date": "unknown",
|
"date": "unknown",
|
||||||
"downloads":
|
"downloads":
|
||||||
|
Reference in New Issue
Block a user