diff --git a/src/controller/buffers/twitter/base.py b/src/controller/buffers/twitter/base.py index 5b6519e3..5fa2e86b 100644 --- a/src/controller/buffers/twitter/base.py +++ b/src/controller/buffers/twitter/base.py @@ -471,11 +471,18 @@ class BaseBuffer(base.Buffer): def onFocus(self, *args, **kwargs): tweet = self.get_tweet() +<<<<<<< HEAD if self.session.settings["general"]["relative_times"] == True: # fix this: original_date = arrow.get(self.session.db[self.name][self.buffer.list.get_selected()].created_at, locale="en") ts = original_date.humanize(locale=languageHandler.getLanguage()) self.buffer.list.list.SetItem(self.buffer.list.get_selected(), 2, ts) +======= + # fix this: + original_date = arrow.get(self.session.db[self.name][self.buffer.list.get_selected()].created_at, locale="en") + ts = original_date.humanize(locale=languageHandler.getLanguage()) + self.buffer.list.list.SetItem(self.buffer.list.get_selected(), 2, ts) +>>>>>>> next-gen if self.session.settings['sound']['indicate_audio'] and utils.is_audio(tweet): self.session.sound.play("audio.ogg") if self.session.settings['sound']['indicate_geo'] and utils.is_geocoded(tweet): diff --git a/src/controller/buffers/twitter/trends.py b/src/controller/buffers/twitter/trends.py index f562fb28..2c1879b2 100644 --- a/src/controller/buffers/twitter/trends.py +++ b/src/controller/buffers/twitter/trends.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- import time -import platform import wx +from wxUI import buffers, commonMessageDialogs, menus +from controller import user, messages +from controller import messages import widgetUtils import output import logging diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 0811093e..56994fac 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -230,7 +230,7 @@ class Controller(object): self.set_systray_icon() def check_invisible_at_startup(self): - # Visibility check. It does only work for windows. + # Visibility check. if config.app["app-settings"]["hide_gui"] == True: self.show_hide() self.view.Show() diff --git a/src/extra/SoundsTutorial/__init__.py b/src/extra/SoundsTutorial/__init__.py index 622e037d..233a583a 100644 --- a/src/extra/SoundsTutorial/__init__.py +++ b/src/extra/SoundsTutorial/__init__.py @@ -1,3 +1 @@ -from __future__ import absolute_import -from __future__ import unicode_literals from .soundsTutorial import soundsTutorial diff --git a/src/extra/SoundsTutorial/gtk_ui.py b/src/extra/SoundsTutorial/gtk_ui.py deleted file mode 100644 index a5ffab02..00000000 --- a/src/extra/SoundsTutorial/gtk_ui.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals -from gi.repository import Gtk -import widgetUtils - -class soundsTutorialDialog(Gtk.Dialog): - def __init__(self, actions): - super(soundsTutorialDialog, self).__init__("Sounds tutorial", None, 0, (Gtk.STOCK_CANCEL, widgetUtils.CANCEL)) - box = self.get_content_area() - label = Gtk.Label("Press enter for listen the sound") - self.list = widgetUtils.list("Action") - self.populate_actions(actions) - lBox = Gtk.Box(spacing=6) - lBox.add(label) - lBox.add(self.list.list) - box.add(lBox) - self.play = Gtk.Button("Play") - box.add(self.play) - self.show_all() - - def populate_actions(self, actions): - for i in actions: - self.list.insert_item(i) - - def get_selected(self): - return self.list.get_selected() diff --git a/src/extra/SoundsTutorial/reverse_sort.py b/src/extra/SoundsTutorial/reverse_sort.py index 27711174..c6269a8d 100644 --- a/src/extra/SoundsTutorial/reverse_sort.py +++ b/src/extra/SoundsTutorial/reverse_sort.py @@ -1,4 +1,3 @@ -from __future__ import unicode_literals #Reverse sort, by Bill Dengler for use in TWBlue http://twblue.es def invert_tuples(t): "Invert a list of tuples, so that the 0th element becomes the -1th, and the -1th becomes the 0th." diff --git a/src/extra/SoundsTutorial/soundsTutorial.py b/src/extra/SoundsTutorial/soundsTutorial.py index 4e679b1c..097655c0 100644 --- a/src/extra/SoundsTutorial/soundsTutorial.py +++ b/src/extra/SoundsTutorial/soundsTutorial.py @@ -1,7 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import unicode_literals -from builtins import object import platform import widgetUtils import os @@ -9,10 +6,7 @@ import paths import logging log = logging.getLogger("extra.SoundsTutorial.soundsTutorial") from . import soundsTutorial_constants -if platform.system() == "Windows": - from . import wx_ui as UI -elif platform.system() == "Linux": - from . import gtk_ui as UI +from . import wx_ui as UI class soundsTutorial(object): def __init__(self, sessionObject): diff --git a/src/extra/SoundsTutorial/soundsTutorial_constants.py b/src/extra/SoundsTutorial/soundsTutorial_constants.py index 536add4d..ca01b3e5 100644 --- a/src/extra/SoundsTutorial/soundsTutorial_constants.py +++ b/src/extra/SoundsTutorial/soundsTutorial_constants.py @@ -1,7 +1,4 @@ #-*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import unicode_literals -#-*- coding: utf-8 -*- from . import reverse_sort import application actions = reverse_sort.reverse_sort([ ("audio", _(u"Audio tweet.")), diff --git a/src/extra/SoundsTutorial/wx_ui.py b/src/extra/SoundsTutorial/wx_ui.py index ebb6caf9..cb11a025 100644 --- a/src/extra/SoundsTutorial/wx_ui.py +++ b/src/extra/SoundsTutorial/wx_ui.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals import wx import widgetUtils diff --git a/src/extra/SpellChecker/spellchecker.py b/src/extra/SpellChecker/spellchecker.py index 29bf2512..791730cf 100644 --- a/src/extra/SpellChecker/spellchecker.py +++ b/src/extra/SpellChecker/spellchecker.py @@ -1,8 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import unicode_literals -from builtins import next -from builtins import object import os import logging from . import wx_ui diff --git a/src/extra/SpellChecker/twitterFilter.py b/src/extra/SpellChecker/twitterFilter.py index 98e53aee..f5e308c3 100644 --- a/src/extra/SpellChecker/twitterFilter.py +++ b/src/extra/SpellChecker/twitterFilter.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals import re from enchant.tokenize import Filter diff --git a/src/extra/SpellChecker/wx_ui.py b/src/extra/SpellChecker/wx_ui.py index 9c7159fd..a401e3af 100644 --- a/src/extra/SpellChecker/wx_ui.py +++ b/src/extra/SpellChecker/wx_ui.py @@ -16,7 +16,6 @@ # along with this program. If not, see . # ############################################################ -from __future__ import unicode_literals import wx import application diff --git a/src/extra/translator/__init__.py b/src/extra/translator/__init__.py index 07b41a1e..d302ff8f 100644 --- a/src/extra/translator/__init__.py +++ b/src/extra/translator/__init__.py @@ -2,7 +2,4 @@ from __future__ import absolute_import from __future__ import unicode_literals from . import translator -import platform -if platform.system() == "Windows": - from . import wx_ui as gui - +from . import wx_ui as gui \ No newline at end of file diff --git a/src/locales/ja/LC_MESSAGES/twblue.mo b/src/locales/ja/LC_MESSAGES/twblue.mo index f3ce7b73..766bb914 100644 Binary files a/src/locales/ja/LC_MESSAGES/twblue.mo and b/src/locales/ja/LC_MESSAGES/twblue.mo differ diff --git a/src/locales/ja/LC_MESSAGES/twblue.po b/src/locales/ja/LC_MESSAGES/twblue.po index 4dddd71a..a7c0a150 100644 --- a/src/locales/ja/LC_MESSAGES/twblue.po +++ b/src/locales/ja/LC_MESSAGES/twblue.po @@ -1,23 +1,22 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) 2022 ORGANIZATION # FIRST AUTHOR , 2022. -# Riku , 2022. +# msgid "" msgstr "" "Project-Id-Version: \n" -"Report-Msgid-Bugs-To: manuel@manuelcortez.net\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2022-08-16 17:50-0500\n" -"PO-Revision-Date: 2022-09-09 06:02+0000\n" -"Last-Translator: Riku \n" -"Language-Team: Japanese \n" -"Language: ja\n" +"PO-Revision-Date: 2022-08-20 07:18+0900\n" +"Last-Translator: 陸 \n" +"Language-Team: \n" +"Language: ja_JP\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.13.1\n" "Generated-By: Babel 2.10.3\n" +"X-Generator: Poedit 3.1.1\n" #: languageHandler.py:61 msgctxt "languageName" diff --git a/src/sessionmanager/__init__.py b/src/sessionmanager/__init__.py index 000da2cf..f59d8d26 100644 --- a/src/sessionmanager/__init__.py +++ b/src/sessionmanager/__init__.py @@ -7,4 +7,3 @@ Contents of this package: manager: Handles multiple sessions, setting the configuration files and check if the session is valid. Part of the model. session: Creates a twitter session for an user. The other part of the model. """ -from __future__ import unicode_literals diff --git a/src/sessionmanager/gtkUI.py b/src/sessionmanager/gtkUI.py deleted file mode 100644 index a6f8a4f0..00000000 --- a/src/sessionmanager/gtkUI.py +++ /dev/null @@ -1,57 +0,0 @@ -from __future__ import unicode_literals -from gi.repository import Gtk -import widgetUtils - -class sessionManagerWindow(widgetUtils.baseDialog): - def __init__(self): - super(sessionManagerWindow, self).__init__("Session Manager", None, 0, (Gtk.STOCK_OK, widgetUtils.OK, Gtk.STOCK_CANCEL, widgetUtils.CANCEL)) - self.list = widgetUtils.list("Session") - self.box.add(self.list.list) - btnBox = Gtk.Box(spacing=6) - self.new = Gtk.Button("New account") - self.remove = Gtk.Button("Remove account") - self.configuration = Gtk.Button("Configuration") - btnBox.add(self.new) - btnBox.add(self.remove) - btnBox.add(self.configuration) - self.box.add(btnBox) - self.show_all() - - def fill_list(self, sessionsList): - for i in sessionsList: - self.list.insert_item(False, i) - if self.list.get_count() > 0: - self.list.select_item(0) - - def new_account_dialog(self): - dialog = Gtk.MessageDialog(self, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, "Authorization") - dialog.format_secondary_text("The request to authorize your Twitter account will be opened in your browser. You only need to do this once. Would you like to continue?") - answer = dialog.run() - dialog.destroy() - return answer - - def add_new_session_to_list(self): - total = self.list.get_count() - name = "Authorized account %d" % (total+1) - self.list.insert_item(name) - if self.list.get_count() == 1: - self.list.select_item(0) - - def show_unauthorised_error(self): - dialog = Gtk.MessageDialog(self, 0, Gtk.MessageType.ERROR, Gtk.ButtonsType.CANCEL, "Invalid user token") - dialog.format_secondary_text("Your access token is invalid or the authorization has failed. Please try again.") - answer = dialog.run() - return answer - - def remove_account_dialog(self): - dialog = Gtk.MessageDialog(self, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, "Remove account") - dialog.format_secondary_text("Do you really want delete this account?") - answer = dialog.run() - return answer - - def get_selected(self): - return self.list.get_selected() - - def remove_session(self, sessionID): - self.list.remove_item(sessionID) - diff --git a/src/sessionmanager/sessionManager.py b/src/sessionmanager/sessionManager.py index 711f032f..6183b2f6 100644 --- a/src/sessionmanager/sessionManager.py +++ b/src/sessionmanager/sessionManager.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """ Module to perform session actions such as addition, removal or display of the global settings dialogue. """ -import shutil import time import os import logging diff --git a/src/sessions/twitter/compose.py b/src/sessions/twitter/compose.py index 539b4df7..0e5ad12f 100644 --- a/src/sessions/twitter/compose.py +++ b/src/sessions/twitter/compose.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -import platform -system = platform.system() from . import utils import re import time @@ -17,14 +15,11 @@ chars = "abcdefghijklmnopqrstuvwxyz" def compose_tweet(tweet, db, relative_times, show_screen_names=False, session=None): """ It receives a tweet and returns a list with the user, text for the tweet or message, date and the client where user is.""" - if system == "Windows": - original_date = arrow.get(tweet.created_at, locale="en") - if relative_times == True: - ts = original_date.humanize(locale=languageHandler.curLang[:2]) - else: - ts = original_date.shift(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.curLang[:2]) + original_date = arrow.get(tweet.created_at, locale="en") + if relative_times == True: + ts = original_date.humanize(locale=languageHandler.curLang[:2]) else: - ts = tweet.created_at + ts = original_date.shift(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.curLang[:2]) if hasattr(tweet, "message"): value = "message" elif hasattr(tweet, "full_text"): @@ -58,16 +53,13 @@ def compose_tweet(tweet, db, relative_times, show_screen_names=False, session=No return [user+", ", text, ts+", ", source] def compose_direct_message(item, db, relative_times, show_screen_names=False, session=None): - if system == "Windows": - # Let's remove the last 3 digits in the timestamp string. - # Twitter sends their "epoch" timestamp with 3 digits for milliseconds and arrow doesn't like it. - original_date = arrow.get(int(item.created_timestamp)) - if relative_times == True: - ts = original_date.humanize(locale=languageHandler.curLang[:2]) - else: - ts = original_date.shift(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.curLang[:2]) + # Let's remove the last 3 digits in the timestamp string. + # Twitter sends their "epoch" timestamp with 3 digits for milliseconds and arrow doesn't like it. + original_date = arrow.get(int(item.created_timestamp)) + if relative_times == True: + ts = original_date.humanize(locale=languageHandler.curLang[:2]) else: - ts = item.created_timestamp + ts = original_date.shift(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.curLang[:2]) text = StripChars(item.message_create["message_data"]["text"]) source = "DM" sender = session.get_user(item.message_create["sender_id"]) @@ -125,23 +117,17 @@ def compose_quoted_tweet(quoted_tweet, original_tweet, show_screen_names=False, return quoted_tweet def compose_followers_list(tweet, db, relative_times=True, show_screen_names=False, session=None): - if system == "Windows": - original_date = arrow.get(tweet.created_at, locale="en") - if relative_times == True: - ts = original_date.humanize(locale=languageHandler.curLang[:2]) - else: - ts = original_date.shift(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.curLang[:2]) + original_date = arrow.get(tweet.created_at, locale="en") + if relative_times == True: + ts = original_date.humanize(locale=languageHandler.curLang[:2]) else: - ts = tweet.created_at + ts = original_date.shift(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.curLang[:2]) if hasattr(tweet, "status"): - if system == "Windows": - original_date2 = arrow.get(tweet.status.created_at, locale="en") - if relative_times: - ts2 = original_date2.humanize(locale=languageHandler.curLang[:2]) - else: - ts2 = original_date2.shift(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.curLang[:2]) + original_date2 = arrow.get(tweet.status.created_at, locale="en") + if relative_times: + ts2 = original_date2.humanize(locale=languageHandler.curLang[:2]) else: - ts2 = _("Unavailable") + ts2 = original_date2.shift(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.curLang[:2]) else: ts2 = _("Unavailable") return [_(u"%s (@%s). %s followers, %s friends, %s tweets. Last tweeted %s. Joined Twitter %s") % (tweet.name, tweet.screen_name, tweet.followers_count, tweet.friends_count, tweet.statuses_count, ts2, ts)] diff --git a/src/sessions/twitter/long_tweets/__init__.py b/src/sessions/twitter/long_tweets/__init__.py index 007ad61c..84185940 100644 --- a/src/sessions/twitter/long_tweets/__init__.py +++ b/src/sessions/twitter/long_tweets/__init__.py @@ -1,3 +1,2 @@ # -*- coding: utf-8 -*- """ this package holds different modules to extract information regarding long tweets. A long tweet contains more than one tweet (such a quoted tweet), or is made via services like twishort.""" -from __future__ import unicode_literals diff --git a/src/update/__init__.py b/src/update/__init__.py index 443025e3..e69de29b 100644 --- a/src/update/__init__.py +++ b/src/update/__init__.py @@ -1,13 +0,0 @@ -from __future__ import unicode_literals -import glob -import os.path -import platform - -def find_datafiles(): - system = platform.system() - if system == 'Windows': - file_ext = '*.exe' - else: - file_ext = '*.sh' - path = os.path.abspath(os.path.join(__path__[0], 'bootstrappers', file_ext)) - return [('', glob.glob(path))] diff --git a/src/update/updater.py b/src/update/updater.py index 5214c1de..4e1b4046 100644 --- a/src/update/updater.py +++ b/src/update/updater.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import application from . import update -import platform import logging import output from requests.exceptions import ConnectionError