mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-03-14 09:28:03 -06:00
Automated py3 refactoring.
This commit is contained in:
parent
d2d7e1c077
commit
99ff261d8e
@ -10,10 +10,10 @@ else:
|
|||||||
version = "10.99"
|
version = "10.99"
|
||||||
update_url = 'http://twblue.es/updates/snapshots_ngen.json'
|
update_url = 'http://twblue.es/updates/snapshots_ngen.json'
|
||||||
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 = [u"Manuel Cortéz", u"José Manuel Delicado"]
|
authors = ["Manuel Cortéz", "José Manuel Delicado"]
|
||||||
authorEmail = "manuel@manuelcortez.net"
|
authorEmail = "manuel@manuelcortez.net"
|
||||||
copyright = u"Copyright (C) 2013-2017, Manuel cortéz."
|
copyright = "Copyright (C) 2013-2017, Manuel cortéz."
|
||||||
description = str(name+" is an app designed to use Twitter simply and efficiently while using minimal system resources. This app provides access to most Twitter features.")
|
description = str(name+" is an app designed to use Twitter simply and efficiently while using minimal system resources. This app provides access to most Twitter features.")
|
||||||
translators = [u"Manuel Cortéz (English)", u"Mohammed Al Shara, Hatoun Felemban (Arabic)", u"Francisco Torres (Catalan)", u"Manuel cortéz (Spanish)", u"Sukil Etxenike Arizaleta (Basque)", u"Jani Kinnunen (finnish)", u"Rémy Ruiz (French)", u"Juan Buño (Galician)", u"Steffen Schultz (German)", u"Zvonimir Stanečić (Croatian)", u"Robert Osztolykan (Hungarian)", u"Christian Leo Mameli (Italian)", u"Riku (Japanese)", u"Paweł Masarczyk (Polish)", u"Odenilton Júnior Santos (Portuguese)", u"Florian Ionașcu, Nicușor Untilă (Romanian)", u"Natalia Hedlund, Valeria Kuznetsova (Russian)", u"Aleksandar Đurić (Serbian)", u"Burak Yüksek (Turkish)"]
|
translators = ["Manuel Cortéz (English)", "Mohammed Al Shara, Hatoun Felemban (Arabic)", "Francisco Torres (Catalan)", "Manuel cortéz (Spanish)", "Sukil Etxenike Arizaleta (Basque)", "Jani Kinnunen (finnish)", "Rémy Ruiz (French)", "Juan Buño (Galician)", "Steffen Schultz (German)", "Zvonimir Stanečić (Croatian)", "Robert Osztolykan (Hungarian)", "Christian Leo Mameli (Italian)", "Riku (Japanese)", "Paweł Masarczyk (Polish)", "Odenilton Júnior Santos (Portuguese)", "Florian Ionașcu, Nicușor Untilă (Romanian)", "Natalia Hedlund, Valeria Kuznetsova (Russian)", "Aleksandar Đurić (Serbian)", "Burak Yüksek (Turkish)"]
|
||||||
url = u"http://twblue.es"
|
url = "http://twblue.es"
|
||||||
report_bugs_url = "http://twblue.es/bugs/api/soap/mantisconnect.php?wsdl"
|
report_bugs_url = "http://twblue.es/bugs/api/soap/mantisconnect.php?wsdl"
|
@ -8,7 +8,7 @@ log = logging.getLogger("config")
|
|||||||
|
|
||||||
MAINFILE = "twblue.conf"
|
MAINFILE = "twblue.conf"
|
||||||
MAINSPEC = "app-configuration.defaults"
|
MAINSPEC = "app-configuration.defaults"
|
||||||
proxyTypes=[u"http", u"https", u"socks4", u"socks5"]
|
proxyTypes=["http", "https", "socks4", "socks5"]
|
||||||
app = None
|
app = None
|
||||||
keymap=None
|
keymap=None
|
||||||
changed_keymap = False
|
changed_keymap = False
|
||||||
|
@ -21,7 +21,7 @@ class attach(object):
|
|||||||
imageInfo = {"type": "photo", "file": image, "description": description}
|
imageInfo = {"type": "photo", "file": image, "description": description}
|
||||||
log.debug("Image data to upload: %r" % (imageInfo,))
|
log.debug("Image data to upload: %r" % (imageInfo,))
|
||||||
self.attachments.append(imageInfo)
|
self.attachments.append(imageInfo)
|
||||||
info = [_(u"Photo"), description]
|
info = [_("Photo"), description]
|
||||||
self.dialog.attachments.insert_item(False, *info)
|
self.dialog.attachments.insert_item(False, *info)
|
||||||
self.dialog.remove.Enable(True)
|
self.dialog.remove.Enable(True)
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from builtins import range
|
from builtins import range
|
||||||
from builtins import object
|
from builtins import object
|
||||||
@ -93,11 +93,11 @@ class bufferController(object):
|
|||||||
|
|
||||||
def start_stream(self, mandatory=False):
|
def start_stream(self, mandatory=False):
|
||||||
if mandatory == True:
|
if mandatory == True:
|
||||||
output.speak(_(u"Unable to update this buffer."))
|
output.speak(_("Unable to update this buffer."))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def get_more_items(self):
|
def get_more_items(self):
|
||||||
output.speak(_(u"This action is not supported for this buffer"), True)
|
output.speak(_("This action is not supported for this buffer"), True)
|
||||||
|
|
||||||
def put_items_on_list(self, items):
|
def put_items_on_list(self, items):
|
||||||
pass
|
pass
|
||||||
@ -138,8 +138,8 @@ class bufferController(object):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def post_tweet(self, *args, **kwargs):
|
def post_tweet(self, *args, **kwargs):
|
||||||
title = _(u"Tweet")
|
title = _("Tweet")
|
||||||
caption = _(u"Write the tweet here")
|
caption = _("Write the tweet here")
|
||||||
tweet = messages.tweet(self.session, title, caption, "", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"])
|
tweet = messages.tweet(self.session, title, caption, "", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"])
|
||||||
if tweet.message.get_response() == widgetUtils.OK:
|
if tweet.message.get_response() == widgetUtils.OK:
|
||||||
self.session.settings["mysc"]["twishort_enabled"] = tweet.message.long_tweet.GetValue()
|
self.session.settings["mysc"]["twishort_enabled"] = tweet.message.long_tweet.GetValue()
|
||||||
@ -355,7 +355,7 @@ class baseBufferController(bufferController):
|
|||||||
# self.buffer.list.select_item(selection+elements)
|
# self.buffer.list.select_item(selection+elements)
|
||||||
# else:
|
# else:
|
||||||
self.buffer.list.select_item(selection)
|
self.buffer.list.select_item(selection)
|
||||||
output.speak(_(u"%s items retrieved") % (str(len(elements))), True)
|
output.speak(_("%s items retrieved") % (str(len(elements))), True)
|
||||||
|
|
||||||
def remove_buffer(self, force=False):
|
def remove_buffer(self, force=False):
|
||||||
if "-timeline" in self.name:
|
if "-timeline" in self.name:
|
||||||
@ -387,11 +387,11 @@ class baseBufferController(bufferController):
|
|||||||
elif dlg == widgetUtils.NO:
|
elif dlg == widgetUtils.NO:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
output.speak(_(u"This buffer is not a timeline; it can't be deleted."), True)
|
output.speak(_("This buffer is not a timeline; it can't be deleted."), True)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def remove_tweet(self, id):
|
def remove_tweet(self, id):
|
||||||
if type(self.session.db[self.name]) == dict: return
|
if isinstance(self.session.db[self.name], dict): return
|
||||||
for i in range(0, len(self.session.db[self.name])):
|
for i in range(0, len(self.session.db[self.name])):
|
||||||
if self.session.db[self.name][i]["id"] == id:
|
if self.session.db[self.name][i]["id"] == id:
|
||||||
self.session.db[self.name].pop(i)
|
self.session.db[self.name].pop(i)
|
||||||
@ -516,7 +516,7 @@ class baseBufferController(bufferController):
|
|||||||
twishort_enabled = "twishort" in tweet
|
twishort_enabled = "twishort" in tweet
|
||||||
users = utils.get_all_mentioned(tweet, self.session.db, field="screen_name")
|
users = utils.get_all_mentioned(tweet, self.session.db, field="screen_name")
|
||||||
ids = utils.get_all_mentioned(tweet, self.session.db, field="id_str")
|
ids = utils.get_all_mentioned(tweet, self.session.db, field="id_str")
|
||||||
message = messages.reply(self.session, _(u"Reply"), _(u"Reply to %s") % (screen_name,), "", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"], users=users, ids=ids)
|
message = messages.reply(self.session, _("Reply"), _("Reply to %s") % (screen_name,), "", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"], users=users, ids=ids)
|
||||||
if message.message.get_response() == widgetUtils.OK:
|
if message.message.get_response() == widgetUtils.OK:
|
||||||
params = {"_sound": "reply_send.ogg", "in_reply_to_status_id": id,}
|
params = {"_sound": "reply_send.ogg", "in_reply_to_status_id": id,}
|
||||||
self.session.settings["mysc"]["twishort_enabled"] = message.message.long_tweet.GetValue()
|
self.session.settings["mysc"]["twishort_enabled"] = message.message.long_tweet.GetValue()
|
||||||
@ -529,7 +529,7 @@ class baseBufferController(bufferController):
|
|||||||
params["auto_populate_reply_metadata"] =True
|
params["auto_populate_reply_metadata"] =True
|
||||||
else:
|
else:
|
||||||
mentioned_people = message.get_people()
|
mentioned_people = message.get_people()
|
||||||
text = "@"+screen_name+" "+mentioned_people+u" "+text
|
text = "@"+screen_name+" "+mentioned_people+" "+text
|
||||||
if len(text) > 140 and message.message.get("long_tweet") == True:
|
if len(text) > 140 and message.message.get("long_tweet") == True:
|
||||||
if message.image == None:
|
if message.image == None:
|
||||||
text = twishort.create_tweet(self.session.settings["twitter"]["user_key"], self.session.settings["twitter"]["user_secret"], text)
|
text = twishort.create_tweet(self.session.settings["twitter"]["user_key"], self.session.settings["twitter"]["user_secret"], text)
|
||||||
@ -557,7 +557,7 @@ class baseBufferController(bufferController):
|
|||||||
else:
|
else:
|
||||||
screen_name = tweet["user"]["screen_name"]
|
screen_name = tweet["user"]["screen_name"]
|
||||||
users = utils.get_all_users(tweet, self.session.db)
|
users = utils.get_all_users(tweet, self.session.db)
|
||||||
dm = messages.dm(self.session, _(u"Direct message to %s") % (screen_name,), _(u"New direct message"), users)
|
dm = messages.dm(self.session, _("Direct message to %s") % (screen_name,), _("New direct message"), users)
|
||||||
if dm.message.get_response() == widgetUtils.OK:
|
if dm.message.get_response() == widgetUtils.OK:
|
||||||
val = self.session.api_call(call_name="send_direct_message", text=dm.message.get_text(), screen_name=dm.message.get("cb"))
|
val = self.session.api_call(call_name="send_direct_message", text=dm.message.get_text(), screen_name=dm.message.get("cb"))
|
||||||
if val != None:
|
if val != None:
|
||||||
@ -588,7 +588,7 @@ class baseBufferController(bufferController):
|
|||||||
comments = tweet["full_text"]
|
comments = tweet["full_text"]
|
||||||
else:
|
else:
|
||||||
comments = tweet["text"]
|
comments = tweet["text"]
|
||||||
retweet = messages.tweet(self.session, _(u"Quote"), _(u"Add your comment to the tweet"), u"“@%s: %s ”" % (tweet["user"]["screen_name"], comments), max=116, messageType="retweet", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"])
|
retweet = messages.tweet(self.session, _("Quote"), _("Add your comment to the tweet"), "“@%s: %s ”" % (tweet["user"]["screen_name"], comments), max=116, messageType="retweet", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"])
|
||||||
if comment != '':
|
if comment != '':
|
||||||
retweet.message.set_text(comment)
|
retweet.message.set_text(comment)
|
||||||
if retweet.message.get_response() == widgetUtils.OK:
|
if retweet.message.get_response() == widgetUtils.OK:
|
||||||
@ -653,7 +653,7 @@ class baseBufferController(bufferController):
|
|||||||
if hasattr(urls_list, "destroy"): urls_list.destroy()
|
if hasattr(urls_list, "destroy"): urls_list.destroy()
|
||||||
if url != '':
|
if url != '':
|
||||||
if announce:
|
if announce:
|
||||||
output.speak(_(u"Opening URL..."), True)
|
output.speak(_("Opening URL..."), True)
|
||||||
webbrowser.open_new_tab(url)
|
webbrowser.open_new_tab(url)
|
||||||
|
|
||||||
def clear_list(self):
|
def clear_list(self):
|
||||||
@ -688,7 +688,7 @@ class baseBufferController(bufferController):
|
|||||||
users = [tweet["screen_name"]]
|
users = [tweet["screen_name"]]
|
||||||
else:
|
else:
|
||||||
users = utils.get_all_users(tweet, self.session.db)
|
users = utils.get_all_users(tweet, self.session.db)
|
||||||
dlg = dialogs.utils.selectUserDialog(title=_(u"User details"), users=users)
|
dlg = dialogs.utils.selectUserDialog(title=_("User details"), users=users)
|
||||||
if dlg.get_response() == widgetUtils.OK:
|
if dlg.get_response() == widgetUtils.OK:
|
||||||
user.profileController(session=self.session, user=dlg.get_user())
|
user.profileController(session=self.session, user=dlg.get_user())
|
||||||
if hasattr(dlg, "destroy"): dlg.destroy()
|
if hasattr(dlg, "destroy"): dlg.destroy()
|
||||||
@ -763,7 +763,7 @@ class eventsBufferController(bufferController):
|
|||||||
self.get_formatted_message = self.get_message
|
self.get_formatted_message = self.get_message
|
||||||
|
|
||||||
def get_message(self):
|
def get_message(self):
|
||||||
if self.buffer.list.get_count() == 0: return _(u"Empty")
|
if self.buffer.list.get_count() == 0: return _("Empty")
|
||||||
# fix this:
|
# fix this:
|
||||||
return "%s. %s" % (self.buffer.list.list.GetItemText(self.buffer.list.get_selected()), self.buffer.list.list.GetItemText(self.buffer.list.get_selected(), 1))
|
return "%s. %s" % (self.buffer.list.list.GetItemText(self.buffer.list.get_selected()), self.buffer.list.list.GetItemText(self.buffer.list.get_selected(), 1))
|
||||||
|
|
||||||
@ -849,7 +849,7 @@ class peopleBufferController(baseBufferController):
|
|||||||
elif dlg == widgetUtils.NO:
|
elif dlg == widgetUtils.NO:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
output.speak(_(u"This buffer is not a timeline; it can't be deleted."), True)
|
output.speak(_("This buffer is not a timeline; it can't be deleted."), True)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def onFocus(self, ev):
|
def onFocus(self, ev):
|
||||||
@ -864,7 +864,7 @@ class peopleBufferController(baseBufferController):
|
|||||||
def reply(self, *args, **kwargs):
|
def reply(self, *args, **kwargs):
|
||||||
tweet = self.get_right_tweet()
|
tweet = self.get_right_tweet()
|
||||||
screen_name = tweet["screen_name"]
|
screen_name = tweet["screen_name"]
|
||||||
message = messages.reply(self.session, _(u"Mention"), _(u"Mention to %s") % (screen_name,), "@%s " % (screen_name,), [screen_name,])
|
message = messages.reply(self.session, _("Mention"), _("Mention to %s") % (screen_name,), "@%s " % (screen_name,), [screen_name,])
|
||||||
if message.message.get_response() == widgetUtils.OK:
|
if message.message.get_response() == widgetUtils.OK:
|
||||||
if message.image == None:
|
if message.image == None:
|
||||||
call_threaded(self.session.api_call, call_name="update_status", _sound="reply_send.ogg", status=message.message.get_text())
|
call_threaded(self.session.api_call, call_name="update_status", _sound="reply_send.ogg", status=message.message.get_text())
|
||||||
@ -911,7 +911,7 @@ class peopleBufferController(baseBufferController):
|
|||||||
# self.buffer.list.select_item(selection)
|
# self.buffer.list.select_item(selection)
|
||||||
# else:
|
# else:
|
||||||
# self.buffer.list.select_item(selection-elements)
|
# self.buffer.list.select_item(selection-elements)
|
||||||
output.speak(_(u"%s items retrieved") % (len(items)), True)
|
output.speak(_("%s items retrieved") % (len(items)), True)
|
||||||
|
|
||||||
def put_items_on_list(self, number_of_items):
|
def put_items_on_list(self, number_of_items):
|
||||||
log.debug("The list contains %d items" % (self.buffer.list.get_count(),))
|
log.debug("The list contains %d items" % (self.buffer.list.get_count(),))
|
||||||
@ -1037,7 +1037,7 @@ class searchBufferController(baseBufferController):
|
|||||||
# self.buffer.list.select_item(selection+elements)
|
# self.buffer.list.select_item(selection+elements)
|
||||||
# else:
|
# else:
|
||||||
self.buffer.list.select_item(selection)
|
self.buffer.list.select_item(selection)
|
||||||
output.speak(_(u"%s items retrieved") % (str(len(elements))), True)
|
output.speak(_("%s items retrieved") % (str(len(elements))), True)
|
||||||
|
|
||||||
class searchPeopleBufferController(peopleBufferController):
|
class searchPeopleBufferController(peopleBufferController):
|
||||||
|
|
||||||
@ -1097,7 +1097,7 @@ class searchPeopleBufferController(peopleBufferController):
|
|||||||
# self.buffer.list.select_item(selection)
|
# self.buffer.list.select_item(selection)
|
||||||
# else:
|
# else:
|
||||||
# self.buffer.list.select_item(selection-elements)
|
# self.buffer.list.select_item(selection-elements)
|
||||||
output.speak(_(u"%s items retrieved") % (len(items)), True)
|
output.speak(_("%s items retrieved") % (len(items)), True)
|
||||||
|
|
||||||
|
|
||||||
def remove_buffer(self, force=False):
|
def remove_buffer(self, force=False):
|
||||||
@ -1213,8 +1213,8 @@ class trendsBufferController(bufferController):
|
|||||||
|
|
||||||
def tweet_about_this_trend(self, *args, **kwargs):
|
def tweet_about_this_trend(self, *args, **kwargs):
|
||||||
if self.buffer.list.get_count() == 0: return
|
if self.buffer.list.get_count() == 0: return
|
||||||
title = _(u"Tweet")
|
title = _("Tweet")
|
||||||
caption = _(u"Write the tweet here")
|
caption = _("Write the tweet here")
|
||||||
tweet = messages.tweet(self.session, title, caption, self.get_message()+ " ", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"])
|
tweet = messages.tweet(self.session, title, caption, self.get_message()+ " ", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"])
|
||||||
tweet.message.set_cursor_at_end()
|
tweet.message.set_cursor_at_end()
|
||||||
if tweet.message.get_response() == widgetUtils.OK:
|
if tweet.message.get_response() == widgetUtils.OK:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from builtins import range
|
from builtins import range
|
||||||
from builtins import object
|
from builtins import object
|
||||||
@ -269,7 +269,7 @@ class Controller(object):
|
|||||||
if config.app["app-settings"]["play_ready_sound"] == True:
|
if config.app["app-settings"]["play_ready_sound"] == True:
|
||||||
session_.sessions[list(session_.sessions.keys())[0]].sound.play("ready.ogg")
|
session_.sessions[list(session_.sessions.keys())[0]].sound.play("ready.ogg")
|
||||||
if config.app["app-settings"]["speak_ready_msg"] == True:
|
if config.app["app-settings"]["speak_ready_msg"] == True:
|
||||||
output.speak(_(u"Ready"))
|
output.speak(_("Ready"))
|
||||||
self.started = True
|
self.started = True
|
||||||
|
|
||||||
def create_ignored_session_buffer(self, session):
|
def create_ignored_session_buffer(self, session):
|
||||||
@ -302,97 +302,97 @@ class Controller(object):
|
|||||||
if i == 'home':
|
if i == 'home':
|
||||||
home = buffersController.baseBufferController(self.view.nb, "get_home_timeline", "home_timeline", session, session.db["user_name"], tweet_mode="extended")
|
home = buffersController.baseBufferController(self.view.nb, "get_home_timeline", "home_timeline", session, session.db["user_name"], tweet_mode="extended")
|
||||||
self.buffers.append(home)
|
self.buffers.append(home)
|
||||||
self.view.insert_buffer(home.buffer, name=_(u"Home"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(home.buffer, name=_("Home"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'mentions':
|
elif i == 'mentions':
|
||||||
mentions = buffersController.baseBufferController(self.view.nb, "get_mentions_timeline", "mentions", session, session.db["user_name"], sound="mention_received.ogg", tweet_mode="extended")
|
mentions = buffersController.baseBufferController(self.view.nb, "get_mentions_timeline", "mentions", session, session.db["user_name"], sound="mention_received.ogg", tweet_mode="extended")
|
||||||
self.buffers.append(mentions)
|
self.buffers.append(mentions)
|
||||||
self.view.insert_buffer(mentions.buffer, name=_(u"Mentions"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(mentions.buffer, name=_("Mentions"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'dm':
|
elif i == 'dm':
|
||||||
dm = buffersController.baseBufferController(self.view.nb, "get_direct_messages", "direct_messages", session, session.db["user_name"], bufferType="dmPanel", compose_func="compose_dm", sound="dm_received.ogg", full_text=True)
|
dm = buffersController.baseBufferController(self.view.nb, "get_direct_messages", "direct_messages", session, session.db["user_name"], bufferType="dmPanel", compose_func="compose_dm", sound="dm_received.ogg", full_text=True)
|
||||||
self.buffers.append(dm)
|
self.buffers.append(dm)
|
||||||
self.view.insert_buffer(dm.buffer, name=_(u"Direct messages"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(dm.buffer, name=_("Direct messages"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'sent_dm':
|
elif i == 'sent_dm':
|
||||||
sent_dm = buffersController.baseBufferController(self.view.nb, "get_sent_messages", "sent_direct_messages", session, session.db["user_name"], bufferType="dmPanel", compose_func="compose_dm", full_text=True)
|
sent_dm = buffersController.baseBufferController(self.view.nb, "get_sent_messages", "sent_direct_messages", session, session.db["user_name"], bufferType="dmPanel", compose_func="compose_dm", full_text=True)
|
||||||
self.buffers.append(sent_dm)
|
self.buffers.append(sent_dm)
|
||||||
self.view.insert_buffer(sent_dm.buffer, name=_(u"Sent direct messages"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(sent_dm.buffer, name=_("Sent direct messages"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'sent_tweets':
|
elif i == 'sent_tweets':
|
||||||
sent_tweets = buffersController.baseBufferController(self.view.nb, "get_user_timeline", "sent_tweets", session, session.db["user_name"], bufferType="dmPanel", screen_name=session.db["user_name"], tweet_mode="extended")
|
sent_tweets = buffersController.baseBufferController(self.view.nb, "get_user_timeline", "sent_tweets", session, session.db["user_name"], bufferType="dmPanel", screen_name=session.db["user_name"], tweet_mode="extended")
|
||||||
self.buffers.append(sent_tweets)
|
self.buffers.append(sent_tweets)
|
||||||
self.view.insert_buffer(sent_tweets.buffer, name=_(u"Sent tweets"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(sent_tweets.buffer, name=_("Sent tweets"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'favorites':
|
elif i == 'favorites':
|
||||||
favourites = buffersController.baseBufferController(self.view.nb, "get_favorites", "favourites", session, session.db["user_name"], tweet_mode="extended")
|
favourites = buffersController.baseBufferController(self.view.nb, "get_favorites", "favourites", session, session.db["user_name"], tweet_mode="extended")
|
||||||
self.buffers.append(favourites)
|
self.buffers.append(favourites)
|
||||||
|
|
||||||
self.view.insert_buffer(favourites.buffer, name=_(u"Likes"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(favourites.buffer, name=_("Likes"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'followers':
|
elif i == 'followers':
|
||||||
followers = buffersController.peopleBufferController(self.view.nb, "get_followers_list", "followers", session, session.db["user_name"], screen_name=session.db["user_name"])
|
followers = buffersController.peopleBufferController(self.view.nb, "get_followers_list", "followers", session, session.db["user_name"], screen_name=session.db["user_name"])
|
||||||
self.buffers.append(followers)
|
self.buffers.append(followers)
|
||||||
self.view.insert_buffer(followers.buffer, name=_(u"Followers"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(followers.buffer, name=_("Followers"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'friends':
|
elif i == 'friends':
|
||||||
friends = buffersController.peopleBufferController(self.view.nb, "get_friends_list", "friends", session, session.db["user_name"], screen_name=session.db["user_name"])
|
friends = buffersController.peopleBufferController(self.view.nb, "get_friends_list", "friends", session, session.db["user_name"], screen_name=session.db["user_name"])
|
||||||
self.buffers.append(friends)
|
self.buffers.append(friends)
|
||||||
self.view.insert_buffer(friends.buffer, name=_(u"Friends"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(friends.buffer, name=_("Friends"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'blocks':
|
elif i == 'blocks':
|
||||||
blocks = buffersController.peopleBufferController(self.view.nb, "list_blocks", "blocked", session, session.db["user_name"])
|
blocks = buffersController.peopleBufferController(self.view.nb, "list_blocks", "blocked", session, session.db["user_name"])
|
||||||
self.buffers.append(blocks)
|
self.buffers.append(blocks)
|
||||||
self.view.insert_buffer(blocks.buffer, name=_(u"Blocked users"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(blocks.buffer, name=_("Blocked users"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'muted':
|
elif i == 'muted':
|
||||||
muted = buffersController.peopleBufferController(self.view.nb, "list_mutes", "muted", session, session.db["user_name"])
|
muted = buffersController.peopleBufferController(self.view.nb, "list_mutes", "muted", session, session.db["user_name"])
|
||||||
self.buffers.append(muted)
|
self.buffers.append(muted)
|
||||||
self.view.insert_buffer(muted.buffer, name=_(u"Muted users"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(muted.buffer, name=_("Muted users"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'events':
|
elif i == 'events':
|
||||||
events = buffersController.eventsBufferController(self.view.nb, "events", session, session.db["user_name"], bufferType="dmPanel", screen_name=session.db["user_name"])
|
events = buffersController.eventsBufferController(self.view.nb, "events", session, session.db["user_name"], bufferType="dmPanel", screen_name=session.db["user_name"])
|
||||||
self.buffers.append(events)
|
self.buffers.append(events)
|
||||||
self.view.insert_buffer(events.buffer, name=_(u"Events"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(events.buffer, name=_("Events"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
timelines = buffersController.emptyPanel(self.view.nb, "timelines", session.db["user_name"])
|
timelines = buffersController.emptyPanel(self.view.nb, "timelines", session.db["user_name"])
|
||||||
self.buffers.append(timelines)
|
self.buffers.append(timelines)
|
||||||
self.view.insert_buffer(timelines.buffer , name=_(u"Timelines"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(timelines.buffer , name=_("Timelines"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
for i in session.settings["other_buffers"]["timelines"]:
|
for i in session.settings["other_buffers"]["timelines"]:
|
||||||
tl = buffersController.baseBufferController(self.view.nb, "get_user_timeline", "%s-timeline" % (i,), session, session.db["user_name"], bufferType=None, user_id=i, tweet_mode="extended")
|
tl = buffersController.baseBufferController(self.view.nb, "get_user_timeline", "%s-timeline" % (i,), session, session.db["user_name"], bufferType=None, user_id=i, tweet_mode="extended")
|
||||||
self.buffers.append(tl)
|
self.buffers.append(tl)
|
||||||
self.view.insert_buffer(tl.buffer, name=_(u"Timeline for {}").format(i,), pos=self.view.search("timelines", session.db["user_name"]))
|
self.view.insert_buffer(tl.buffer, name=_("Timeline for {}").format(i,), pos=self.view.search("timelines", session.db["user_name"]))
|
||||||
favs_timelines = buffersController.emptyPanel(self.view.nb, "favs_timelines", session.db["user_name"])
|
favs_timelines = buffersController.emptyPanel(self.view.nb, "favs_timelines", session.db["user_name"])
|
||||||
self.buffers.append(favs_timelines)
|
self.buffers.append(favs_timelines)
|
||||||
self.view.insert_buffer(favs_timelines.buffer , name=_(u"Likes timelines"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(favs_timelines.buffer , name=_("Likes timelines"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
for i in session.settings["other_buffers"]["favourites_timelines"]:
|
for i in session.settings["other_buffers"]["favourites_timelines"]:
|
||||||
tl = buffersController.baseBufferController(self.view.nb, "get_favorites", "%s-favorite" % (i,), session, session.db["user_name"], bufferType=None, user_id=i, tweet_mode="extended")
|
tl = buffersController.baseBufferController(self.view.nb, "get_favorites", "%s-favorite" % (i,), session, session.db["user_name"], bufferType=None, user_id=i, tweet_mode="extended")
|
||||||
self.buffers.append(tl)
|
self.buffers.append(tl)
|
||||||
self.view.insert_buffer(tl.buffer, name=_(u"Likes for {}").format(i,), pos=self.view.search("favs_timelines", session.db["user_name"]))
|
self.view.insert_buffer(tl.buffer, name=_("Likes for {}").format(i,), pos=self.view.search("favs_timelines", session.db["user_name"]))
|
||||||
tl.timer = RepeatingTimer(300, tl.start_stream)
|
tl.timer = RepeatingTimer(300, tl.start_stream)
|
||||||
tl.timer.start()
|
tl.timer.start()
|
||||||
followers_timelines = buffersController.emptyPanel(self.view.nb, "followers_timelines", session.db["user_name"])
|
followers_timelines = buffersController.emptyPanel(self.view.nb, "followers_timelines", session.db["user_name"])
|
||||||
self.buffers.append(followers_timelines)
|
self.buffers.append(followers_timelines)
|
||||||
self.view.insert_buffer(followers_timelines.buffer , name=_(u"Followers' Timelines"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(followers_timelines.buffer , name=_("Followers' Timelines"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
for i in session.settings["other_buffers"]["followers_timelines"]:
|
for i in session.settings["other_buffers"]["followers_timelines"]:
|
||||||
tl = buffersController.peopleBufferController(self.view.nb, "get_followers_list", "%s-followers" % (i,), session, session.db["user_name"], user_id=i)
|
tl = buffersController.peopleBufferController(self.view.nb, "get_followers_list", "%s-followers" % (i,), session, session.db["user_name"], user_id=i)
|
||||||
self.buffers.append(tl)
|
self.buffers.append(tl)
|
||||||
self.view.insert_buffer(tl.buffer, name=_(u"Followers for {}").format(i,), pos=self.view.search("followers_timelines", session.db["user_name"]))
|
self.view.insert_buffer(tl.buffer, name=_("Followers for {}").format(i,), pos=self.view.search("followers_timelines", session.db["user_name"]))
|
||||||
tl.timer = RepeatingTimer(300, tl.start_stream)
|
tl.timer = RepeatingTimer(300, tl.start_stream)
|
||||||
tl.timer.start()
|
tl.timer.start()
|
||||||
friends_timelines = buffersController.emptyPanel(self.view.nb, "friends_timelines", session.db["user_name"])
|
friends_timelines = buffersController.emptyPanel(self.view.nb, "friends_timelines", session.db["user_name"])
|
||||||
self.buffers.append(friends_timelines)
|
self.buffers.append(friends_timelines)
|
||||||
self.view.insert_buffer(friends_timelines.buffer , name=_(u"Friends' Timelines"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(friends_timelines.buffer , name=_("Friends' Timelines"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
for i in session.settings["other_buffers"]["friends_timelines"]:
|
for i in session.settings["other_buffers"]["friends_timelines"]:
|
||||||
tl = buffersController.peopleBufferController(self.view.nb, "get_friends_list", "%s-friends" % (i,), session, session.db["user_name"], user_id=i)
|
tl = buffersController.peopleBufferController(self.view.nb, "get_friends_list", "%s-friends" % (i,), session, session.db["user_name"], user_id=i)
|
||||||
self.buffers.append(tl)
|
self.buffers.append(tl)
|
||||||
self.view.insert_buffer(tl.buffer, name=_(u"Friends for {}").format(i,), pos=self.view.search("friends_timelines", session.db["user_name"]))
|
self.view.insert_buffer(tl.buffer, name=_("Friends for {}").format(i,), pos=self.view.search("friends_timelines", session.db["user_name"]))
|
||||||
tl.timer = RepeatingTimer(300, tl.start_stream)
|
tl.timer = RepeatingTimer(300, tl.start_stream)
|
||||||
tl.timer.start()
|
tl.timer.start()
|
||||||
lists = buffersController.emptyPanel(self.view.nb, "lists", session.db["user_name"])
|
lists = buffersController.emptyPanel(self.view.nb, "lists", session.db["user_name"])
|
||||||
self.buffers.append(lists)
|
self.buffers.append(lists)
|
||||||
self.view.insert_buffer(lists.buffer , name=_(u"Lists"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(lists.buffer , name=_("Lists"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
for i in session.settings["other_buffers"]["lists"]:
|
for i in session.settings["other_buffers"]["lists"]:
|
||||||
tl = buffersController.listBufferController(self.view.nb, "get_list_statuses", "%s-list" % (i,), session, session.db["user_name"], bufferType=None, list_id=utils.find_list(i, session.db["lists"]), tweet_mode="extended")
|
tl = buffersController.listBufferController(self.view.nb, "get_list_statuses", "%s-list" % (i,), session, session.db["user_name"], bufferType=None, list_id=utils.find_list(i, session.db["lists"]), tweet_mode="extended")
|
||||||
session.lists.append(tl)
|
session.lists.append(tl)
|
||||||
self.buffers.append(tl)
|
self.buffers.append(tl)
|
||||||
self.view.insert_buffer(tl.buffer, name=_(u"List for {}").format(i), pos=self.view.search("lists", session.db["user_name"]))
|
self.view.insert_buffer(tl.buffer, name=_("List for {}").format(i), pos=self.view.search("lists", session.db["user_name"]))
|
||||||
searches = buffersController.emptyPanel(self.view.nb, "searches", session.db["user_name"])
|
searches = buffersController.emptyPanel(self.view.nb, "searches", session.db["user_name"])
|
||||||
self.buffers.append(searches)
|
self.buffers.append(searches)
|
||||||
self.view.insert_buffer(searches.buffer , name=_(u"Searches"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(searches.buffer , name=_("Searches"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
for i in session.settings["other_buffers"]["tweet_searches"]:
|
for i in session.settings["other_buffers"]["tweet_searches"]:
|
||||||
tl = buffersController.searchBufferController(self.view.nb, "search", "%s-searchterm" % (i,), session, session.db["user_name"], bufferType="searchPanel", q=i, tweet_mode="extended")
|
tl = buffersController.searchBufferController(self.view.nb, "search", "%s-searchterm" % (i,), session, session.db["user_name"], bufferType="searchPanel", q=i, tweet_mode="extended")
|
||||||
self.buffers.append(tl)
|
self.buffers.append(tl)
|
||||||
self.view.insert_buffer(tl.buffer, name=_(u"Search for {}").format(i), pos=self.view.search("searches", session.db["user_name"]))
|
self.view.insert_buffer(tl.buffer, name=_("Search for {}").format(i), pos=self.view.search("searches", session.db["user_name"]))
|
||||||
tl.timer = RepeatingTimer(180, tl.start_stream)
|
tl.timer = RepeatingTimer(180, tl.start_stream)
|
||||||
tl.timer.start()
|
tl.timer.start()
|
||||||
for i in session.settings["other_buffers"]["trending_topic_buffers"]:
|
for i in session.settings["other_buffers"]["trending_topic_buffers"]:
|
||||||
@ -402,7 +402,7 @@ class Controller(object):
|
|||||||
self.buffers.append(buffer)
|
self.buffers.append(buffer)
|
||||||
buffer.timer = RepeatingTimer(300, buffer.start_stream)
|
buffer.timer = RepeatingTimer(300, buffer.start_stream)
|
||||||
buffer.timer.start()
|
buffer.timer.start()
|
||||||
self.view.insert_buffer(buffer.buffer, name=_(u"Trending topics for %s") % (buffer.name_), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
self.view.insert_buffer(buffer.buffer, name=_("Trending topics for %s") % (buffer.name_), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
|
|
||||||
def set_buffer_positions(self, session):
|
def set_buffer_positions(self, session):
|
||||||
"Sets positions for buffers if values exist in the database."
|
"Sets positions for buffers if values exist in the database."
|
||||||
@ -455,7 +455,7 @@ class Controller(object):
|
|||||||
search.start_stream(mandatory=True)
|
search.start_stream(mandatory=True)
|
||||||
pos=self.view.search("searches", buffer.session.db["user_name"])
|
pos=self.view.search("searches", buffer.session.db["user_name"])
|
||||||
self.insert_buffer(search, pos)
|
self.insert_buffer(search, pos)
|
||||||
self.view.insert_buffer(search.buffer, name=_(u"Search for {}").format(term), pos=pos)
|
self.view.insert_buffer(search.buffer, name=_("Search for {}").format(term), pos=pos)
|
||||||
search.timer = RepeatingTimer(180, search.start_stream)
|
search.timer = RepeatingTimer(180, search.start_stream)
|
||||||
search.timer.start()
|
search.timer.start()
|
||||||
dlg.Destroy()
|
dlg.Destroy()
|
||||||
@ -474,18 +474,18 @@ class Controller(object):
|
|||||||
return
|
return
|
||||||
page = self.get_current_buffer()
|
page = self.get_current_buffer()
|
||||||
if not hasattr(page.buffer, "list"):
|
if not hasattr(page.buffer, "list"):
|
||||||
output.speak(_(u"No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
|
output.speak(_("No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
|
||||||
return
|
return
|
||||||
count = page.buffer.list.get_count()
|
count = page.buffer.list.get_count()
|
||||||
if count < 1:
|
if count < 1:
|
||||||
output.speak(_(u"Empty buffer."), True)
|
output.speak(_("Empty buffer."), True)
|
||||||
return
|
return
|
||||||
start = page.buffer.list.get_selected()
|
start = page.buffer.list.get_selected()
|
||||||
for i in range(start,count):
|
for i in range(start,count):
|
||||||
page.buffer.list.select_item(i)
|
page.buffer.list.select_item(i)
|
||||||
if string.lower() in page.get_message().lower():
|
if string.lower() in page.get_message().lower():
|
||||||
return output.speak(page.get_message(), True)
|
return output.speak(page.get_message(), True)
|
||||||
output.speak(_(u"{0} not found.").format(string,), True)
|
output.speak(_("{0} not found.").format(string,), True)
|
||||||
page.buffer.list.select_item(start)
|
page.buffer.list.select_item(start)
|
||||||
|
|
||||||
def seekLeft(self, *args, **kwargs):
|
def seekLeft(self, *args, **kwargs):
|
||||||
@ -531,7 +531,7 @@ class Controller(object):
|
|||||||
users = utils.get_all_users(tweet, buff.session.db)
|
users = utils.get_all_users(tweet, buff.session.db)
|
||||||
else:
|
else:
|
||||||
users = [tweet["screen_name"]]
|
users = [tweet["screen_name"]]
|
||||||
dlg = dialogs.utils.selectUserDialog(_(u"Select the user"), users)
|
dlg = dialogs.utils.selectUserDialog(_("Select the user"), users)
|
||||||
if dlg.get_response() == widgetUtils.OK:
|
if dlg.get_response() == widgetUtils.OK:
|
||||||
user = dlg.get_user()
|
user = dlg.get_user()
|
||||||
else:
|
else:
|
||||||
@ -546,7 +546,7 @@ class Controller(object):
|
|||||||
users = utils.get_all_users(tweet, buff.session.db)
|
users = utils.get_all_users(tweet, buff.session.db)
|
||||||
else:
|
else:
|
||||||
users = [tweet["screen_name"]]
|
users = [tweet["screen_name"]]
|
||||||
dlg = dialogs.utils.selectUserDialog(_(u"Select the user"), users)
|
dlg = dialogs.utils.selectUserDialog(_("Select the user"), users)
|
||||||
if dlg.get_response() == widgetUtils.OK:
|
if dlg.get_response() == widgetUtils.OK:
|
||||||
user = dlg.get_user()
|
user = dlg.get_user()
|
||||||
else:
|
else:
|
||||||
@ -573,7 +573,7 @@ class Controller(object):
|
|||||||
users = utils.get_all_users(tweet, buff.session.db)
|
users = utils.get_all_users(tweet, buff.session.db)
|
||||||
else:
|
else:
|
||||||
users = [tweet["screen_name"]]
|
users = [tweet["screen_name"]]
|
||||||
dlg = dialogs.utils.selectUserDialog(_(u"Select the user"), users)
|
dlg = dialogs.utils.selectUserDialog(_("Select the user"), users)
|
||||||
if dlg.get_response() == widgetUtils.OK:
|
if dlg.get_response() == widgetUtils.OK:
|
||||||
user = dlg.get_user()
|
user = dlg.get_user()
|
||||||
else:
|
else:
|
||||||
@ -823,7 +823,7 @@ class Controller(object):
|
|||||||
return
|
return
|
||||||
pos=self.view.search("timelines", buff.session.db["user_name"])
|
pos=self.view.search("timelines", buff.session.db["user_name"])
|
||||||
self.insert_buffer(tl, pos+1)
|
self.insert_buffer(tl, pos+1)
|
||||||
self.view.insert_buffer(tl.buffer, name=_(u"Timeline for {}").format(dlg.get_user()), pos=pos)
|
self.view.insert_buffer(tl.buffer, name=_("Timeline for {}").format(dlg.get_user()), pos=pos)
|
||||||
buff.session.settings["other_buffers"]["timelines"].append(usr["id_str"])
|
buff.session.settings["other_buffers"]["timelines"].append(usr["id_str"])
|
||||||
pub.sendMessage("buffer-title-changed", buffer=tl)
|
pub.sendMessage("buffer-title-changed", buffer=tl)
|
||||||
pub.sendMessage("restart-streams", streams=["timelinesStream"], session=buff.session)
|
pub.sendMessage("restart-streams", streams=["timelinesStream"], session=buff.session)
|
||||||
@ -843,7 +843,7 @@ class Controller(object):
|
|||||||
return
|
return
|
||||||
pos=self.view.search("favs_timelines", buff.session.db["user_name"])
|
pos=self.view.search("favs_timelines", buff.session.db["user_name"])
|
||||||
self.insert_buffer(tl, pos+1)
|
self.insert_buffer(tl, pos+1)
|
||||||
self.view.insert_buffer(buffer=tl.buffer, name=_(u"Likes for {}").format(dlg.get_user()), pos=pos)
|
self.view.insert_buffer(buffer=tl.buffer, name=_("Likes for {}").format(dlg.get_user()), pos=pos)
|
||||||
tl.timer = RepeatingTimer(300, tl.start_stream)
|
tl.timer = RepeatingTimer(300, tl.start_stream)
|
||||||
tl.timer.start()
|
tl.timer.start()
|
||||||
buff.session.settings["other_buffers"]["favourites_timelines"].append(usr["id_str"])
|
buff.session.settings["other_buffers"]["favourites_timelines"].append(usr["id_str"])
|
||||||
@ -864,7 +864,7 @@ class Controller(object):
|
|||||||
return
|
return
|
||||||
pos=self.view.search("followers_timelines", buff.session.db["user_name"])
|
pos=self.view.search("followers_timelines", buff.session.db["user_name"])
|
||||||
self.insert_buffer(tl, pos+1)
|
self.insert_buffer(tl, pos+1)
|
||||||
self.view.insert_buffer(buffer=tl.buffer, name=_(u"Followers for {}").format(dlg.get_user()), pos=pos)
|
self.view.insert_buffer(buffer=tl.buffer, name=_("Followers for {}").format(dlg.get_user()), pos=pos)
|
||||||
tl.timer = RepeatingTimer(300, tl.start_stream)
|
tl.timer = RepeatingTimer(300, tl.start_stream)
|
||||||
tl.timer.start()
|
tl.timer.start()
|
||||||
buff.session.settings["other_buffers"]["followers_timelines"].append(usr["id_str"])
|
buff.session.settings["other_buffers"]["followers_timelines"].append(usr["id_str"])
|
||||||
@ -885,7 +885,7 @@ class Controller(object):
|
|||||||
return
|
return
|
||||||
pos=self.view.search("friends_timelines", buff.session.db["user_name"])
|
pos=self.view.search("friends_timelines", buff.session.db["user_name"])
|
||||||
self.insert_buffer(tl, pos+1)
|
self.insert_buffer(tl, pos+1)
|
||||||
self.view.insert_buffer(buffer=tl.buffer, name=_(u"Friends for {}").format(dlg.get_user()), pos=pos)
|
self.view.insert_buffer(buffer=tl.buffer, name=_("Friends for {}").format(dlg.get_user()), pos=pos)
|
||||||
tl.timer = RepeatingTimer(300, tl.start_stream)
|
tl.timer = RepeatingTimer(300, tl.start_stream)
|
||||||
tl.timer.start()
|
tl.timer.start()
|
||||||
buff.session.settings["other_buffers"]["friends_timelines"].append(usr["id_str"])
|
buff.session.settings["other_buffers"]["friends_timelines"].append(usr["id_str"])
|
||||||
@ -905,7 +905,7 @@ class Controller(object):
|
|||||||
pos=self.view.search("searches", buffer.session.db["user_name"])
|
pos=self.view.search("searches", buffer.session.db["user_name"])
|
||||||
# self.buffers.append(search)
|
# self.buffers.append(search)
|
||||||
self.insert_buffer(search, pos)
|
self.insert_buffer(search, pos)
|
||||||
self.view.insert_buffer(search.buffer, name=_(u"Conversation with {0}").format(user), pos=pos)
|
self.view.insert_buffer(search.buffer, name=_("Conversation with {0}").format(user), pos=pos)
|
||||||
search.timer = RepeatingTimer(300, search.start_stream)
|
search.timer = RepeatingTimer(300, search.start_stream)
|
||||||
search.timer.start()
|
search.timer.start()
|
||||||
|
|
||||||
@ -932,7 +932,7 @@ class Controller(object):
|
|||||||
buffer = buffersController.trendsBufferController(self.view.nb, "%s_tt" % (woeid,), buff.session, buff.account, woeid)
|
buffer = buffersController.trendsBufferController(self.view.nb, "%s_tt" % (woeid,), buff.session, buff.account, woeid)
|
||||||
buffer.searchfunction = self.search
|
buffer.searchfunction = self.search
|
||||||
pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"])
|
pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"])
|
||||||
self.view.insert_buffer(buffer.buffer, name=_(u"Trending topics for %s") % (trends.get_string()), pos=pos)
|
self.view.insert_buffer(buffer.buffer, name=_("Trending topics for %s") % (trends.get_string()), pos=pos)
|
||||||
self.buffers.append(buffer)
|
self.buffers.append(buffer)
|
||||||
buffer.start_stream()
|
buffer.start_stream()
|
||||||
timer = RepeatingTimer(300, buffer.start_stream)
|
timer = RepeatingTimer(300, buffer.start_stream)
|
||||||
@ -950,11 +950,11 @@ class Controller(object):
|
|||||||
if event == None: output.speak(address[0].__str__())
|
if event == None: output.speak(address[0].__str__())
|
||||||
else: self.view.show_address(address[0].__str__())
|
else: self.view.show_address(address[0].__str__())
|
||||||
else:
|
else:
|
||||||
output.speak(_(u"There are no coordinates in this tweet"))
|
output.speak(_("There are no coordinates in this tweet"))
|
||||||
except GeocoderError:
|
except GeocoderError:
|
||||||
output.speak(_(u"There are no results for the coordinates in this tweet"))
|
output.speak(_("There are no results for the coordinates in this tweet"))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
output.speak(_(u"Error decoding coordinates. Try again later."))
|
output.speak(_("Error decoding coordinates. Try again later."))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
@ -969,11 +969,11 @@ class Controller(object):
|
|||||||
address = geocoder.reverse_geocode(y, x)
|
address = geocoder.reverse_geocode(y, x)
|
||||||
dlg = commonMessageDialogs.view_geodata(address[0].__str__())
|
dlg = commonMessageDialogs.view_geodata(address[0].__str__())
|
||||||
else:
|
else:
|
||||||
output.speak(_(u"There are no coordinates in this tweet"))
|
output.speak(_("There are no coordinates in this tweet"))
|
||||||
except GeocoderError:
|
except GeocoderError:
|
||||||
output.speak(_(u"There are no results for the coordinates in this tweet"))
|
output.speak(_("There are no results for the coordinates in this tweet"))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
output.speak(_(u"Error decoding coordinates. Try again later."))
|
output.speak(_("Error decoding coordinates. Try again later."))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
@ -1033,7 +1033,7 @@ class Controller(object):
|
|||||||
def up(self, *args, **kwargs):
|
def up(self, *args, **kwargs):
|
||||||
page = self.get_current_buffer()
|
page = self.get_current_buffer()
|
||||||
if not hasattr(page.buffer, "list"):
|
if not hasattr(page.buffer, "list"):
|
||||||
output.speak(_(u"No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
|
output.speak(_("No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
|
||||||
return
|
return
|
||||||
position = page.buffer.list.get_selected()
|
position = page.buffer.list.get_selected()
|
||||||
index = position-1
|
index = position-1
|
||||||
@ -1052,7 +1052,7 @@ class Controller(object):
|
|||||||
def down(self, *args, **kwargs):
|
def down(self, *args, **kwargs):
|
||||||
page = self.get_current_buffer()
|
page = self.get_current_buffer()
|
||||||
if not hasattr(page.buffer, "list"):
|
if not hasattr(page.buffer, "list"):
|
||||||
output.speak(_(u"No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
|
output.speak(_("No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
|
||||||
return
|
return
|
||||||
position = page.buffer.list.get_selected()
|
position = page.buffer.list.get_selected()
|
||||||
index = position+1
|
index = position+1
|
||||||
@ -1071,7 +1071,7 @@ class Controller(object):
|
|||||||
buff = self.view.get_current_buffer_pos()
|
buff = self.view.get_current_buffer_pos()
|
||||||
buffer = self.get_current_buffer()
|
buffer = self.get_current_buffer()
|
||||||
if not hasattr(buffer.buffer, "list"):
|
if not hasattr(buffer.buffer, "list"):
|
||||||
output.speak(_(u"No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
|
output.speak(_("No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
|
||||||
return
|
return
|
||||||
if buff == self.get_first_buffer(buffer.account) or buff == 0:
|
if buff == self.get_first_buffer(buffer.account) or buff == 0:
|
||||||
self.view.change_buffer(self.get_last_buffer(buffer.account))
|
self.view.change_buffer(self.get_last_buffer(buffer.account))
|
||||||
@ -1081,16 +1081,16 @@ class Controller(object):
|
|||||||
buffer = self.get_current_buffer()
|
buffer = self.get_current_buffer()
|
||||||
if self.showing == True: buffer.buffer.set_focus_in_list()
|
if self.showing == True: buffer.buffer.set_focus_in_list()
|
||||||
try:
|
try:
|
||||||
msg = _(u"%s, %s of %s") % (self.view.get_buffer_text(), buffer.buffer.list.get_selected()+1, buffer.buffer.list.get_count())
|
msg = _("%s, %s of %s") % (self.view.get_buffer_text(), buffer.buffer.list.get_selected()+1, buffer.buffer.list.get_count())
|
||||||
except:
|
except:
|
||||||
msg = _(u"%s. Empty") % (self.view.get_buffer_text(),)
|
msg = _("%s. Empty") % (self.view.get_buffer_text(),)
|
||||||
output.speak(msg, True)
|
output.speak(msg, True)
|
||||||
|
|
||||||
def right(self, *args, **kwargs):
|
def right(self, *args, **kwargs):
|
||||||
buff = self.view.get_current_buffer_pos()
|
buff = self.view.get_current_buffer_pos()
|
||||||
buffer = self.get_current_buffer()
|
buffer = self.get_current_buffer()
|
||||||
if not hasattr(buffer.buffer, "list"):
|
if not hasattr(buffer.buffer, "list"):
|
||||||
output.speak(_(u"No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
|
output.speak(_("No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
|
||||||
return
|
return
|
||||||
if buff == self.get_last_buffer(buffer.account) or buff+1 == self.view.get_buffer_count():
|
if buff == self.get_last_buffer(buffer.account) or buff+1 == self.view.get_buffer_count():
|
||||||
self.view.change_buffer(self.get_first_buffer(buffer.account))
|
self.view.change_buffer(self.get_first_buffer(buffer.account))
|
||||||
@ -1100,9 +1100,9 @@ class Controller(object):
|
|||||||
buffer = self.get_current_buffer()
|
buffer = self.get_current_buffer()
|
||||||
if self.showing == True: buffer.buffer.set_focus_in_list()
|
if self.showing == True: buffer.buffer.set_focus_in_list()
|
||||||
try:
|
try:
|
||||||
msg = _(u"%s, %s of %s") % (self.view.get_buffer_text(), buffer.buffer.list.get_selected()+1, buffer.buffer.list.get_count())
|
msg = _("%s, %s of %s") % (self.view.get_buffer_text(), buffer.buffer.list.get_selected()+1, buffer.buffer.list.get_count())
|
||||||
except:
|
except:
|
||||||
msg = _(u"%s. Empty") % (self.view.get_buffer_text(),)
|
msg = _("%s. Empty") % (self.view.get_buffer_text(),)
|
||||||
output.speak(msg, True)
|
output.speak(msg, True)
|
||||||
|
|
||||||
def next_account(self, *args, **kwargs):
|
def next_account(self, *args, **kwargs):
|
||||||
@ -1115,15 +1115,15 @@ class Controller(object):
|
|||||||
self.current_account = account
|
self.current_account = account
|
||||||
buff = self.view.search("home_timeline", account)
|
buff = self.view.search("home_timeline", account)
|
||||||
if buff == None:
|
if buff == None:
|
||||||
output.speak(_(u"{0}: This account is not logged into Twitter.").format(account), True)
|
output.speak(_("{0}: This account is not logged into Twitter.").format(account), True)
|
||||||
return
|
return
|
||||||
self.view.change_buffer(buff)
|
self.view.change_buffer(buff)
|
||||||
buffer = self.get_current_buffer()
|
buffer = self.get_current_buffer()
|
||||||
if self.showing == True: buffer.buffer.set_focus_in_list()
|
if self.showing == True: buffer.buffer.set_focus_in_list()
|
||||||
try:
|
try:
|
||||||
msg = _(u"%s. %s, %s of %s") % (buffer.account, self.view.get_buffer_text(), buffer.buffer.list.get_selected()+1, buffer.buffer.list.get_count())
|
msg = _("%s. %s, %s of %s") % (buffer.account, self.view.get_buffer_text(), buffer.buffer.list.get_selected()+1, buffer.buffer.list.get_count())
|
||||||
except:
|
except:
|
||||||
msg = _(u"%s. Empty") % (self.view.get_buffer_text(),)
|
msg = _("%s. Empty") % (self.view.get_buffer_text(),)
|
||||||
output.speak(msg, True)
|
output.speak(msg, True)
|
||||||
|
|
||||||
def previous_account(self, *args, **kwargs):
|
def previous_account(self, *args, **kwargs):
|
||||||
@ -1136,15 +1136,15 @@ class Controller(object):
|
|||||||
self.current_account = account
|
self.current_account = account
|
||||||
buff = self.view.search("home_timeline", account)
|
buff = self.view.search("home_timeline", account)
|
||||||
if buff == None:
|
if buff == None:
|
||||||
output.speak(_(u"{0}: This account is not logged into twitter.").format(account), True)
|
output.speak(_("{0}: This account is not logged into twitter.").format(account), True)
|
||||||
return
|
return
|
||||||
self.view.change_buffer(buff)
|
self.view.change_buffer(buff)
|
||||||
buffer = self.get_current_buffer()
|
buffer = self.get_current_buffer()
|
||||||
if self.showing == True: buffer.buffer.set_focus_in_list()
|
if self.showing == True: buffer.buffer.set_focus_in_list()
|
||||||
try:
|
try:
|
||||||
msg = _(u"%s. %s, %s of %s") % (buffer.account, self.view.get_buffer_text(), buffer.buffer.list.get_selected()+1, buffer.buffer.list.get_count())
|
msg = _("%s. %s, %s of %s") % (buffer.account, self.view.get_buffer_text(), buffer.buffer.list.get_selected()+1, buffer.buffer.list.get_count())
|
||||||
except:
|
except:
|
||||||
msg = _(u"%s. Empty") % (self.view.get_buffer_text(),)
|
msg = _("%s. Empty") % (self.view.get_buffer_text(),)
|
||||||
output.speak(msg, True)
|
output.speak(msg, True)
|
||||||
|
|
||||||
def go_home(self):
|
def go_home(self):
|
||||||
@ -1239,7 +1239,7 @@ class Controller(object):
|
|||||||
buffer = self.search_buffer("mentions", user)
|
buffer = self.search_buffer("mentions", user)
|
||||||
if buffer == None: return
|
if buffer == None: return
|
||||||
play_sound = "mention_received.ogg"
|
play_sound = "mention_received.ogg"
|
||||||
message = _(u"One mention from %s ") % (data["user"]["name"])
|
message = _("One mention from %s ") % (data["user"]["name"])
|
||||||
if "mentions" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
|
if "mentions" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
|
||||||
self.notify(buffer.session, play_sound=play_sound, message=message)
|
self.notify(buffer.session, play_sound=play_sound, message=message)
|
||||||
buffer.add_new_item(data)
|
buffer.add_new_item(data)
|
||||||
@ -1248,7 +1248,7 @@ class Controller(object):
|
|||||||
buffer = self.search_buffer("direct_messages", user)
|
buffer = self.search_buffer("direct_messages", user)
|
||||||
if buffer == None: return
|
if buffer == None: return
|
||||||
play_sound = "dm_received.ogg"
|
play_sound = "dm_received.ogg"
|
||||||
message = _(u"New direct message")
|
message = _("New direct message")
|
||||||
if "direct_messages" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
|
if "direct_messages" not in buffer.session.settings["other_buffers"]["muted_buffers"]:
|
||||||
self.notify(buffer.session, play_sound=play_sound, message=message)
|
self.notify(buffer.session, play_sound=play_sound, message=message)
|
||||||
buffer.add_new_item(data)
|
buffer.add_new_item(data)
|
||||||
@ -1328,7 +1328,7 @@ class Controller(object):
|
|||||||
play_sound = "tweet_timeline.ogg"
|
play_sound = "tweet_timeline.ogg"
|
||||||
if "%s-timeline" % (who,) not in buffer.session.settings["other_buffers"]["muted_buffers"] and buffer.session.settings["sound"]["session_mute"] == False:
|
if "%s-timeline" % (who,) not in buffer.session.settings["other_buffers"]["muted_buffers"] and buffer.session.settings["sound"]["session_mute"] == False:
|
||||||
self.notify(buffer.session, play_sound=play_sound)
|
self.notify(buffer.session, play_sound=play_sound)
|
||||||
output.speak(_(u"One tweet from %s") % (data["user"]["name"]))
|
output.speak(_("One tweet from %s") % (data["user"]["name"]))
|
||||||
buffer.add_new_item(data)
|
buffer.add_new_item(data)
|
||||||
|
|
||||||
def manage_item_in_list(self, data, user, where):
|
def manage_item_in_list(self, data, user, where):
|
||||||
@ -1337,7 +1337,7 @@ class Controller(object):
|
|||||||
play_sound = "list_tweet.ogg"
|
play_sound = "list_tweet.ogg"
|
||||||
if "%s" % (where,) not in buffer.session.settings["other_buffers"]["muted_buffers"] and buffer.session.settings["sound"]["session_mute"] == False:
|
if "%s" % (where,) not in buffer.session.settings["other_buffers"]["muted_buffers"] and buffer.session.settings["sound"]["session_mute"] == False:
|
||||||
self.notify(buffer.session, play_sound=play_sound)
|
self.notify(buffer.session, play_sound=play_sound)
|
||||||
output.speak(_(u"One tweet from %s") % (data["user"]["name"]))
|
output.speak(_("One tweet from %s") % (data["user"]["name"]))
|
||||||
buffer.add_new_item(data)
|
buffer.add_new_item(data)
|
||||||
|
|
||||||
def start_buffers(self, session):
|
def start_buffers(self, session):
|
||||||
@ -1401,43 +1401,43 @@ class Controller(object):
|
|||||||
if buffer == "favourites":
|
if buffer == "favourites":
|
||||||
favourites = buffersController.baseBufferController(self.view.nb, "get_favorites", "favourites", buff.session, buff.session.db["user_name"])
|
favourites = buffersController.baseBufferController(self.view.nb, "get_favorites", "favourites", buff.session, buff.session.db["user_name"])
|
||||||
self.buffers.append(favourites)
|
self.buffers.append(favourites)
|
||||||
self.view.insert_buffer(favourites.buffer, name=_(u"Likes"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
self.view.insert_buffer(favourites.buffer, name=_("Likes"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
||||||
favourites.start_stream()
|
favourites.start_stream()
|
||||||
if buffer == "followers":
|
if buffer == "followers":
|
||||||
followers = buffersController.peopleBufferController(self.view.nb, "get_followers_list", "followers", buff.session, buff.session.db["user_name"], screen_name=buff.session.db["user_name"])
|
followers = buffersController.peopleBufferController(self.view.nb, "get_followers_list", "followers", buff.session, buff.session.db["user_name"], screen_name=buff.session.db["user_name"])
|
||||||
self.buffers.append(followers)
|
self.buffers.append(followers)
|
||||||
self.view.insert_buffer(followers.buffer, name=_(u"Followers"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
self.view.insert_buffer(followers.buffer, name=_("Followers"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
||||||
followers.start_stream()
|
followers.start_stream()
|
||||||
elif buffer == "friends":
|
elif buffer == "friends":
|
||||||
friends = buffersController.peopleBufferController(self.view.nb, "get_friends_list", "friends", buff.session, buff.session.db["user_name"], screen_name=buff.session.db["user_name"])
|
friends = buffersController.peopleBufferController(self.view.nb, "get_friends_list", "friends", buff.session, buff.session.db["user_name"], screen_name=buff.session.db["user_name"])
|
||||||
self.buffers.append(friends)
|
self.buffers.append(friends)
|
||||||
self.view.insert_buffer(friends.buffer, name=_(u"Friends"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
self.view.insert_buffer(friends.buffer, name=_("Friends"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
||||||
friends.start_stream()
|
friends.start_stream()
|
||||||
elif buffer == "blocked":
|
elif buffer == "blocked":
|
||||||
blocks = buffersController.peopleBufferController(self.view.nb, "list_blocks", "blocked", buff.session, buff.session.db["user_name"])
|
blocks = buffersController.peopleBufferController(self.view.nb, "list_blocks", "blocked", buff.session, buff.session.db["user_name"])
|
||||||
self.buffers.append(blocks)
|
self.buffers.append(blocks)
|
||||||
self.view.insert_buffer(blocks.buffer, name=_(u"Blocked users"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
self.view.insert_buffer(blocks.buffer, name=_("Blocked users"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
||||||
blocks.start_stream()
|
blocks.start_stream()
|
||||||
elif buffer == "muted":
|
elif buffer == "muted":
|
||||||
muted = buffersController.peopleBufferController(self.view.nb, "get_muted_users_list", "muted", buff.session, buff.session.db["user_name"])
|
muted = buffersController.peopleBufferController(self.view.nb, "get_muted_users_list", "muted", buff.session, buff.session.db["user_name"])
|
||||||
self.buffers.append(muted)
|
self.buffers.append(muted)
|
||||||
self.view.insert_buffer(muted.buffer, name=_(u"Muted users"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
self.view.insert_buffer(muted.buffer, name=_("Muted users"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
||||||
muted.start_stream()
|
muted.start_stream()
|
||||||
elif buffer == "events":
|
elif buffer == "events":
|
||||||
events = buffersController.eventsBufferController(self.view.nb, "events", buff.session, buff.session.db["user_name"], bufferType="dmPanel", screen_name=buff.session.db["user_name"])
|
events = buffersController.eventsBufferController(self.view.nb, "events", buff.session, buff.session.db["user_name"], bufferType="dmPanel", screen_name=buff.session.db["user_name"])
|
||||||
self.buffers.append(events)
|
self.buffers.append(events)
|
||||||
self.view.insert_buffer(events.buffer, name=_(u"Events"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
self.view.insert_buffer(events.buffer, name=_("Events"), pos=self.view.search(buff.session.db["user_name"], buff.session.db["user_name"]))
|
||||||
elif create == False:
|
elif create == False:
|
||||||
self.destroy_buffer(buffer, buff.session.db["user_name"])
|
self.destroy_buffer(buffer, buff.session.db["user_name"])
|
||||||
elif buffer == "list":
|
elif buffer == "list":
|
||||||
if create in buff.session.settings["other_buffers"]["lists"]:
|
if create in buff.session.settings["other_buffers"]["lists"]:
|
||||||
output.speak(_(u"This list is already opened"), True)
|
output.speak(_("This list is already opened"), True)
|
||||||
return
|
return
|
||||||
tl = buffersController.listBufferController(self.view.nb, "get_list_statuses", create+"-list", buff.session, buff.session.db["user_name"], bufferType=None, list_id=utils.find_list(create, buff.session.db["lists"]))
|
tl = buffersController.listBufferController(self.view.nb, "get_list_statuses", create+"-list", buff.session, buff.session.db["user_name"], bufferType=None, list_id=utils.find_list(create, buff.session.db["lists"]))
|
||||||
buff.session.lists.append(tl)
|
buff.session.lists.append(tl)
|
||||||
pos=self.view.search("lists", buff.session.db["user_name"])
|
pos=self.view.search("lists", buff.session.db["user_name"])
|
||||||
self.insert_buffer(tl, pos)
|
self.insert_buffer(tl, pos)
|
||||||
self.view.insert_buffer(tl.buffer, name=_(u"List for {}").format(create), pos=self.view.search("lists", buff.session.db["user_name"]))
|
self.view.insert_buffer(tl.buffer, name=_("List for {}").format(create), pos=self.view.search("lists", buff.session.db["user_name"]))
|
||||||
tl.start_stream()
|
tl.start_stream()
|
||||||
buff.session.settings["other_buffers"]["lists"].append(create)
|
buff.session.settings["other_buffers"]["lists"].append(create)
|
||||||
buff.session.settings.write()
|
buff.session.settings.write()
|
||||||
@ -1491,20 +1491,20 @@ class Controller(object):
|
|||||||
if hasattr(buffer, "session") and buffer.session == None: return
|
if hasattr(buffer, "session") and buffer.session == None: return
|
||||||
if buffer.name not in buffer.session.settings["other_buffers"]["autoread_buffers"]:
|
if buffer.name not in buffer.session.settings["other_buffers"]["autoread_buffers"]:
|
||||||
buffer.session.settings["other_buffers"]["autoread_buffers"].append(buffer.name)
|
buffer.session.settings["other_buffers"]["autoread_buffers"].append(buffer.name)
|
||||||
output.speak(_(u"The auto-reading of new tweets is enabled for this buffer"), True)
|
output.speak(_("The auto-reading of new tweets is enabled for this buffer"), True)
|
||||||
elif buffer.name in buffer.session.settings["other_buffers"]["autoread_buffers"]:
|
elif buffer.name in buffer.session.settings["other_buffers"]["autoread_buffers"]:
|
||||||
buffer.session.settings["other_buffers"]["autoread_buffers"].remove(buffer.name)
|
buffer.session.settings["other_buffers"]["autoread_buffers"].remove(buffer.name)
|
||||||
output.speak(_(u"The auto-reading of new tweets is disabled for this buffer"), True)
|
output.speak(_("The auto-reading of new tweets is disabled for this buffer"), True)
|
||||||
buffer.session.settings.write()
|
buffer.session.settings.write()
|
||||||
|
|
||||||
def toggle_session_mute(self, *args, **kwargs):
|
def toggle_session_mute(self, *args, **kwargs):
|
||||||
buffer = self.get_best_buffer()
|
buffer = self.get_best_buffer()
|
||||||
if buffer.session.settings["sound"]["session_mute"] == False:
|
if buffer.session.settings["sound"]["session_mute"] == False:
|
||||||
buffer.session.settings["sound"]["session_mute"] = True
|
buffer.session.settings["sound"]["session_mute"] = True
|
||||||
output.speak(_(u"Session mute on"), True)
|
output.speak(_("Session mute on"), True)
|
||||||
elif buffer.session.settings["sound"]["session_mute"] == True:
|
elif buffer.session.settings["sound"]["session_mute"] == True:
|
||||||
buffer.session.settings["sound"]["session_mute"] = False
|
buffer.session.settings["sound"]["session_mute"] = False
|
||||||
output.speak(_(u"Session mute off"), True)
|
output.speak(_("Session mute off"), True)
|
||||||
buffer.session.settings.write()
|
buffer.session.settings.write()
|
||||||
|
|
||||||
def toggle_buffer_mute(self, *args, **kwargs):
|
def toggle_buffer_mute(self, *args, **kwargs):
|
||||||
@ -1512,10 +1512,10 @@ class Controller(object):
|
|||||||
if hasattr(buffer, "session") and buffer.session == None: return
|
if hasattr(buffer, "session") and buffer.session == None: return
|
||||||
if buffer.name not in buffer.session.settings["other_buffers"]["muted_buffers"]:
|
if buffer.name not in buffer.session.settings["other_buffers"]["muted_buffers"]:
|
||||||
buffer.session.settings["other_buffers"]["muted_buffers"].append(buffer.name)
|
buffer.session.settings["other_buffers"]["muted_buffers"].append(buffer.name)
|
||||||
output.speak(_(u"Buffer mute on"), True)
|
output.speak(_("Buffer mute on"), True)
|
||||||
elif buffer.name in buffer.session.settings["other_buffers"]["muted_buffers"]:
|
elif buffer.name in buffer.session.settings["other_buffers"]["muted_buffers"]:
|
||||||
buffer.session.settings["other_buffers"]["muted_buffers"].remove(buffer.name)
|
buffer.session.settings["other_buffers"]["muted_buffers"].remove(buffer.name)
|
||||||
output.speak(_(u"Buffer mute off"), True)
|
output.speak(_("Buffer mute off"), True)
|
||||||
buffer.session.settings.write()
|
buffer.session.settings.write()
|
||||||
|
|
||||||
def view_documentation(self, *args, **kwargs):
|
def view_documentation(self, *args, **kwargs):
|
||||||
@ -1535,7 +1535,7 @@ class Controller(object):
|
|||||||
|
|
||||||
def copy_to_clipboard(self, *args, **kwargs):
|
def copy_to_clipboard(self, *args, **kwargs):
|
||||||
output.copy(self.get_current_buffer().get_message())
|
output.copy(self.get_current_buffer().get_message())
|
||||||
output.speak(_(u"Copied"))
|
output.speak(_("Copied"))
|
||||||
|
|
||||||
def repeat_item(self, *args, **kwargs):
|
def repeat_item(self, *args, **kwargs):
|
||||||
output.speak(self.get_current_buffer().get_message())
|
output.speak(self.get_current_buffer().get_message())
|
||||||
@ -1562,13 +1562,13 @@ class Controller(object):
|
|||||||
def update_buffer(self, *args, **kwargs):
|
def update_buffer(self, *args, **kwargs):
|
||||||
bf = self.get_current_buffer()
|
bf = self.get_current_buffer()
|
||||||
if not hasattr(bf, "start_stream"):
|
if not hasattr(bf, "start_stream"):
|
||||||
output.speak(_(u"Unable to update this buffer."))
|
output.speak(_("Unable to update this buffer."))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
output.speak(_(u"Updating buffer..."))
|
output.speak(_("Updating buffer..."))
|
||||||
n = bf.start_stream(mandatory=True)
|
n = bf.start_stream(mandatory=True)
|
||||||
if n != None:
|
if n != None:
|
||||||
output.speak(_(u"{0} items retrieved").format(n,))
|
output.speak(_("{0} items retrieved").format(n,))
|
||||||
|
|
||||||
def on_tweet_deleted(self, data):
|
def on_tweet_deleted(self, data):
|
||||||
id = data["delete"]["status"]["id"]
|
id = data["delete"]["status"]["id"]
|
||||||
@ -1578,28 +1578,28 @@ class Controller(object):
|
|||||||
|
|
||||||
def buffer_title_changed(self, buffer):
|
def buffer_title_changed(self, buffer):
|
||||||
if "-timeline" in buffer.name:
|
if "-timeline" in buffer.name:
|
||||||
title = _(u"Timeline for {}").format(buffer.username,)
|
title = _("Timeline for {}").format(buffer.username,)
|
||||||
elif "-favorite" in buffer.name:
|
elif "-favorite" in buffer.name:
|
||||||
title = _(u"Likes for {}").format(buffer.username,)
|
title = _("Likes for {}").format(buffer.username,)
|
||||||
elif "-followers" in buffer.name:
|
elif "-followers" in buffer.name:
|
||||||
title = _(u"Followers for {}").format(buffer.username,)
|
title = _("Followers for {}").format(buffer.username,)
|
||||||
elif "-friends" in buffer.name:
|
elif "-friends" in buffer.name:
|
||||||
title = _(u"Friends for {}").format(buffer.username,)
|
title = _("Friends for {}").format(buffer.username,)
|
||||||
buffer_index = self.view.search(buffer.name, buffer.account)
|
buffer_index = self.view.search(buffer.name, buffer.account)
|
||||||
self.view.set_page_title(buffer_index, title)
|
self.view.set_page_title(buffer_index, title)
|
||||||
|
|
||||||
def ocr_image(self, *args, **kwargs):
|
def ocr_image(self, *args, **kwargs):
|
||||||
buffer = self.get_current_buffer()
|
buffer = self.get_current_buffer()
|
||||||
if hasattr(buffer, "get_right_tweet") == False:
|
if hasattr(buffer, "get_right_tweet") == False:
|
||||||
output.speak(_(u"Invalid buffer"))
|
output.speak(_("Invalid buffer"))
|
||||||
return
|
return
|
||||||
tweet = buffer.get_tweet()
|
tweet = buffer.get_tweet()
|
||||||
if ("entities" in tweet) == False or ("media" in tweet["entities"]) == False:
|
if ("entities" in tweet) == False or ("media" in tweet["entities"]) == False:
|
||||||
output.speak(_(u"This tweet doesn't contain images"))
|
output.speak(_("This tweet doesn't contain images"))
|
||||||
return
|
return
|
||||||
if len(tweet["entities"]["media"]) > 1:
|
if len(tweet["entities"]["media"]) > 1:
|
||||||
image_list = [_(u"Picture {0}").format(i,) for i in range(0, len(tweet["entities"]["media"]))]
|
image_list = [_("Picture {0}").format(i,) for i in range(0, len(tweet["entities"]["media"]))]
|
||||||
dialog = dialogs.urlList.urlList(title=_(u"Select the picture"))
|
dialog = dialogs.urlList.urlList(title=_("Select the picture"))
|
||||||
if dialog.get_response() == widgetUtils.OK:
|
if dialog.get_response() == widgetUtils.OK:
|
||||||
img = tweet["entities"]["media"][dialog.get_item()]
|
img = tweet["entities"]["media"][dialog.get_item()]
|
||||||
else:
|
else:
|
||||||
@ -1615,7 +1615,7 @@ class Controller(object):
|
|||||||
try:
|
try:
|
||||||
text = api.OCR_URL(img["media_url"], lang=ocr_lang)
|
text = api.OCR_URL(img["media_url"], lang=ocr_lang)
|
||||||
except ocr.OCRSpace.APIError as er:
|
except ocr.OCRSpace.APIError as er:
|
||||||
output.speak(_(u"Unable to extract text"))
|
output.speak(_("Unable to extract text"))
|
||||||
return
|
return
|
||||||
msg = messages.viewTweet(text["ParsedText"], [], False)
|
msg = messages.viewTweet(text["ParsedText"], [], False)
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from builtins import range
|
from builtins import range
|
||||||
from builtins import object
|
from builtins import object
|
||||||
@ -50,18 +50,18 @@ class basicTweet(object):
|
|||||||
self.message.set_text(msg)
|
self.message.set_text(msg)
|
||||||
self.text_processor()
|
self.text_processor()
|
||||||
self.message.text_focus()
|
self.message.text_focus()
|
||||||
output.speak(_(u"Translated"))
|
output.speak(_("Translated"))
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
def shorten(self, event=None):
|
def shorten(self, event=None):
|
||||||
urls = utils.find_urls_in_text(self.message.get_text())
|
urls = utils.find_urls_in_text(self.message.get_text())
|
||||||
if len(urls) == 0:
|
if len(urls) == 0:
|
||||||
output.speak(_(u"There's no URL to be shortened"))
|
output.speak(_("There's no URL to be shortened"))
|
||||||
self.message.text_focus()
|
self.message.text_focus()
|
||||||
elif len(urls) == 1:
|
elif len(urls) == 1:
|
||||||
self.message.set_text(self.message.get_text().replace(urls[0], url_shortener.shorten(urls[0])))
|
self.message.set_text(self.message.get_text().replace(urls[0], url_shortener.shorten(urls[0])))
|
||||||
output.speak(_(u"URL shortened"))
|
output.speak(_("URL shortened"))
|
||||||
self.text_processor()
|
self.text_processor()
|
||||||
self.message.text_focus()
|
self.message.text_focus()
|
||||||
elif len(urls) > 1:
|
elif len(urls) > 1:
|
||||||
@ -69,18 +69,18 @@ class basicTweet(object):
|
|||||||
list_urls.populate_list(urls)
|
list_urls.populate_list(urls)
|
||||||
if list_urls.get_response() == widgetUtils.OK:
|
if list_urls.get_response() == widgetUtils.OK:
|
||||||
self.message.set_text(self.message.get_text().replace(urls[list_urls.get_item()], url_shortener.shorten(list_urls.get_string())))
|
self.message.set_text(self.message.get_text().replace(urls[list_urls.get_item()], url_shortener.shorten(list_urls.get_string())))
|
||||||
output.speak(_(u"URL shortened"))
|
output.speak(_("URL shortened"))
|
||||||
self.text_processor()
|
self.text_processor()
|
||||||
self.message.text_focus()
|
self.message.text_focus()
|
||||||
|
|
||||||
def unshorten(self, event=None):
|
def unshorten(self, event=None):
|
||||||
urls = utils.find_urls_in_text(self.message.get_text())
|
urls = utils.find_urls_in_text(self.message.get_text())
|
||||||
if len(urls) == 0:
|
if len(urls) == 0:
|
||||||
output.speak(_(u"There's no URL to be expanded"))
|
output.speak(_("There's no URL to be expanded"))
|
||||||
self.message.text_focus()
|
self.message.text_focus()
|
||||||
elif len(urls) == 1:
|
elif len(urls) == 1:
|
||||||
self.message.set_text(self.message.get_text().replace(urls[0], url_shortener.unshorten(urls[0])))
|
self.message.set_text(self.message.get_text().replace(urls[0], url_shortener.unshorten(urls[0])))
|
||||||
output.speak(_(u"URL expanded"))
|
output.speak(_("URL expanded"))
|
||||||
self.text_processor()
|
self.text_processor()
|
||||||
self.message.text_focus()
|
self.message.text_focus()
|
||||||
elif len(urls) > 1:
|
elif len(urls) > 1:
|
||||||
@ -88,7 +88,7 @@ class basicTweet(object):
|
|||||||
list_urls.populate_list(urls)
|
list_urls.populate_list(urls)
|
||||||
if list_urls.get_response() == widgetUtils.OK:
|
if list_urls.get_response() == widgetUtils.OK:
|
||||||
self.message.set_text(self.message.get_text().replace(urls[list_urls.get_item()], url_shortener.unshorten(list_urls.get_string())))
|
self.message.set_text(self.message.get_text().replace(urls[list_urls.get_item()], url_shortener.unshorten(list_urls.get_string())))
|
||||||
output.speak(_(u"URL expanded"))
|
output.speak(_("URL expanded"))
|
||||||
self.text_processor()
|
self.text_processor()
|
||||||
self.message.text_focus()
|
self.message.text_focus()
|
||||||
|
|
||||||
@ -100,11 +100,11 @@ class basicTweet(object):
|
|||||||
self.message.disable_button("shortenButton")
|
self.message.disable_button("shortenButton")
|
||||||
self.message.disable_button("unshortenButton")
|
self.message.disable_button("unshortenButton")
|
||||||
if self.message.get("long_tweet") == False:
|
if self.message.get("long_tweet") == False:
|
||||||
self.message.set_title(_(u"%s - %s of %d characters") % (self.title, len(self.message.get_text()), self.max))
|
self.message.set_title(_("%s - %s of %d characters") % (self.title, len(self.message.get_text()), self.max))
|
||||||
if len(self.message.get_text()) > self.max:
|
if len(self.message.get_text()) > self.max:
|
||||||
self.session.sound.play("max_length.ogg")
|
self.session.sound.play("max_length.ogg")
|
||||||
else:
|
else:
|
||||||
self.message.set_title(_(u"%s - %s characters") % (self.title, len(self.message.get_text())))
|
self.message.set_title(_("%s - %s characters") % (self.title, len(self.message.get_text())))
|
||||||
|
|
||||||
def spellcheck(self, event=None):
|
def spellcheck(self, event=None):
|
||||||
text = self.message.get_text()
|
text = self.message.get_text()
|
||||||
@ -123,7 +123,7 @@ class basicTweet(object):
|
|||||||
self.message.set_text(self.message.get_text()+url+" #audio")
|
self.message.set_text(self.message.get_text()+url+" #audio")
|
||||||
self.text_processor()
|
self.text_processor()
|
||||||
else:
|
else:
|
||||||
output.speak(_(u"Unable to upload the audio"))
|
output.speak(_("Unable to upload the audio"))
|
||||||
dlg.cleanup()
|
dlg.cleanup()
|
||||||
dlg = audioUploader.audioUploader(self.session.settings, completed_callback)
|
dlg = audioUploader.audioUploader(self.session.settings, completed_callback)
|
||||||
self.message.text_focus()
|
self.message.text_focus()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import division
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from past.utils import old_div
|
from past.utils import old_div
|
||||||
from builtins import object
|
from builtins import object
|
||||||
@ -73,7 +73,7 @@ class globalSettingsController(object):
|
|||||||
self.dialog.set_value("general", "hide_gui", config.app["app-settings"]["hide_gui"])
|
self.dialog.set_value("general", "hide_gui", config.app["app-settings"]["hide_gui"])
|
||||||
self.dialog.set_value("general", "check_for_updates", config.app["app-settings"]["check_for_updates"])
|
self.dialog.set_value("general", "check_for_updates", config.app["app-settings"]["check_for_updates"])
|
||||||
proxyTypes=config.proxyTypes
|
proxyTypes=config.proxyTypes
|
||||||
self.dialog.create_proxy([_(u"Direct connection")]+proxyTypes)
|
self.dialog.create_proxy([_("Direct connection")]+proxyTypes)
|
||||||
if config.app["proxy"]["type"] not in proxyTypes:
|
if config.app["proxy"]["type"] not in proxyTypes:
|
||||||
self.dialog.proxy.type.SetSelection(0)
|
self.dialog.proxy.type.SetSelection(0)
|
||||||
else:
|
else:
|
||||||
@ -138,11 +138,11 @@ class accountSettingsController(globalSettingsController):
|
|||||||
self.dialog.set_value("general", "reverse_timelines", self.config["general"]["reverse_timelines"])
|
self.dialog.set_value("general", "reverse_timelines", self.config["general"]["reverse_timelines"])
|
||||||
rt = self.config["general"]["retweet_mode"]
|
rt = self.config["general"]["retweet_mode"]
|
||||||
if rt == "ask":
|
if rt == "ask":
|
||||||
self.dialog.set_value("general", "retweet_mode", _(u"Ask"))
|
self.dialog.set_value("general", "retweet_mode", _("Ask"))
|
||||||
elif rt == "direct":
|
elif rt == "direct":
|
||||||
self.dialog.set_value("general", "retweet_mode", _(u"Retweet without comments"))
|
self.dialog.set_value("general", "retweet_mode", _("Retweet without comments"))
|
||||||
else:
|
else:
|
||||||
self.dialog.set_value("general", "retweet_mode", _(u"Retweet with comments"))
|
self.dialog.set_value("general", "retweet_mode", _("Retweet with comments"))
|
||||||
self.dialog.set_value("general", "persist_size", str(self.config["general"]["persist_size"]))
|
self.dialog.set_value("general", "persist_size", str(self.config["general"]["persist_size"]))
|
||||||
self.dialog.create_other_buffers()
|
self.dialog.create_other_buffers()
|
||||||
buffer_values = self.get_buffers_list()
|
buffer_values = self.get_buffers_list()
|
||||||
@ -174,7 +174,7 @@ class accountSettingsController(globalSettingsController):
|
|||||||
language_index = OCRSpace.OcrLangs.index(self.config["mysc"]["ocr_language"])
|
language_index = OCRSpace.OcrLangs.index(self.config["mysc"]["ocr_language"])
|
||||||
self.dialog.extras.ocr_lang.SetSelection(language_index)
|
self.dialog.extras.ocr_lang.SetSelection(language_index)
|
||||||
self.dialog.realize()
|
self.dialog.realize()
|
||||||
self.dialog.set_title(_(u"Account settings for %s") % (self.user,))
|
self.dialog.set_title(_("Account settings for %s") % (self.user,))
|
||||||
self.response = self.dialog.get_response()
|
self.response = self.dialog.get_response()
|
||||||
|
|
||||||
def save_configuration(self):
|
def save_configuration(self):
|
||||||
@ -198,9 +198,9 @@ class accountSettingsController(globalSettingsController):
|
|||||||
self.needs_restart = True
|
self.needs_restart = True
|
||||||
self.config["general"]["reverse_timelines"] = self.dialog.get_value("general", "reverse_timelines")
|
self.config["general"]["reverse_timelines"] = self.dialog.get_value("general", "reverse_timelines")
|
||||||
rt = self.dialog.get_value("general", "retweet_mode")
|
rt = self.dialog.get_value("general", "retweet_mode")
|
||||||
if rt == _(u"Ask"):
|
if rt == _("Ask"):
|
||||||
self.config["general"]["retweet_mode"] = "ask"
|
self.config["general"]["retweet_mode"] = "ask"
|
||||||
elif rt == _(u"Retweet without comments"):
|
elif rt == _("Retweet without comments"):
|
||||||
self.config["general"]["retweet_mode"] = "direct"
|
self.config["general"]["retweet_mode"] = "direct"
|
||||||
else:
|
else:
|
||||||
self.config["general"]["retweet_mode"] = "comment"
|
self.config["general"]["retweet_mode"] = "comment"
|
||||||
@ -271,17 +271,17 @@ class accountSettingsController(globalSettingsController):
|
|||||||
|
|
||||||
def get_buffers_list(self):
|
def get_buffers_list(self):
|
||||||
all_buffers=OrderedDict()
|
all_buffers=OrderedDict()
|
||||||
all_buffers['home']=_(u"Home")
|
all_buffers['home']=_("Home")
|
||||||
all_buffers['mentions']=_(u"Mentions")
|
all_buffers['mentions']=_("Mentions")
|
||||||
all_buffers['dm']=_(u"Direct Messages")
|
all_buffers['dm']=_("Direct Messages")
|
||||||
all_buffers['sent_dm']=_(u"Sent direct messages")
|
all_buffers['sent_dm']=_("Sent direct messages")
|
||||||
all_buffers['sent_tweets']=_(u"Sent tweets")
|
all_buffers['sent_tweets']=_("Sent tweets")
|
||||||
all_buffers['favorites']=_(u"Likes")
|
all_buffers['favorites']=_("Likes")
|
||||||
all_buffers['followers']=_(u"Followers")
|
all_buffers['followers']=_("Followers")
|
||||||
all_buffers['friends']=_(u"Friends")
|
all_buffers['friends']=_("Friends")
|
||||||
all_buffers['blocks']=_(u"Blocked users")
|
all_buffers['blocks']=_("Blocked users")
|
||||||
all_buffers['muted']=_(u"Muted users")
|
all_buffers['muted']=_("Muted users")
|
||||||
all_buffers['events']=_(u"Events")
|
all_buffers['events']=_("Events")
|
||||||
list_buffers = []
|
list_buffers = []
|
||||||
hidden_buffers=[]
|
hidden_buffers=[]
|
||||||
for i in list(all_buffers.keys()):
|
for i in list(all_buffers.keys()):
|
||||||
|
@ -26,15 +26,15 @@ class profileController(object):
|
|||||||
self.get_data(screen_name=self.user)
|
self.get_data(screen_name=self.user)
|
||||||
except TwythonError as err:
|
except TwythonError as err:
|
||||||
if err.error_code == 404:
|
if err.error_code == 404:
|
||||||
wx.MessageDialog(None, _(u"That user does not exist"), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
wx.MessageDialog(None, _("That user does not exist"), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
if err.error_code == 403:
|
if err.error_code == 403:
|
||||||
wx.MessageDialog(None, _(u"User has been suspended"), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
wx.MessageDialog(None, _("User has been suspended"), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
log.error("error %d: %s" % (err.error_code, err.msg))
|
log.error("error %d: %s" % (err.error_code, err.msg))
|
||||||
return
|
return
|
||||||
self.dialog = show_user.showUserProfile()
|
self.dialog = show_user.showUserProfile()
|
||||||
string = self.get_user_info()
|
string = self.get_user_info()
|
||||||
self.dialog.set("text", string)
|
self.dialog.set("text", string)
|
||||||
self.dialog.set_title(_(u"Information for %s") % (self.data["screen_name"]))
|
self.dialog.set_title(_("Information for %s") % (self.data["screen_name"]))
|
||||||
if self.data["url"] != None:
|
if self.data["url"] != None:
|
||||||
self.dialog.enable_url()
|
self.dialog.enable_url()
|
||||||
widgetUtils.connect_event(self.dialog.url, widgetUtils.BUTTON_PRESSED, self.visit_url)
|
widgetUtils.connect_event(self.dialog.url, widgetUtils.BUTTON_PRESSED, self.visit_url)
|
||||||
@ -64,7 +64,7 @@ class profileController(object):
|
|||||||
|
|
||||||
def discard_image(self):
|
def discard_image(self):
|
||||||
self.file = None
|
self.file = None
|
||||||
output.speak(_(u"Discarded"))
|
output.speak(_("Discarded"))
|
||||||
self.uploaded = False
|
self.uploaded = False
|
||||||
self.dialog.change_upload_button(self.uploaded)
|
self.dialog.change_upload_button(self.uploaded)
|
||||||
|
|
||||||
@ -84,43 +84,43 @@ class profileController(object):
|
|||||||
try:
|
try:
|
||||||
self.session.twitter.twitter.update_profile_image(image=self.file)
|
self.session.twitter.twitter.update_profile_image(image=self.file)
|
||||||
except TwythonError as e:
|
except TwythonError as e:
|
||||||
output.speak(u"Error %s. %s" % (e.error_code, e.msg))
|
output.speak("Error %s. %s" % (e.error_code, e.msg))
|
||||||
try:
|
try:
|
||||||
self.session.twitter.twitter.update_profile(name=name, description=description, location=location, url=url)
|
self.session.twitter.twitter.update_profile(name=name, description=description, location=location, url=url)
|
||||||
except TwythonError as e:
|
except TwythonError as e:
|
||||||
output.speak(u"Error %s. %s" % (e.error_code, e.msg))
|
output.speak("Error %s. %s" % (e.error_code, e.msg))
|
||||||
|
|
||||||
def get_user_info(self):
|
def get_user_info(self):
|
||||||
|
|
||||||
string = u""
|
string = ""
|
||||||
string = string + _(u"Username: @%s\n") % (self.data["screen_name"])
|
string = string + _("Username: @%s\n") % (self.data["screen_name"])
|
||||||
string = string + _(u"Name: %s\n") % (self.data["name"])
|
string = string + _("Name: %s\n") % (self.data["name"])
|
||||||
if self.data["location"] != "":
|
if self.data["location"] != "":
|
||||||
string = string + _(u"Location: %s\n") % (self.data["location"])
|
string = string + _("Location: %s\n") % (self.data["location"])
|
||||||
if self.data["url"] != None:
|
if self.data["url"] != None:
|
||||||
string = string+ _(u"URL: %s\n") % (self.data["url"])
|
string = string+ _("URL: %s\n") % (self.data["url"])
|
||||||
if self.data["description"] != "":
|
if self.data["description"] != "":
|
||||||
string = string+ _(u"Bio: %s\n") % (self.data["description"])
|
string = string+ _("Bio: %s\n") % (self.data["description"])
|
||||||
if self.data["protected"] == True: protected = _(u"Yes")
|
if self.data["protected"] == True: protected = _("Yes")
|
||||||
else: protected = _(u"No")
|
else: protected = _("No")
|
||||||
string = string+ _(u"Protected: %s\n") % (protected)
|
string = string+ _("Protected: %s\n") % (protected)
|
||||||
if hasattr(self, "friendship_status"):
|
if hasattr(self, "friendship_status"):
|
||||||
relation = False
|
relation = False
|
||||||
friendship = "Relationship: "
|
friendship = "Relationship: "
|
||||||
if self.friendship_status["relationship"]["target"]["followed_by"]:
|
if self.friendship_status["relationship"]["target"]["followed_by"]:
|
||||||
friendship += _(u"You follow {0}. ").format(self.data["name"],)
|
friendship += _("You follow {0}. ").format(self.data["name"],)
|
||||||
relation = True
|
relation = True
|
||||||
if self.friendship_status["relationship"]["target"]["following"]:
|
if self.friendship_status["relationship"]["target"]["following"]:
|
||||||
friendship += _(u"{0} is following you.").format(self.data["name"],)
|
friendship += _("{0} is following you.").format(self.data["name"],)
|
||||||
relation = True
|
relation = True
|
||||||
if relation == True:
|
if relation == True:
|
||||||
string = string+friendship+"\n"
|
string = string+friendship+"\n"
|
||||||
string = string+_(u"Followers: %s\n Friends: %s\n") % (self.data["followers_count"], self.data["friends_count"])
|
string = string+_("Followers: %s\n Friends: %s\n") % (self.data["followers_count"], self.data["friends_count"])
|
||||||
if self.data["verified"] == True: verified = _(u"Yes")
|
if self.data["verified"] == True: verified = _("Yes")
|
||||||
else: verified = _(u"No")
|
else: verified = _("No")
|
||||||
string = string+ _(u"Verified: %s\n") % (verified)
|
string = string+ _("Verified: %s\n") % (verified)
|
||||||
string = string+ _(u"Tweets: %s\n") % (self.data["statuses_count"])
|
string = string+ _("Tweets: %s\n") % (self.data["statuses_count"])
|
||||||
string = string+ _(u"Likes: %s") % (self.data["favourites_count"])
|
string = string+ _("Likes: %s") % (self.data["favourites_count"])
|
||||||
return string
|
return string
|
||||||
|
|
||||||
def visit_url(self, *args, **kwargs):
|
def visit_url(self, *args, **kwargs):
|
||||||
|
@ -73,7 +73,7 @@ class userActionsController(object):
|
|||||||
def ignore_client(self, user):
|
def ignore_client(self, user):
|
||||||
tweet = self.buffer.get_right_tweet()
|
tweet = self.buffer.get_right_tweet()
|
||||||
if "sender" in tweet:
|
if "sender" in tweet:
|
||||||
output.speak(_(u"You can't ignore direct messages"))
|
output.speak(_("You can't ignore direct messages"))
|
||||||
return
|
return
|
||||||
client = re.sub(r"(?s)<.*?>", "", tweet["source"])
|
client = re.sub(r"(?s)<.*?>", "", tweet["source"])
|
||||||
if client not in self.session.settings["twitter"]["ignored_clients"]:
|
if client not in self.session.settings["twitter"]["ignored_clients"]:
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
############################################################
|
############################################################
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from builtins import object
|
from builtins import object
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
@ -53,7 +53,7 @@ class audioUploader(object):
|
|||||||
self.postprocess()
|
self.postprocess()
|
||||||
log.debug("Uploading file %s to %s..." % (self.file, self.dialog.get("services")))
|
log.debug("Uploading file %s to %s..." % (self.file, self.dialog.get("services")))
|
||||||
self.uploaderDialog = wx_transfer_dialogs.UploadDialog(self.file)
|
self.uploaderDialog = wx_transfer_dialogs.UploadDialog(self.file)
|
||||||
output.speak(_(u"Attaching..."))
|
output.speak(_("Attaching..."))
|
||||||
if self.dialog.get("services") == "SNDUp":
|
if self.dialog.get("services") == "SNDUp":
|
||||||
base_url = "http://sndup.net/post.php"
|
base_url = "http://sndup.net/post.php"
|
||||||
if len(self.config["sound"]["sndup_api_key"]) > 0:
|
if len(self.config["sound"]["sndup_api_key"]) > 0:
|
||||||
@ -70,12 +70,12 @@ class audioUploader(object):
|
|||||||
return services
|
return services
|
||||||
|
|
||||||
def on_pause(self, *args, **kwargs):
|
def on_pause(self, *args, **kwargs):
|
||||||
if self.dialog.get("pause") == _(u"Pause"):
|
if self.dialog.get("pause") == _("Pause"):
|
||||||
self.recording.pause()
|
self.recording.pause()
|
||||||
self.dialog.set("pause", _(u"&Resume"))
|
self.dialog.set("pause", _("&Resume"))
|
||||||
elif self.dialog.get("pause") == _(u"Resume"):
|
elif self.dialog.get("pause") == _("Resume"):
|
||||||
self.recording.play()
|
self.recording.play()
|
||||||
self.dialog.set("pause", _(U"&Pause"))
|
self.dialog.set("pause", _("&Pause"))
|
||||||
|
|
||||||
def on_record(self, *args, **kwargs):
|
def on_record(self, *args, **kwargs):
|
||||||
if self.recording != None:
|
if self.recording != None:
|
||||||
@ -90,19 +90,19 @@ class audioUploader(object):
|
|||||||
self.file = tempfile.mktemp(suffix='.wav')
|
self.file = tempfile.mktemp(suffix='.wav')
|
||||||
self.recording = sound.recording(self.file)
|
self.recording = sound.recording(self.file)
|
||||||
self.recording.play()
|
self.recording.play()
|
||||||
self.dialog.set("record", _(u"&Stop"))
|
self.dialog.set("record", _("&Stop"))
|
||||||
output.speak(_(u"Recording"))
|
output.speak(_("Recording"))
|
||||||
|
|
||||||
def stop_recording(self):
|
def stop_recording(self):
|
||||||
self.recording.stop()
|
self.recording.stop()
|
||||||
self.recording.free()
|
self.recording.free()
|
||||||
output.speak(_(u"Stopped"))
|
output.speak(_("Stopped"))
|
||||||
self.recorded = True
|
self.recorded = True
|
||||||
self.dialog.set("record", _(u"&Record"))
|
self.dialog.set("record", _("&Record"))
|
||||||
self.file_attached()
|
self.file_attached()
|
||||||
|
|
||||||
def file_attached(self):
|
def file_attached(self):
|
||||||
self.dialog.set("pause", _(u"&Pause"))
|
self.dialog.set("pause", _("&Pause"))
|
||||||
self.dialog.disable_control("record")
|
self.dialog.disable_control("record")
|
||||||
self.dialog.enable_control("play")
|
self.dialog.enable_control("play")
|
||||||
self.dialog.enable_control("discard")
|
self.dialog.enable_control("discard")
|
||||||
@ -123,7 +123,7 @@ class audioUploader(object):
|
|||||||
self.dialog.record.SetFocus()
|
self.dialog.record.SetFocus()
|
||||||
self.dialog.disable_control("discard")
|
self.dialog.disable_control("discard")
|
||||||
self.recording = None
|
self.recording = None
|
||||||
output.speak(_(u"Discarded"))
|
output.speak(_("Discarded"))
|
||||||
|
|
||||||
def on_play(self, *args, **kwargs):
|
def on_play(self, *args, **kwargs):
|
||||||
if not self.playing:
|
if not self.playing:
|
||||||
@ -132,30 +132,30 @@ class audioUploader(object):
|
|||||||
self._stop()
|
self._stop()
|
||||||
|
|
||||||
def _play(self):
|
def _play(self):
|
||||||
output.speak(_(u"Playing..."))
|
output.speak(_("Playing..."))
|
||||||
# try:
|
# try:
|
||||||
self.playing = sound_lib.stream.FileStream(file=str(self.file), flags=sound_lib.stream.BASS_UNICODE)
|
self.playing = sound_lib.stream.FileStream(file=str(self.file), flags=sound_lib.stream.BASS_UNICODE)
|
||||||
self.playing.play()
|
self.playing.play()
|
||||||
self.dialog.set("play", _(u"&Stop"))
|
self.dialog.set("play", _("&Stop"))
|
||||||
try:
|
try:
|
||||||
while self.playing.is_playing:
|
while self.playing.is_playing:
|
||||||
pass
|
pass
|
||||||
self.dialog.set("play", _(u"&Play"))
|
self.dialog.set("play", _("&Play"))
|
||||||
self.playing.free()
|
self.playing.free()
|
||||||
self.playing = None
|
self.playing = None
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _stop(self):
|
def _stop(self):
|
||||||
output.speak(_(u"Stopped"))
|
output.speak(_("Stopped"))
|
||||||
self.playing.stop()
|
self.playing.stop()
|
||||||
self.playing.free()
|
self.playing.free()
|
||||||
self.dialog.set("play", _(u"&Play"))
|
self.dialog.set("play", _("&Play"))
|
||||||
self.playing = None
|
self.playing = None
|
||||||
|
|
||||||
def postprocess(self):
|
def postprocess(self):
|
||||||
if self.file.lower().endswith('.wav'):
|
if self.file.lower().endswith('.wav'):
|
||||||
output.speak(_(u"Recoding audio..."))
|
output.speak(_("Recoding audio..."))
|
||||||
sound.recode_audio(self.file)
|
sound.recode_audio(self.file)
|
||||||
self.wav_file = self.file
|
self.wav_file = self.file
|
||||||
self.file = '%s.ogg' % self.file[:-4]
|
self.file = '%s.ogg' % self.file[:-4]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from __future__ import division
|
|
||||||
from builtins import object
|
from builtins import object
|
||||||
from past.utils import old_div
|
from past.utils import old_div
|
||||||
import sys
|
import sys
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import division
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from past.utils import old_div
|
from past.utils import old_div
|
||||||
def convert_bytes(n):
|
def convert_bytes(n):
|
||||||
@ -27,19 +27,19 @@ def seconds_to_string(seconds, precision=0):
|
|||||||
sec_string = sec.__format__(sec_spec)
|
sec_string = sec.__format__(sec_spec)
|
||||||
string = ""
|
string = ""
|
||||||
if day == 1:
|
if day == 1:
|
||||||
string += _(u"%d day, ") % day
|
string += _("%d day, ") % day
|
||||||
elif day >= 2:
|
elif day >= 2:
|
||||||
string += _(u"%d days, ") % day
|
string += _("%d days, ") % day
|
||||||
if (hour == 1):
|
if (hour == 1):
|
||||||
string += _(u"%d hour, ") % hour
|
string += _("%d hour, ") % hour
|
||||||
elif (hour >= 2):
|
elif (hour >= 2):
|
||||||
string += _("%d hours, ") % hour
|
string += _("%d hours, ") % hour
|
||||||
if (min == 1):
|
if (min == 1):
|
||||||
string += _(u"%d minute, ") % min
|
string += _("%d minute, ") % min
|
||||||
elif (min >= 2):
|
elif (min >= 2):
|
||||||
string += _(u"%d minutes, ") % min
|
string += _("%d minutes, ") % min
|
||||||
if sec >= 0 and sec <= 2:
|
if sec >= 0 and sec <= 2:
|
||||||
string += _(u"%s second") % sec_string
|
string += _("%s second") % sec_string
|
||||||
else:
|
else:
|
||||||
string += _(u"%s seconds") % sec_string
|
string += _("%s seconds") % sec_string
|
||||||
return string
|
return string
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
import wx
|
import wx
|
||||||
from .utils import *
|
from .utils import *
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
@ -11,28 +11,28 @@ class UploadDialog(widgetUtils.BaseDialog):
|
|||||||
self.pane = wx.Panel(self)
|
self.pane = wx.Panel(self)
|
||||||
self.progress_bar = wx.Gauge(parent=self.pane)
|
self.progress_bar = wx.Gauge(parent=self.pane)
|
||||||
fileBox = wx.BoxSizer(wx.HORIZONTAL)
|
fileBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
fileLabel = wx.StaticText(self.pane, -1, _(u"File"))
|
fileLabel = wx.StaticText(self.pane, -1, _("File"))
|
||||||
self.file = wx.TextCtrl(self.pane, -1, value=filename, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(200, 100))
|
self.file = wx.TextCtrl(self.pane, -1, value=filename, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(200, 100))
|
||||||
self.file.SetFocus()
|
self.file.SetFocus()
|
||||||
fileBox.Add(fileLabel)
|
fileBox.Add(fileLabel)
|
||||||
fileBox.Add(self.file)
|
fileBox.Add(self.file)
|
||||||
currentAmountBox = wx.BoxSizer(wx.HORIZONTAL)
|
currentAmountBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
current_amount_label = wx.StaticText(self.pane, -1, _(u"Transferred"))
|
current_amount_label = wx.StaticText(self.pane, -1, _("Transferred"))
|
||||||
self.current_amount = wx.TextCtrl(self.pane, -1, value='0', style=wx.TE_READONLY|wx.TE_MULTILINE)
|
self.current_amount = wx.TextCtrl(self.pane, -1, value='0', style=wx.TE_READONLY|wx.TE_MULTILINE)
|
||||||
currentAmountBox.Add(current_amount_label)
|
currentAmountBox.Add(current_amount_label)
|
||||||
currentAmountBox.Add(self.current_amount)
|
currentAmountBox.Add(self.current_amount)
|
||||||
totalSizeBox = wx.BoxSizer(wx.HORIZONTAL)
|
totalSizeBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
total_size_label = wx.StaticText(self.pane, -1, _(u"Total file size"))
|
total_size_label = wx.StaticText(self.pane, -1, _("Total file size"))
|
||||||
self.total_size = wx.TextCtrl(self.pane, -1, value='0', style=wx.TE_READONLY|wx.TE_MULTILINE)
|
self.total_size = wx.TextCtrl(self.pane, -1, value='0', style=wx.TE_READONLY|wx.TE_MULTILINE)
|
||||||
totalSizeBox.Add(total_size_label)
|
totalSizeBox.Add(total_size_label)
|
||||||
totalSizeBox.Add(self.total_size)
|
totalSizeBox.Add(self.total_size)
|
||||||
speedBox = wx.BoxSizer(wx.HORIZONTAL)
|
speedBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
speedLabel = wx.StaticText(self.pane, -1, _(u"Transfer rate"))
|
speedLabel = wx.StaticText(self.pane, -1, _("Transfer rate"))
|
||||||
self.speed = wx.TextCtrl(self.pane, -1, style=wx.TE_READONLY|wx.TE_MULTILINE, value="0 Kb/s")
|
self.speed = wx.TextCtrl(self.pane, -1, style=wx.TE_READONLY|wx.TE_MULTILINE, value="0 Kb/s")
|
||||||
speedBox.Add(speedLabel)
|
speedBox.Add(speedLabel)
|
||||||
speedBox.Add(self.speed)
|
speedBox.Add(self.speed)
|
||||||
etaBox = wx.BoxSizer(wx.HORIZONTAL)
|
etaBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
etaLabel = wx.StaticText(self.pane, -1, _(u"Time left"))
|
etaLabel = wx.StaticText(self.pane, -1, _("Time left"))
|
||||||
self.eta = wx.TextCtrl(self.pane, -1, style=wx.TE_READONLY|wx.TE_MULTILINE, value="Unknown", size=(200, 100))
|
self.eta = wx.TextCtrl(self.pane, -1, style=wx.TE_READONLY|wx.TE_MULTILINE, value="Unknown", size=(200, 100))
|
||||||
etaBox.Add(etaLabel)
|
etaBox.Add(etaLabel)
|
||||||
etaBox.Add(self.eta)
|
etaBox.Add(self.eta)
|
||||||
|
@ -25,29 +25,29 @@ log = logging.getLogger("extra.AudioUploader.wx_UI")
|
|||||||
class audioDialog(widgetUtils.BaseDialog):
|
class audioDialog(widgetUtils.BaseDialog):
|
||||||
def __init__(self, services):
|
def __init__(self, services):
|
||||||
log.debug("creating audio dialog.")
|
log.debug("creating audio dialog.")
|
||||||
super(audioDialog, self).__init__(None, -1, _(u"Attach audio"))
|
super(audioDialog, self).__init__(None, -1, _("Attach audio"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
btnSizer2 = wx.BoxSizer(wx.HORIZONTAL)
|
btnSizer2 = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
|
|
||||||
self.play = wx.Button(panel, -1, _(u"&Play"))
|
self.play = wx.Button(panel, -1, _("&Play"))
|
||||||
self.play.Disable()
|
self.play.Disable()
|
||||||
self.pause = wx.Button(panel, -1, _(u"&Pause"))
|
self.pause = wx.Button(panel, -1, _("&Pause"))
|
||||||
self.pause.Disable()
|
self.pause.Disable()
|
||||||
self.record = wx.Button(panel, -1, _(u"&Record"))
|
self.record = wx.Button(panel, -1, _("&Record"))
|
||||||
self.record.SetFocus()
|
self.record.SetFocus()
|
||||||
self.attach_exists = wx.Button(panel, -1, _(u"&Add an existing file"))
|
self.attach_exists = wx.Button(panel, -1, _("&Add an existing file"))
|
||||||
self.discard = wx.Button(panel, -1, _(u"&Discard"))
|
self.discard = wx.Button(panel, -1, _("&Discard"))
|
||||||
self.discard.Disable()
|
self.discard.Disable()
|
||||||
label = wx.StaticText(panel, -1, _(u"Upload to"))
|
label = wx.StaticText(panel, -1, _("Upload to"))
|
||||||
self.services = wx.ComboBox(panel, -1, choices=services, value=services[0], style=wx.CB_READONLY)
|
self.services = wx.ComboBox(panel, -1, choices=services, value=services[0], style=wx.CB_READONLY)
|
||||||
servicesBox = wx.BoxSizer(wx.HORIZONTAL)
|
servicesBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
servicesBox.Add(label, 0, wx.ALL, 5)
|
servicesBox.Add(label, 0, wx.ALL, 5)
|
||||||
servicesBox.Add(self.services, 0, wx.ALL, 5)
|
servicesBox.Add(self.services, 0, wx.ALL, 5)
|
||||||
self.attach = wx.Button(panel, wx.ID_OK, _(u"Attach"))
|
self.attach = wx.Button(panel, wx.ID_OK, _("Attach"))
|
||||||
self.attach.Disable()
|
self.attach.Disable()
|
||||||
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"&Cancel"))
|
cancel = wx.Button(panel, wx.ID_CANCEL, _("&Cancel"))
|
||||||
btnSizer.Add(self.play, 0, wx.ALL, 5)
|
btnSizer.Add(self.play, 0, wx.ALL, 5)
|
||||||
btnSizer.Add(self.pause, 0, wx.ALL, 5)
|
btnSizer.Add(self.pause, 0, wx.ALL, 5)
|
||||||
btnSizer.Add(self.record, 0, wx.ALL, 5)
|
btnSizer.Add(self.record, 0, wx.ALL, 5)
|
||||||
@ -72,7 +72,7 @@ class audioDialog(widgetUtils.BaseDialog):
|
|||||||
getattr(self, control).Disable()
|
getattr(self, control).Disable()
|
||||||
|
|
||||||
def get_file(self):
|
def get_file(self):
|
||||||
openFileDialog = wx.FileDialog(self, _(u"Select the audio file to be uploaded"), "", "", _("Audio Files (*.mp3, *.ogg, *.wav)|*.mp3; *.ogg; *.wav"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
openFileDialog = wx.FileDialog(self, _("Select the audio file to be uploaded"), "", "", _("Audio Files (*.mp3, *.ogg, *.wav)|*.mp3; *.ogg; *.wav"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
||||||
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
||||||
return False
|
return False
|
||||||
return openFileDialog.GetPath()
|
return openFileDialog.GetPath()
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from .soundsTutorial import soundsTutorial
|
from .soundsTutorial import soundsTutorial
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import object
|
from builtins import object
|
||||||
import platform
|
import platform
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#-*- coding: utf-8 -*-
|
#-*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
#-*- coding: utf-8 -*-
|
#-*- coding: utf-8 -*-
|
||||||
from . import reverse_sort
|
from . import reverse_sort
|
||||||
import application
|
import application
|
||||||
actions = reverse_sort.reverse_sort([ ("audio", _(u"Audio tweet.")),
|
actions = reverse_sort.reverse_sort([ ("audio", _("Audio tweet.")),
|
||||||
("create_timeline", _(u"User timeline buffer created.")),
|
("create_timeline", _("User timeline buffer created.")),
|
||||||
("delete_timeline", _(u"Buffer destroied.")),
|
("delete_timeline", _("Buffer destroied.")),
|
||||||
("dm_received", _(u"Direct message received.")),
|
("dm_received", _("Direct message received.")),
|
||||||
("dm_sent", _(u"Direct message sent.")),
|
("dm_sent", _("Direct message sent.")),
|
||||||
("error", _(u"Error.")),
|
("error", _("Error.")),
|
||||||
("favourite", _(u"Tweet liked.")),
|
("favourite", _("Tweet liked.")),
|
||||||
("favourites_timeline_updated", _(u"Likes buffer updated.")),
|
("favourites_timeline_updated", _("Likes buffer updated.")),
|
||||||
("geo", _(u"Geotweet.")),
|
("geo", _("Geotweet.")),
|
||||||
("image", _("Tweet contains one or more images")),
|
("image", _("Tweet contains one or more images")),
|
||||||
("limit", _(u"Boundary reached.")),
|
("limit", _("Boundary reached.")),
|
||||||
("list_tweet", _(u"List updated.")),
|
("list_tweet", _("List updated.")),
|
||||||
("max_length", _(u"Too many characters.")),
|
("max_length", _("Too many characters.")),
|
||||||
("mention_received", _(u"Mention received.")),
|
("mention_received", _("Mention received.")),
|
||||||
("new_event", _(u"New event.")),
|
("new_event", _("New event.")),
|
||||||
("ready", _(u"{0} is ready.").format(application.name,)),
|
("ready", _("{0} is ready.").format(application.name,)),
|
||||||
("reply_send", _(u"Mention sent.")),
|
("reply_send", _("Mention sent.")),
|
||||||
("retweet_send", _(u"Tweet retweeted.")),
|
("retweet_send", _("Tweet retweeted.")),
|
||||||
("search_updated", _(u"Search buffer updated.")),
|
("search_updated", _("Search buffer updated.")),
|
||||||
("tweet_received", _(u"Tweet received.")),
|
("tweet_received", _("Tweet received.")),
|
||||||
("tweet_send", _(u"Tweet sent.")),
|
("tweet_send", _("Tweet sent.")),
|
||||||
("trends_updated", _(u"Trending topics buffer updated.")),
|
("trends_updated", _("Trending topics buffer updated.")),
|
||||||
("tweet_timeline", _(u"New tweet in user timeline buffer.")),
|
("tweet_timeline", _("New tweet in user timeline buffer.")),
|
||||||
("update_followers", _(u"New follower.")),
|
("update_followers", _("New follower.")),
|
||||||
("volume_changed", _(u"Volume changed."))])
|
("volume_changed", _("Volume changed."))])
|
||||||
|
@ -5,16 +5,16 @@ import widgetUtils
|
|||||||
class soundsTutorialDialog(widgetUtils.BaseDialog):
|
class soundsTutorialDialog(widgetUtils.BaseDialog):
|
||||||
def __init__(self, actions):
|
def __init__(self, actions):
|
||||||
super(soundsTutorialDialog, self).__init__(None, -1)
|
super(soundsTutorialDialog, self).__init__(None, -1)
|
||||||
self.SetTitle(_(u"Sounds tutorial"))
|
self.SetTitle(_("Sounds tutorial"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
label = wx.StaticText(panel, -1, _(u"Press enter to listen to the sound for the selected event"))
|
label = wx.StaticText(panel, -1, _("Press enter to listen to the sound for the selected event"))
|
||||||
self.items = wx.ListBox(panel, 1, choices=actions, style=wx.LB_SINGLE)
|
self.items = wx.ListBox(panel, 1, choices=actions, style=wx.LB_SINGLE)
|
||||||
self.items.SetSelection(0)
|
self.items.SetSelection(0)
|
||||||
listBox = wx.BoxSizer(wx.HORIZONTAL)
|
listBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
listBox.Add(label)
|
listBox.Add(label)
|
||||||
listBox.Add(self.items)
|
listBox.Add(self.items)
|
||||||
self.play = wx.Button(panel, 1, (u"Play"))
|
self.play = wx.Button(panel, 1, ("Play"))
|
||||||
self.play.SetDefault()
|
self.play.SetDefault()
|
||||||
close = wx.Button(panel, wx.ID_CANCEL)
|
close = wx.Button(panel, wx.ID_CANCEL)
|
||||||
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from . import spellchecker
|
from . import spellchecker
|
||||||
import platform
|
import platform
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import next
|
from builtins import next
|
||||||
from builtins import object
|
from builtins import object
|
||||||
import logging
|
import logging
|
||||||
@ -45,8 +45,8 @@ class spellChecker(object):
|
|||||||
def check(self):
|
def check(self):
|
||||||
try:
|
try:
|
||||||
next(self.checker)
|
next(self.checker)
|
||||||
textToSay = _(u"Misspelled word: %s") % (self.checker.word,)
|
textToSay = _("Misspelled word: %s") % (self.checker.word,)
|
||||||
context = u"... %s %s %s" % (self.checker.leading_context(10), self.checker.word, self.checker.trailing_context(10))
|
context = "... %s %s %s" % (self.checker.leading_context(10), self.checker.word, self.checker.trailing_context(10))
|
||||||
self.dialog.set_title(textToSay)
|
self.dialog.set_title(textToSay)
|
||||||
output.speak(textToSay)
|
output.speak(textToSay)
|
||||||
self.dialog.set_word_and_suggestions(word=self.checker.word, context=context, suggestions=self.checker.suggest())
|
self.dialog.set_word_and_suggestions(word=self.checker.word, context=context, suggestions=self.checker.suggest())
|
||||||
|
@ -23,25 +23,25 @@ class spellCheckerDialog(wx.Dialog):
|
|||||||
super(spellCheckerDialog, self).__init__(None, 1)
|
super(spellCheckerDialog, self).__init__(None, 1)
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
word = wx.StaticText(panel, -1, _(u"Misspelled word"))
|
word = wx.StaticText(panel, -1, _("Misspelled word"))
|
||||||
self.word = wx.TextCtrl(panel, -1)
|
self.word = wx.TextCtrl(panel, -1)
|
||||||
wordBox = wx.BoxSizer(wx.HORIZONTAL)
|
wordBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
wordBox.Add(word, 0, wx.ALL, 5)
|
wordBox.Add(word, 0, wx.ALL, 5)
|
||||||
wordBox.Add(self.word, 0, wx.ALL, 5)
|
wordBox.Add(self.word, 0, wx.ALL, 5)
|
||||||
context = wx.StaticText(panel, -1, _(u"Context"))
|
context = wx.StaticText(panel, -1, _("Context"))
|
||||||
self.context = wx.TextCtrl(panel, -1)
|
self.context = wx.TextCtrl(panel, -1)
|
||||||
contextBox = wx.BoxSizer(wx.HORIZONTAL)
|
contextBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
contextBox.Add(context, 0, wx.ALL, 5)
|
contextBox.Add(context, 0, wx.ALL, 5)
|
||||||
contextBox.Add(self.context, 0, wx.ALL, 5)
|
contextBox.Add(self.context, 0, wx.ALL, 5)
|
||||||
suggest = wx.StaticText(panel, -1, _(u"Suggestions"))
|
suggest = wx.StaticText(panel, -1, _("Suggestions"))
|
||||||
self.suggestions = wx.ListBox(panel, -1, choices=[], style=wx.LB_SINGLE)
|
self.suggestions = wx.ListBox(panel, -1, choices=[], style=wx.LB_SINGLE)
|
||||||
suggestionsBox = wx.BoxSizer(wx.HORIZONTAL)
|
suggestionsBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
suggestionsBox.Add(suggest, 0, wx.ALL, 5)
|
suggestionsBox.Add(suggest, 0, wx.ALL, 5)
|
||||||
suggestionsBox.Add(self.suggestions, 0, wx.ALL, 5)
|
suggestionsBox.Add(self.suggestions, 0, wx.ALL, 5)
|
||||||
self.ignore = wx.Button(panel, -1, _(u"Ignore"))
|
self.ignore = wx.Button(panel, -1, _("Ignore"))
|
||||||
self.ignoreAll = wx.Button(panel, -1, _(u"Ignore all"))
|
self.ignoreAll = wx.Button(panel, -1, _("Ignore all"))
|
||||||
self.replace = wx.Button(panel, -1, _(u"Replace"))
|
self.replace = wx.Button(panel, -1, _("Replace"))
|
||||||
self.replaceAll = wx.Button(panel, -1, _(u"Replace all"))
|
self.replaceAll = wx.Button(panel, -1, _("Replace all"))
|
||||||
close = wx.Button(panel, wx.ID_CANCEL)
|
close = wx.Button(panel, wx.ID_CANCEL)
|
||||||
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
btnBox.Add(self.ignore, 0, wx.ALL, 5)
|
btnBox.Add(self.ignore, 0, wx.ALL, 5)
|
||||||
@ -73,7 +73,7 @@ class spellCheckerDialog(wx.Dialog):
|
|||||||
return self.suggestions.GetStringSelection()
|
return self.suggestions.GetStringSelection()
|
||||||
|
|
||||||
def dict_not_found_error():
|
def dict_not_found_error():
|
||||||
wx.MessageDialog(None, _(u"An error has occurred. There are no dictionaries available for the selected language in {0}").format(application.name,), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
wx.MessageDialog(None, _("An error has occurred. There are no dictionaries available for the selected language in {0}").format(application.name,), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def finished():
|
def finished():
|
||||||
wx.MessageDialog(None, _(u"Spell check complete."), application.name, style=wx.OK).ShowModal()
|
wx.MessageDialog(None, _("Spell check complete."), application.name, style=wx.OK).ShowModal()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from . import completion, settings
|
from . import completion, settings
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import object
|
from builtins import object
|
||||||
import output
|
import output
|
||||||
from . import storage
|
from . import storage
|
||||||
@ -19,7 +19,7 @@ class autocompletionUsers(object):
|
|||||||
try:
|
try:
|
||||||
pattern = text.split()[-1]
|
pattern = text.split()[-1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
output.speak(_(u"You have to start writing"))
|
output.speak(_("You have to start writing"))
|
||||||
return
|
return
|
||||||
if pattern.startswith("@") == True:
|
if pattern.startswith("@") == True:
|
||||||
menu = wx_menu.menu(self.window.text, pattern[1:], mode=mode)
|
menu = wx_menu.menu(self.window.text, pattern[1:], mode=mode)
|
||||||
@ -29,15 +29,15 @@ class autocompletionUsers(object):
|
|||||||
self.window.popup_menu(menu)
|
self.window.popup_menu(menu)
|
||||||
menu.destroy()
|
menu.destroy()
|
||||||
else:
|
else:
|
||||||
output.speak(_(u"There are no results in your users database"))
|
output.speak(_("There are no results in your users database"))
|
||||||
else:
|
else:
|
||||||
output.speak(_(u"Autocompletion only works for users."))
|
output.speak(_("Autocompletion only works for users."))
|
||||||
elif mode == "dm":
|
elif mode == "dm":
|
||||||
text = self.window.get_user()
|
text = self.window.get_user()
|
||||||
try:
|
try:
|
||||||
pattern = text.split()[-1]
|
pattern = text.split()[-1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
output.speak(_(u"You have to start writing"))
|
output.speak(_("You have to start writing"))
|
||||||
return
|
return
|
||||||
menu = wx_menu.menu(self.window.cb, pattern, mode=mode)
|
menu = wx_menu.menu(self.window.cb, pattern, mode=mode)
|
||||||
users = self.db.get_users(pattern)
|
users = self.db.get_users(pattern)
|
||||||
@ -46,4 +46,4 @@ class autocompletionUsers(object):
|
|||||||
self.window.popup_menu(menu)
|
self.window.popup_menu(menu)
|
||||||
menu.destroy()
|
menu.destroy()
|
||||||
else:
|
else:
|
||||||
output.speak(_(u"There are no results in your users database"))
|
output.speak(_("There are no results in your users database"))
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from builtins import object
|
from builtins import object
|
||||||
from . import storage
|
from . import storage
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from builtins import object
|
from builtins import object
|
||||||
from . import storage
|
from . import storage
|
||||||
@ -25,7 +25,7 @@ class autocompletionSettings(object):
|
|||||||
def add_users_to_database(self):
|
def add_users_to_database(self):
|
||||||
self.config["mysc"]["save_friends_in_autocompletion_db"] = self.dialog.get("friends_buffer")
|
self.config["mysc"]["save_friends_in_autocompletion_db"] = self.dialog.get("friends_buffer")
|
||||||
self.config["mysc"]["save_followers_in_autocompletion_db"] = self.dialog.get("followers_buffer")
|
self.config["mysc"]["save_followers_in_autocompletion_db"] = self.dialog.get("followers_buffer")
|
||||||
output.speak(_(u"Updating database... You can close this window now. A message will tell you when the process finishes."))
|
output.speak(_("Updating database... You can close this window now. A message will tell you when the process finishes."))
|
||||||
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"])
|
||||||
|
@ -5,15 +5,15 @@ 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=_("Manage Autocompletion database"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
label = wx.StaticText(panel, -1, _(u"Editing {0} users database").format(application.name,))
|
label = wx.StaticText(panel, -1, _("Editing {0} users database").format(application.name,))
|
||||||
self.users = widgets.list(panel, _(u"Username"), _(u"Name"), style=wx.LC_REPORT)
|
self.users = widgets.list(panel, _("Username"), _("Name"), style=wx.LC_REPORT)
|
||||||
sizer.Add(label, 0, wx.ALL, 5)
|
sizer.Add(label, 0, wx.ALL, 5)
|
||||||
sizer.Add(self.users.list, 0, wx.ALL, 5)
|
sizer.Add(self.users.list, 0, wx.ALL, 5)
|
||||||
self.add = wx.Button(panel, -1, _(u"Add user"))
|
self.add = wx.Button(panel, -1, _("Add user"))
|
||||||
self.remove = wx.Button(panel, -1, _(u"Remove user"))
|
self.remove = wx.Button(panel, -1, _("Remove user"))
|
||||||
optionsBox = wx.BoxSizer(wx.HORIZONTAL)
|
optionsBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
optionsBox.Add(self.add, 0, wx.ALL, 5)
|
optionsBox.Add(self.add, 0, wx.ALL, 5)
|
||||||
optionsBox.Add(self.remove, 0, wx.ALL, 5)
|
optionsBox.Add(self.remove, 0, wx.ALL, 5)
|
||||||
@ -34,10 +34,10 @@ class autocompletionManageDialog(widgetUtils.BaseDialog):
|
|||||||
|
|
||||||
def get_user(self):
|
def get_user(self):
|
||||||
usr = False
|
usr = False
|
||||||
userDlg = wx.TextEntryDialog(None, _(u"Twitter username"), _(u"Add user to database"))
|
userDlg = wx.TextEntryDialog(None, _("Twitter username"), _("Add user to database"))
|
||||||
if userDlg.ShowModal() == wx.ID_OK:
|
if userDlg.ShowModal() == wx.ID_OK:
|
||||||
usr = userDlg.GetValue()
|
usr = userDlg.GetValue()
|
||||||
return usr
|
return usr
|
||||||
|
|
||||||
def show_invalid_user_error(self):
|
def show_invalid_user_error(self):
|
||||||
wx.MessageDialog(None, _(u"The user does not exist"), _(u"Error!"), wx.ICON_ERROR).ShowModal()
|
wx.MessageDialog(None, _("The user does not exist"), _("Error!"), wx.ICON_ERROR).ShowModal()
|
@ -5,14 +5,14 @@ import application
|
|||||||
|
|
||||||
class autocompletionSettingsDialog(widgetUtils.BaseDialog):
|
class autocompletionSettingsDialog(widgetUtils.BaseDialog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(autocompletionSettingsDialog, self).__init__(parent=None, id=-1, title=_(u"Autocomplete users' settings"))
|
super(autocompletionSettingsDialog, self).__init__(parent=None, id=-1, title=_("Autocomplete users' settings"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.followers_buffer = wx.CheckBox(panel, -1, _(u"Add users from followers buffer"))
|
self.followers_buffer = wx.CheckBox(panel, -1, _("Add users from followers buffer"))
|
||||||
self.friends_buffer = wx.CheckBox(panel, -1, _(u"Add users from friends buffer"))
|
self.friends_buffer = wx.CheckBox(panel, -1, _("Add users from friends buffer"))
|
||||||
sizer.Add(self.followers_buffer, 0, wx.ALL, 5)
|
sizer.Add(self.followers_buffer, 0, wx.ALL, 5)
|
||||||
sizer.Add(self.friends_buffer, 0, wx.ALL, 5)
|
sizer.Add(self.friends_buffer, 0, wx.ALL, 5)
|
||||||
self.viewList = wx.Button(panel, -1, _(u"Manage database..."))
|
self.viewList = wx.Button(panel, -1, _("Manage database..."))
|
||||||
sizer.Add(self.viewList, 0, wx.ALL, 5)
|
sizer.Add(self.viewList, 0, wx.ALL, 5)
|
||||||
ok = wx.Button(panel, wx.ID_OK)
|
ok = wx.Button(panel, wx.ID_OK)
|
||||||
cancel = wx.Button(panel, wx.ID_CANCEL)
|
cancel = wx.Button(panel, wx.ID_CANCEL)
|
||||||
@ -24,4 +24,4 @@ class autocompletionSettingsDialog(widgetUtils.BaseDialog):
|
|||||||
self.SetClientSize(sizer.CalcMin())
|
self.SetClientSize(sizer.CalcMin())
|
||||||
|
|
||||||
def show_success_dialog():
|
def show_success_dialog():
|
||||||
wx.MessageDialog(None, _(u"{0}'s database of users has been updated.").format(application.name,), _(u"Done"), wx.OK).ShowModal()
|
wx.MessageDialog(None, _("{0}'s database of users has been updated.").format(application.name,), _("Done"), wx.OK).ShowModal()
|
@ -3,7 +3,7 @@
|
|||||||
from builtins import object
|
from builtins import object
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
translatable_langs = [_(u"Detect automatically"), _(u"Danish"), _(u"Dutch"), _(u"English"), _(u"Finnish"), _(u"French"), _(u"German"), _(u"Hungarian"), _(u"Korean"), _(u"Italian"), _(u"Japanese"), _(u"Polish"), _(u"Portuguese"), _(u"Russian"), _(u"Spanish"), _(u"Turkish")]
|
translatable_langs = [_("Detect automatically"), _("Danish"), _("Dutch"), _("English"), _("Finnish"), _("French"), _("German"), _("Hungarian"), _("Korean"), _("Italian"), _("Japanese"), _("Polish"), _("Portuguese"), _("Russian"), _("Spanish"), _("Turkish")]
|
||||||
short_langs = ["", "da", "du", "en", "fi", "fr", "de", "hu", "ko", "it", "ja", "pl", "pt", "ru", "es", "tr"]
|
short_langs = ["", "da", "du", "en", "fi", "fr", "de", "hu", "ko", "it", "ja", "pl", "pt", "ru", "es", "tr"]
|
||||||
OcrLangs = ["", "dan", "dut", "eng", "fin", "fre", "ger", "hun", "kor", "ita", "jpn", "pol", "por", "rus", "spa", "tur"]
|
OcrLangs = ["", "dan", "dut", "eng", "fin", "fre", "ger", "hun", "kor", "ita", "jpn", "pol", "por", "rus", "spa", "tur"]
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from . import OCRSpace
|
from . import OCRSpace
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from . import translator
|
from . import translator
|
||||||
import platform
|
import platform
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
|
@ -8,102 +8,102 @@ def translate(text="", source="auto", target="en"):
|
|||||||
|
|
||||||
|
|
||||||
languages = {
|
languages = {
|
||||||
"af": _(u"Afrikaans"),
|
"af": _("Afrikaans"),
|
||||||
"sq": _(u"Albanian"),
|
"sq": _("Albanian"),
|
||||||
"am": _(u"Amharic"),
|
"am": _("Amharic"),
|
||||||
"ar": _(u"Arabic"),
|
"ar": _("Arabic"),
|
||||||
"hy": _(u"Armenian"),
|
"hy": _("Armenian"),
|
||||||
"az": _(u"Azerbaijani"),
|
"az": _("Azerbaijani"),
|
||||||
"eu": _(u"Basque"),
|
"eu": _("Basque"),
|
||||||
"be": _(u"Belarusian"),
|
"be": _("Belarusian"),
|
||||||
"bn": _(u"Bengali"),
|
"bn": _("Bengali"),
|
||||||
"bh": _(u"Bihari"),
|
"bh": _("Bihari"),
|
||||||
"bg": _(u"Bulgarian"),
|
"bg": _("Bulgarian"),
|
||||||
"my": _(u"Burmese"),
|
"my": _("Burmese"),
|
||||||
"ca": _(u"Catalan"),
|
"ca": _("Catalan"),
|
||||||
"chr": _(u"Cherokee"),
|
"chr": _("Cherokee"),
|
||||||
"zh": _(u"Chinese"),
|
"zh": _("Chinese"),
|
||||||
"zh-CN": _(u"Chinese_simplified"),
|
"zh-CN": _("Chinese_simplified"),
|
||||||
"zh-TW": _(u"Chinese_traditional"),
|
"zh-TW": _("Chinese_traditional"),
|
||||||
"hr": _(u"Croatian"),
|
"hr": _("Croatian"),
|
||||||
"cs": _(u"Czech"),
|
"cs": _("Czech"),
|
||||||
"da": _(u"Danish"),
|
"da": _("Danish"),
|
||||||
"dv": _(u"Dhivehi"),
|
"dv": _("Dhivehi"),
|
||||||
"nl": _(u"Dutch"),
|
"nl": _("Dutch"),
|
||||||
"en": _(u"English"),
|
"en": _("English"),
|
||||||
"eo": _(u"Esperanto"),
|
"eo": _("Esperanto"),
|
||||||
"et": _(u"Estonian"),
|
"et": _("Estonian"),
|
||||||
"tl": _(u"Filipino"),
|
"tl": _("Filipino"),
|
||||||
"fi": _(u"Finnish"),
|
"fi": _("Finnish"),
|
||||||
"fr": _(u"French"),
|
"fr": _("French"),
|
||||||
"gl": _(u"Galician"),
|
"gl": _("Galician"),
|
||||||
"ka": _(u"Georgian"),
|
"ka": _("Georgian"),
|
||||||
"de": _(u"German"),
|
"de": _("German"),
|
||||||
"el": _(u"Greek"),
|
"el": _("Greek"),
|
||||||
"gn": _(u"Guarani"),
|
"gn": _("Guarani"),
|
||||||
"gu": _(u"Gujarati"),
|
"gu": _("Gujarati"),
|
||||||
"iw": _(u"Hebrew"),
|
"iw": _("Hebrew"),
|
||||||
"hi": _(u"Hindi"),
|
"hi": _("Hindi"),
|
||||||
"hu": _(u"Hungarian"),
|
"hu": _("Hungarian"),
|
||||||
"is": _(u"Icelandic"),
|
"is": _("Icelandic"),
|
||||||
"id": _(u"Indonesian"),
|
"id": _("Indonesian"),
|
||||||
"iu": _(u"Inuktitut"),
|
"iu": _("Inuktitut"),
|
||||||
"ga": _(u"Irish"),
|
"ga": _("Irish"),
|
||||||
"it": _(u"Italian"),
|
"it": _("Italian"),
|
||||||
"ja": _(u"Japanese"),
|
"ja": _("Japanese"),
|
||||||
"kn": _(u"Kannada"),
|
"kn": _("Kannada"),
|
||||||
"kk": _(u"Kazakh"),
|
"kk": _("Kazakh"),
|
||||||
"km": _(u"Khmer"),
|
"km": _("Khmer"),
|
||||||
"ko": _(u"Korean"),
|
"ko": _("Korean"),
|
||||||
"ku": _(u"Kurdish"),
|
"ku": _("Kurdish"),
|
||||||
"ky": _(u"Kyrgyz"),
|
"ky": _("Kyrgyz"),
|
||||||
"lo": _(u"Laothian"),
|
"lo": _("Laothian"),
|
||||||
"lv": _(u"Latvian"),
|
"lv": _("Latvian"),
|
||||||
"lt": _(u"Lithuanian"),
|
"lt": _("Lithuanian"),
|
||||||
"mk": _(u"Macedonian"),
|
"mk": _("Macedonian"),
|
||||||
"ms": _(u"Malay"),
|
"ms": _("Malay"),
|
||||||
"ml": _(u"Malayalam"),
|
"ml": _("Malayalam"),
|
||||||
"mt": _(u"Maltese"),
|
"mt": _("Maltese"),
|
||||||
"mr": _(u"Marathi"),
|
"mr": _("Marathi"),
|
||||||
"mn": _(u"Mongolian"),
|
"mn": _("Mongolian"),
|
||||||
"ne": _(u"Nepali"),
|
"ne": _("Nepali"),
|
||||||
"no": _(u"Norwegian"),
|
"no": _("Norwegian"),
|
||||||
"or": _(u"Oriya"),
|
"or": _("Oriya"),
|
||||||
"ps": _(u"Pashto"),
|
"ps": _("Pashto"),
|
||||||
"fa": _(u"Persian"),
|
"fa": _("Persian"),
|
||||||
"pl": _(u"Polish"),
|
"pl": _("Polish"),
|
||||||
"pt-PT": _(u"Portuguese"),
|
"pt-PT": _("Portuguese"),
|
||||||
"pa": _(u"Punjabi"),
|
"pa": _("Punjabi"),
|
||||||
"ro": _(u"Romanian"),
|
"ro": _("Romanian"),
|
||||||
"ru": _(u"Russian"),
|
"ru": _("Russian"),
|
||||||
"sa": _(u"Sanskrit"),
|
"sa": _("Sanskrit"),
|
||||||
"sr": _(u"Serbian"),
|
"sr": _("Serbian"),
|
||||||
"sd": _(u"Sindhi"),
|
"sd": _("Sindhi"),
|
||||||
"si": _(u"Sinhalese"),
|
"si": _("Sinhalese"),
|
||||||
"sk": _(u"Slovak"),
|
"sk": _("Slovak"),
|
||||||
"sl": _(u"Slovenian"),
|
"sl": _("Slovenian"),
|
||||||
"es": _(u"Spanish"),
|
"es": _("Spanish"),
|
||||||
"sw": _(u"Swahili"),
|
"sw": _("Swahili"),
|
||||||
"sv": _(u"Swedish"),
|
"sv": _("Swedish"),
|
||||||
"tg": _(u"Tajik"),
|
"tg": _("Tajik"),
|
||||||
"ta": _(u"Tamil"),
|
"ta": _("Tamil"),
|
||||||
"tl": _(u"Tagalog"),
|
"tl": _("Tagalog"),
|
||||||
"te": _(u"Telugu"),
|
"te": _("Telugu"),
|
||||||
"th": _(u"Thai"),
|
"th": _("Thai"),
|
||||||
"bo": _(u"Tibetan"),
|
"bo": _("Tibetan"),
|
||||||
"tr": _(u"Turkish"),
|
"tr": _("Turkish"),
|
||||||
"uk": _(u"Ukrainian"),
|
"uk": _("Ukrainian"),
|
||||||
"ur": _(u"Urdu"),
|
"ur": _("Urdu"),
|
||||||
"uz": _(u"Uzbek"),
|
"uz": _("Uzbek"),
|
||||||
"ug": _(u"Uighur"),
|
"ug": _("Uighur"),
|
||||||
"vi": _(u"Vietnamese"),
|
"vi": _("Vietnamese"),
|
||||||
"cy": _(u"Welsh"),
|
"cy": _("Welsh"),
|
||||||
"yi": _(u"Yiddish")
|
"yi": _("Yiddish")
|
||||||
}
|
}
|
||||||
|
|
||||||
def available_languages():
|
def available_languages():
|
||||||
l = list(languages.keys())
|
l = list(languages.keys())
|
||||||
d = list(languages.values())
|
d = list(languages.values())
|
||||||
l.insert(0, '')
|
l.insert(0, '')
|
||||||
d.insert(0, _(u"autodetect"))
|
d.insert(0, _("autodetect"))
|
||||||
return sorted(zip(l, d))
|
return sorted(zip(l, d))
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
############################################################
|
############################################################
|
||||||
from __future__ import absolute_import
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
############################################################
|
############################################################
|
||||||
# Copyright (c) 2013, 2014 Manuel Eduardo Cortéz Vallejo <manuel@manuelcortez.net>
|
# Copyright (c) 2013, 2014 Manuel Eduardo Cortéz Vallejo <manuel@manuelcortez.net>
|
||||||
@ -41,13 +41,13 @@ from wxUI.dialogs import baseDialog
|
|||||||
|
|
||||||
class translateDialog(baseDialog.BaseWXDialog):
|
class translateDialog(baseDialog.BaseWXDialog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(translateDialog, self).__init__(None, -1, title=_(u"Translate message"))
|
super(translateDialog, self).__init__(None, -1, title=_("Translate message"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
staticSource = wx.StaticText(panel, -1, _(u"Source language"))
|
staticSource = wx.StaticText(panel, -1, _("Source language"))
|
||||||
self.source_lang = wx.ComboBox(panel, -1, choices=[x[1] for x in translator.available_languages()], style = wx.CB_READONLY)
|
self.source_lang = wx.ComboBox(panel, -1, choices=[x[1] for x in translator.available_languages()], style = wx.CB_READONLY)
|
||||||
self.source_lang.SetFocus()
|
self.source_lang.SetFocus()
|
||||||
staticDest = wx.StaticText(panel, -1, _(u"Target language"))
|
staticDest = wx.StaticText(panel, -1, _("Target language"))
|
||||||
self.source_lang.SetSelection(0)
|
self.source_lang.SetSelection(0)
|
||||||
self.dest_lang = wx.ComboBox(panel, -1, choices=[x[1] for x in translator.available_languages()], style = wx.CB_READONLY)
|
self.dest_lang = wx.ComboBox(panel, -1, choices=[x[1] for x in translator.available_languages()], style = wx.CB_READONLY)
|
||||||
listSizer = wx.BoxSizer(wx.HORIZONTAL)
|
listSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" This module contains some bugfixes for packages used in TWBlue."""
|
""" This module contains some bugfixes for packages used in TWBlue."""
|
||||||
from __future__ import absolute_import
|
|
||||||
import sys
|
import sys
|
||||||
from . import fix_arrow # A few new locales for Three languages in arrow.
|
from . import fix_arrow # A few new locales for Three languages in arrow.
|
||||||
from . import fix_urllib3_warnings # Avoiding some SSL warnings related to Twython.
|
from . import fix_urllib3_warnings # Avoiding some SSL warnings related to Twython.
|
||||||
|
@ -5,7 +5,7 @@ import requests.sessions
|
|||||||
orig_session_init=requests.sessions.Session.__init__
|
orig_session_init=requests.sessions.Session.__init__
|
||||||
|
|
||||||
def patched_where():
|
def patched_where():
|
||||||
return paths.app_path(u"cacert.pem")
|
return paths.app_path("cacert.pem")
|
||||||
|
|
||||||
def fix(frozen):
|
def fix(frozen):
|
||||||
if frozen==True:
|
if frozen==True:
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
############################################################
|
############################################################
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import object
|
from builtins import object
|
||||||
import keys
|
import keys
|
||||||
import wx
|
import wx
|
||||||
@ -29,9 +29,9 @@ from . import constants
|
|||||||
class reportBug(object):
|
class reportBug(object):
|
||||||
def __init__(self, user_name):
|
def __init__(self, user_name):
|
||||||
self.user_name = user_name
|
self.user_name = user_name
|
||||||
self.categories = [_(u"General")]
|
self.categories = [_("General")]
|
||||||
self.reproducibilities = [_(u"always"), _(u"sometimes"), _(u"random"), _(u"have not tried"), _(u"unable to duplicate")]
|
self.reproducibilities = [_("always"), _("sometimes"), _("random"), _("have not tried"), _("unable to duplicate")]
|
||||||
self.severities = [_(u"block"), _(u"crash"), _(u"major"), _(u"minor"), _(u"tweak"), _(u"text"), _(u"trivial"), _(u"feature")]
|
self.severities = [_("block"), _("crash"), _("major"), _("minor"), _("tweak"), _("text"), _("trivial"), _("feature")]
|
||||||
self.dialog = wx_ui.reportBugDialog(self.categories, self.reproducibilities, self.severities)
|
self.dialog = wx_ui.reportBugDialog(self.categories, self.reproducibilities, self.severities)
|
||||||
widgetUtils.connect_event(self.dialog.ok, widgetUtils.BUTTON_PRESSED, self.send)
|
widgetUtils.connect_event(self.dialog.ok, widgetUtils.BUTTON_PRESSED, self.send)
|
||||||
self.dialog.get_response()
|
self.dialog.get_response()
|
||||||
|
@ -22,10 +22,10 @@ import application
|
|||||||
class reportBugDialog(widgetUtils.BaseDialog):
|
class reportBugDialog(widgetUtils.BaseDialog):
|
||||||
def __init__(self, categories, reproducibilities, severities):
|
def __init__(self, categories, reproducibilities, severities):
|
||||||
super(reportBugDialog, self).__init__(parent=None, id=wx.NewId())
|
super(reportBugDialog, self).__init__(parent=None, id=wx.NewId())
|
||||||
self.SetTitle(_(u"Report an error"))
|
self.SetTitle(_("Report an error"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
categoryLabel = wx.StaticText(panel, -1, _(u"Select a category"), size=wx.DefaultSize)
|
categoryLabel = wx.StaticText(panel, -1, _("Select a category"), size=wx.DefaultSize)
|
||||||
self.category = wx.ComboBox(panel, -1, choices=categories, style=wx.CB_READONLY)
|
self.category = wx.ComboBox(panel, -1, choices=categories, style=wx.CB_READONLY)
|
||||||
self.category.SetSelection(0)
|
self.category.SetSelection(0)
|
||||||
categoryB = wx.BoxSizer(wx.HORIZONTAL)
|
categoryB = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
@ -33,7 +33,7 @@ class reportBugDialog(widgetUtils.BaseDialog):
|
|||||||
categoryB.Add(self.category, 0, wx.ALL, 5)
|
categoryB.Add(self.category, 0, wx.ALL, 5)
|
||||||
self.category.SetFocus()
|
self.category.SetFocus()
|
||||||
sizer.Add(categoryB, 0, wx.ALL, 5)
|
sizer.Add(categoryB, 0, wx.ALL, 5)
|
||||||
summaryLabel = wx.StaticText(panel, -1, _(u"Briefly describe what happened. You will be able to thoroughly explain it later"), size=wx.DefaultSize)
|
summaryLabel = wx.StaticText(panel, -1, _("Briefly describe what happened. You will be able to thoroughly explain it later"), size=wx.DefaultSize)
|
||||||
self.summary = wx.TextCtrl(panel, -1)
|
self.summary = wx.TextCtrl(panel, -1)
|
||||||
dc = wx.WindowDC(self.summary)
|
dc = wx.WindowDC(self.summary)
|
||||||
dc.SetFont(self.summary.GetFont())
|
dc.SetFont(self.summary.GetFont())
|
||||||
@ -42,7 +42,7 @@ class reportBugDialog(widgetUtils.BaseDialog):
|
|||||||
summaryB.Add(summaryLabel, 0, wx.ALL, 5)
|
summaryB.Add(summaryLabel, 0, wx.ALL, 5)
|
||||||
summaryB.Add(self.summary, 0, wx.ALL, 5)
|
summaryB.Add(self.summary, 0, wx.ALL, 5)
|
||||||
sizer.Add(summaryB, 0, wx.ALL, 5)
|
sizer.Add(summaryB, 0, wx.ALL, 5)
|
||||||
descriptionLabel = wx.StaticText(panel, -1, _(u"Here, you can describe the bug in detail"), size=wx.DefaultSize)
|
descriptionLabel = wx.StaticText(panel, -1, _("Here, you can describe the bug in detail"), size=wx.DefaultSize)
|
||||||
self.description = wx.TextCtrl(panel, -1, style=wx.TE_MULTILINE)
|
self.description = wx.TextCtrl(panel, -1, style=wx.TE_MULTILINE)
|
||||||
dc = wx.WindowDC(self.description)
|
dc = wx.WindowDC(self.description)
|
||||||
dc.SetFont(self.description.GetFont())
|
dc.SetFont(self.description.GetFont())
|
||||||
@ -52,26 +52,26 @@ class reportBugDialog(widgetUtils.BaseDialog):
|
|||||||
descBox.Add(descriptionLabel, 0, wx.ALL, 5)
|
descBox.Add(descriptionLabel, 0, wx.ALL, 5)
|
||||||
descBox.Add(self.description, 0, wx.ALL, 5)
|
descBox.Add(self.description, 0, wx.ALL, 5)
|
||||||
sizer.Add(descBox, 0, wx.ALL, 5)
|
sizer.Add(descBox, 0, wx.ALL, 5)
|
||||||
reproducibilityLabel = wx.StaticText(panel, -1, _(u"how often does this bug happen?"), size=wx.DefaultSize)
|
reproducibilityLabel = wx.StaticText(panel, -1, _("how often does this bug happen?"), size=wx.DefaultSize)
|
||||||
self.reproducibility = wx.ComboBox(panel, -1, choices=reproducibilities, style=wx.CB_READONLY)
|
self.reproducibility = wx.ComboBox(panel, -1, choices=reproducibilities, style=wx.CB_READONLY)
|
||||||
self.reproducibility.SetSelection(3)
|
self.reproducibility.SetSelection(3)
|
||||||
reprB = wx.BoxSizer(wx.HORIZONTAL)
|
reprB = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
reprB.Add(reproducibilityLabel, 0, wx.ALL, 5)
|
reprB.Add(reproducibilityLabel, 0, wx.ALL, 5)
|
||||||
reprB.Add(self.reproducibility, 0, wx.ALL, 5)
|
reprB.Add(self.reproducibility, 0, wx.ALL, 5)
|
||||||
sizer.Add(reprB, 0, wx.ALL, 5)
|
sizer.Add(reprB, 0, wx.ALL, 5)
|
||||||
severityLabel = wx.StaticText(panel, -1, _(u"Select the importance that you think this bug has"))
|
severityLabel = wx.StaticText(panel, -1, _("Select the importance that you think this bug has"))
|
||||||
self.severity = wx.ComboBox(panel, -1, choices=severities, style=wx.CB_READONLY)
|
self.severity = wx.ComboBox(panel, -1, choices=severities, style=wx.CB_READONLY)
|
||||||
self.severity.SetSelection(3)
|
self.severity.SetSelection(3)
|
||||||
severityB = wx.BoxSizer(wx.HORIZONTAL)
|
severityB = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
severityB.Add(severityLabel, 0, wx.ALL, 5)
|
severityB.Add(severityLabel, 0, wx.ALL, 5)
|
||||||
severityB.Add(self.severity, 0, wx.ALL, 5)
|
severityB.Add(self.severity, 0, wx.ALL, 5)
|
||||||
sizer.Add(severityB, 0, wx.ALL, 5)
|
sizer.Add(severityB, 0, wx.ALL, 5)
|
||||||
self.agree = wx.CheckBox(panel, -1, _(u"I know that the {0} bug system will get my Twitter username to contact me and fix the bug quickly").format(application.name,))
|
self.agree = wx.CheckBox(panel, -1, _("I know that the {0} bug system will get my Twitter username to contact me and fix the bug quickly").format(application.name,))
|
||||||
self.agree.SetValue(False)
|
self.agree.SetValue(False)
|
||||||
sizer.Add(self.agree, 0, wx.ALL, 5)
|
sizer.Add(self.agree, 0, wx.ALL, 5)
|
||||||
self.ok = wx.Button(panel, wx.ID_OK, _(u"Send report"))
|
self.ok = wx.Button(panel, wx.ID_OK, _("Send report"))
|
||||||
self.ok.SetDefault()
|
self.ok.SetDefault()
|
||||||
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Cancel"))
|
cancel = wx.Button(panel, wx.ID_CANCEL, _("Cancel"))
|
||||||
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
btnBox.Add(self.ok, 0, wx.ALL, 5)
|
btnBox.Add(self.ok, 0, wx.ALL, 5)
|
||||||
btnBox.Add(cancel, 0, wx.ALL, 5)
|
btnBox.Add(cancel, 0, wx.ALL, 5)
|
||||||
@ -80,15 +80,15 @@ class reportBugDialog(widgetUtils.BaseDialog):
|
|||||||
self.SetClientSize(sizer.CalcMin())
|
self.SetClientSize(sizer.CalcMin())
|
||||||
|
|
||||||
def no_filled(self):
|
def no_filled(self):
|
||||||
wx.MessageDialog(self, _(u"You must fill out both fields"), _(u"Error"), wx.OK|wx.ICON_ERROR).ShowModal()
|
wx.MessageDialog(self, _("You must fill out both fields"), _("Error"), wx.OK|wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def no_checkbox(self):
|
def no_checkbox(self):
|
||||||
wx.MessageDialog(self, _(u"You need to mark the checkbox to provide us your twitter username to contact you if it is necessary."), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
wx.MessageDialog(self, _("You need to mark the checkbox to provide us your twitter username to contact you if it is necessary."), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def success(self, id):
|
def success(self, id):
|
||||||
wx.MessageDialog(self, _(u"Thanks for reporting this bug! In future versions, you may be able to find it in the changes list. You've reported the bug number %i") % (id), _(u"reported"), wx.OK).ShowModal()
|
wx.MessageDialog(self, _("Thanks for reporting this bug! In future versions, you may be able to find it in the changes list. You've reported the bug number %i") % (id), _("reported"), wx.OK).ShowModal()
|
||||||
self.EndModal(wx.ID_OK)
|
self.EndModal(wx.ID_OK)
|
||||||
|
|
||||||
def error(self):
|
def error(self):
|
||||||
wx.MessageDialog(self, _(u"Something unexpected occurred while trying to report the bug. Please, try again later"), _(u"Error while reporting"), wx.ICON_ERROR|wx.OK).ShowModal()
|
wx.MessageDialog(self, _("Something unexpected occurred while trying to report the bug. Please, try again later"), _("Error while reporting"), wx.ICON_ERROR|wx.OK).ShowModal()
|
||||||
self.EndModal(wx.ID_CANCEL)
|
self.EndModal(wx.ID_CANCEL)
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from .main import KeyboardHandler, KeyboardHandlerError
|
from .main import KeyboardHandler, KeyboardHandlerError
|
||||||
#from wx_handler import WXKeyboardHandler
|
#from wx_handler import WXKeyboardHandler
|
||||||
__all__ = ["KeyboardHandler", "KeyboardHandlerError", "WXKeyboardHandler", "WXPanelKeyboardHandler"]
|
__all__ = ["KeyboardHandler", "KeyboardHandlerError", "WXKeyboardHandler", "WXPanelKeyboardHandler"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
import platform
|
import platform
|
||||||
if platform.system() == 'Linux':
|
if platform.system() == 'Linux':
|
||||||
from .linux import LinuxKeyboardHandler as GlobalKeyboardHandler
|
from .linux import LinuxKeyboardHandler as GlobalKeyboardHandler
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
from builtins import chr
|
from builtins import chr
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from AppKit import *
|
from AppKit import *
|
||||||
from PyObjCTools import AppHelper
|
from PyObjCTools import AppHelper
|
||||||
@ -53,6 +53,6 @@ class KeyboardCapturingNSApplication(NSApplication):
|
|||||||
def sendEvent_(self, theEvent):
|
def sendEvent_(self, theEvent):
|
||||||
if theEvent.type() == NSSystemDefined and theEvent.subtype() == kEventHotKeyPressedSubtype:
|
if theEvent.type() == NSSystemDefined and theEvent.subtype() == kEventHotKeyPressedSubtype:
|
||||||
self.activateIgnoringOtherApps_(True)
|
self.activateIgnoringOtherApps_(True)
|
||||||
NSRunAlertPanel(u'Hot Key Pressed', u'Hot Key Pressed', None, None, None)
|
NSRunAlertPanel('Hot Key Pressed', 'Hot Key Pressed', None, None, None)
|
||||||
super(NSApplication, self).sendEvent_(theEvent)
|
super(NSApplication, self).sendEvent_(theEvent)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
import win32api
|
import win32api
|
||||||
import win32con
|
import win32con
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from __future__ import print_function
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import chr
|
from builtins import chr
|
||||||
import functools
|
import functools
|
||||||
import wx
|
import wx
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from .keystrokeEditor import KeystrokeEditor
|
from .keystrokeEditor import KeystrokeEditor
|
@ -1,56 +1,56 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
actions = {
|
actions = {
|
||||||
"up": _(u"Go up in the current buffer"),
|
"up": _("Go up in the current buffer"),
|
||||||
"down": _(u"Go down in the current buffer"),
|
"down": _("Go down in the current buffer"),
|
||||||
"left": _(u"Go to the previous buffer"),
|
"left": _("Go to the previous buffer"),
|
||||||
"right": _(u"Go to the next buffer"),
|
"right": _("Go to the next buffer"),
|
||||||
"next_account": _(u"Focus the next session"),
|
"next_account": _("Focus the next session"),
|
||||||
"previous_account": _(u"Focus the previous session"),
|
"previous_account": _("Focus the previous session"),
|
||||||
"show_hide": _(u"Show or hide the GUI"),
|
"show_hide": _("Show or hide the GUI"),
|
||||||
"post_tweet": _(u"New tweet"),
|
"post_tweet": _("New tweet"),
|
||||||
"post_reply": _(u"Reply"),
|
"post_reply": _("Reply"),
|
||||||
"post_retweet": _(u"Retweet"),
|
"post_retweet": _("Retweet"),
|
||||||
"send_dm": _(u"Send direct message"),
|
"send_dm": _("Send direct message"),
|
||||||
"add_to_favourites": _(u"Like a tweet"),
|
"add_to_favourites": _("Like a tweet"),
|
||||||
"remove_from_favourites": _(u"Unlike a tweet"),
|
"remove_from_favourites": _("Unlike a tweet"),
|
||||||
"follow": _(u"Open the user actions dialogue"),
|
"follow": _("Open the user actions dialogue"),
|
||||||
"user_details": _(u"See user details"),
|
"user_details": _("See user details"),
|
||||||
"view_item": _(u"Show tweet"),
|
"view_item": _("Show tweet"),
|
||||||
"exit": _(u"Quit"),
|
"exit": _("Quit"),
|
||||||
"open_timeline": _(u"Open user timeline"),
|
"open_timeline": _("Open user timeline"),
|
||||||
"remove_buffer": _(u"Destroy buffer"),
|
"remove_buffer": _("Destroy buffer"),
|
||||||
"interact": _(u"Interact with the currently focused tweet."),
|
"interact": _("Interact with the currently focused tweet."),
|
||||||
"url": _(u"Open URL"),
|
"url": _("Open URL"),
|
||||||
"volume_up": _(u"Increase volume by 5%"),
|
"volume_up": _("Increase volume by 5%"),
|
||||||
"volume_down": _(u"Decrease volume by 5%"),
|
"volume_down": _("Decrease volume by 5%"),
|
||||||
"go_home": _(u"Jump to the first element of a buffer"),
|
"go_home": _("Jump to the first element of a buffer"),
|
||||||
"go_end": _(u"Jump to the last element of the current buffer"),
|
"go_end": _("Jump to the last element of the current buffer"),
|
||||||
"go_page_up": _(u"Jump 20 elements up in the current buffer"),
|
"go_page_up": _("Jump 20 elements up in the current buffer"),
|
||||||
"go_page_down": _(u"Jump 20 elements down in the current buffer"),
|
"go_page_down": _("Jump 20 elements down in the current buffer"),
|
||||||
"update_profile": _(u"Edit profile"),
|
"update_profile": _("Edit profile"),
|
||||||
"delete": _(u"Delete a tweet or direct message"),
|
"delete": _("Delete a tweet or direct message"),
|
||||||
"clear_buffer": _(u"Empty the current buffer"),
|
"clear_buffer": _("Empty the current buffer"),
|
||||||
"repeat_item": _(u"Repeat last item"),
|
"repeat_item": _("Repeat last item"),
|
||||||
"copy_to_clipboard": _(u"Copy to clipboard"),
|
"copy_to_clipboard": _("Copy to clipboard"),
|
||||||
"add_to_list": _(u"Add to list"),
|
"add_to_list": _("Add to list"),
|
||||||
"remove_from_list": _(u"Remove from list"),
|
"remove_from_list": _("Remove from list"),
|
||||||
"toggle_buffer_mute": _(u"Mute/unmute the active buffer"),
|
"toggle_buffer_mute": _("Mute/unmute the active buffer"),
|
||||||
"toggle_session_mute": _(u"Mute/unmute the current session"),
|
"toggle_session_mute": _("Mute/unmute the current session"),
|
||||||
"toggle_autoread": _(u"toggle the automatic reading of incoming tweets in the active buffer"),
|
"toggle_autoread": _("toggle the automatic reading of incoming tweets in the active buffer"),
|
||||||
"search": _(u"Search on twitter"),
|
"search": _("Search on twitter"),
|
||||||
"find": _(u"Find a string in the currently focused buffer"),
|
"find": _("Find a string in the currently focused buffer"),
|
||||||
"edit_keystrokes": _(u"Show the keystroke editor"),
|
"edit_keystrokes": _("Show the keystroke editor"),
|
||||||
"view_user_lists": _(u"Show lists for a specified user"),
|
"view_user_lists": _("Show lists for a specified user"),
|
||||||
"get_more_items": _(u"load previous items"),
|
"get_more_items": _("load previous items"),
|
||||||
"reverse_geocode": _(u"Get geolocation"),
|
"reverse_geocode": _("Get geolocation"),
|
||||||
"view_reverse_geocode": _(u"Display the tweet's geolocation in a dialog"),
|
"view_reverse_geocode": _("Display the tweet's geolocation in a dialog"),
|
||||||
"get_trending_topics": _(u"Create a trending topics buffer"),
|
"get_trending_topics": _("Create a trending topics buffer"),
|
||||||
"open_conversation": _(u"View conversation"),
|
"open_conversation": _("View conversation"),
|
||||||
"check_for_updates": _(u"Check and download updates"),
|
"check_for_updates": _("Check and download updates"),
|
||||||
"lists_manager": _(u"Opens the list manager, which allows you to create, edit, delete and open lists in buffers."),
|
"lists_manager": _("Opens the list manager, which allows you to create, edit, delete and open lists in buffers."),
|
||||||
"configuration": _(u"Opens the global settings dialogue"),
|
"configuration": _("Opens the global settings dialogue"),
|
||||||
"accountConfiguration": _(u"Opens the account settings dialogue"),
|
"accountConfiguration": _("Opens the account settings dialogue"),
|
||||||
"audio": _(u"Try to play an audio file"),
|
"audio": _("Try to play an audio file"),
|
||||||
"update_buffer": _(u"Updates the buffer and retrieves possible lost items there."),
|
"update_buffer": _("Updates the buffer and retrieves possible lost items there."),
|
||||||
"ocr_image": _(u"Extracts the text from a picture and displays the result in a dialog."),
|
"ocr_image": _("Extracts the text from a picture and displays the result in a dialog."),
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import object
|
from builtins import object
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
import config
|
import config
|
||||||
|
@ -5,20 +5,20 @@ from wxUI.dialogs import baseDialog
|
|||||||
|
|
||||||
class keystrokeEditorDialog(baseDialog.BaseWXDialog):
|
class keystrokeEditorDialog(baseDialog.BaseWXDialog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(keystrokeEditorDialog, self).__init__(parent=None, id=-1, title=_(u"Keystroke editor"))
|
super(keystrokeEditorDialog, self).__init__(parent=None, id=-1, title=_("Keystroke editor"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
self.actions = []
|
self.actions = []
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
keysText = wx.StaticText(panel, -1, _(u"Select a keystroke to edit"))
|
keysText = wx.StaticText(panel, -1, _("Select a keystroke to edit"))
|
||||||
self.keys = widgets.list(self, _(u"Action"), _(u"Keystroke"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL, size=(400, 450))
|
self.keys = widgets.list(self, _("Action"), _("Keystroke"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL, size=(400, 450))
|
||||||
self.keys.list.SetFocus()
|
self.keys.list.SetFocus()
|
||||||
firstSizer = wx.BoxSizer(wx.HORIZONTAL)
|
firstSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
firstSizer.Add(keysText, 0, wx.ALL, 5)
|
firstSizer.Add(keysText, 0, wx.ALL, 5)
|
||||||
firstSizer.Add(self.keys.list, 0, wx.ALL, 5)
|
firstSizer.Add(self.keys.list, 0, wx.ALL, 5)
|
||||||
self.edit = wx.Button(panel, -1, _(u"Edit"))
|
self.edit = wx.Button(panel, -1, _("Edit"))
|
||||||
self.edit.SetDefault()
|
self.edit.SetDefault()
|
||||||
self.execute = wx.Button(panel, -1, _(u"Execute action"))
|
self.execute = wx.Button(panel, -1, _("Execute action"))
|
||||||
close = wx.Button(panel, wx.ID_CANCEL, _(u"Close"))
|
close = wx.Button(panel, wx.ID_CANCEL, _("Close"))
|
||||||
secondSizer = wx.BoxSizer(wx.HORIZONTAL)
|
secondSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
secondSizer.Add(self.edit, 0, wx.ALL, 5)
|
secondSizer.Add(self.edit, 0, wx.ALL, 5)
|
||||||
secondSizer.Add(self.execute, 0, wx.ALL, 5)
|
secondSizer.Add(self.execute, 0, wx.ALL, 5)
|
||||||
@ -45,24 +45,24 @@ class keystrokeEditorDialog(baseDialog.BaseWXDialog):
|
|||||||
|
|
||||||
class editKeystrokeDialog(baseDialog.BaseWXDialog):
|
class editKeystrokeDialog(baseDialog.BaseWXDialog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(editKeystrokeDialog, self).__init__(parent=None, id=-1, title=_(u"Editing keystroke"))
|
super(editKeystrokeDialog, self).__init__(parent=None, id=-1, title=_("Editing keystroke"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.control = wx.CheckBox(panel, -1, _(u"Control"))
|
self.control = wx.CheckBox(panel, -1, _("Control"))
|
||||||
self.alt = wx.CheckBox(panel, -1, _(u"Alt"))
|
self.alt = wx.CheckBox(panel, -1, _("Alt"))
|
||||||
self.shift = wx.CheckBox(panel, -1, _(u"Shift"))
|
self.shift = wx.CheckBox(panel, -1, _("Shift"))
|
||||||
self.win = wx.CheckBox(panel, -1, _(u"Windows"))
|
self.win = wx.CheckBox(panel, -1, _("Windows"))
|
||||||
sizer1 = wx.BoxSizer(wx.HORIZONTAL)
|
sizer1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
sizer1.Add(self.control)
|
sizer1.Add(self.control)
|
||||||
sizer1.Add(self.alt)
|
sizer1.Add(self.alt)
|
||||||
sizer1.Add(self.shift)
|
sizer1.Add(self.shift)
|
||||||
sizer1.Add(self.win)
|
sizer1.Add(self.win)
|
||||||
charLabel = wx.StaticText(panel, -1, _(u"Key"))
|
charLabel = wx.StaticText(panel, -1, _("Key"))
|
||||||
self.key = wx.TextCtrl(panel, -1)
|
self.key = wx.TextCtrl(panel, -1)
|
||||||
sizer2 = wx.BoxSizer(wx.HORIZONTAL)
|
sizer2 = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
sizer2.Add(charLabel)
|
sizer2.Add(charLabel)
|
||||||
sizer2.Add(self.key)
|
sizer2.Add(self.key)
|
||||||
ok = wx.Button(panel, wx.ID_OK, _(u"OK"))
|
ok = wx.Button(panel, wx.ID_OK, _("OK"))
|
||||||
ok.SetDefault()
|
ok.SetDefault()
|
||||||
cancel = wx.Button(panel, wx.ID_CANCEL)
|
cancel = wx.Button(panel, wx.ID_CANCEL)
|
||||||
sizer3 = wx.BoxSizer(wx.HORIZONTAL)
|
sizer3 = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
@ -75,7 +75,7 @@ class editKeystrokeDialog(baseDialog.BaseWXDialog):
|
|||||||
|
|
||||||
|
|
||||||
def no_win_message():
|
def no_win_message():
|
||||||
return wx.MessageDialog(None, _(u"You need to use the Windows key"), _(u"Invalid keystroke"), wx.OK|wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _("You need to use the Windows key"), _("Invalid keystroke"), wx.OK|wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def no_key():
|
def no_key():
|
||||||
return wx.MessageDialog(None, _(u"You must provide a character for the keystroke"), _(u"Invalid keystroke"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _("You must provide a character for the keystroke"), _("Invalid keystroke"), wx.ICON_ERROR).ShowModal()
|
@ -36,7 +36,7 @@ def localeNameToWindowsLCID(localeName):
|
|||||||
localeName=locale.normalize(localeName)
|
localeName=locale.normalize(localeName)
|
||||||
if '.' in localeName:
|
if '.' in localeName:
|
||||||
localeName=localeName.split('.')[0]
|
localeName=localeName.split('.')[0]
|
||||||
LCList=[x[0] for x in locale.windows_locale.items() if x[1]==localeName]
|
LCList=[x[0] for x in list(locale.windows_locale.items()) if x[1]==localeName]
|
||||||
if len(LCList)>0:
|
if len(LCList)>0:
|
||||||
LCID=LCList[0]
|
LCID=LCList[0]
|
||||||
else:
|
else:
|
||||||
@ -113,7 +113,7 @@ def makePgettext(translations):
|
|||||||
message = str(message)
|
message = str(message)
|
||||||
try:
|
try:
|
||||||
# Look up the message with its context.
|
# Look up the message with its context.
|
||||||
return translations._catalog[u"%s\x04%s" % (context, message)]
|
return translations._catalog["%s\x04%s" % (context, message)]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return message
|
return message
|
||||||
else:
|
else:
|
||||||
|
@ -7,7 +7,7 @@ import sys
|
|||||||
APP_LOG_FILE = 'debug.log'
|
APP_LOG_FILE = 'debug.log'
|
||||||
ERROR_LOG_FILE = "error.log"
|
ERROR_LOG_FILE = "error.log"
|
||||||
MESSAGE_FORMAT = "%(asctime)s %(name)s %(levelname)s: %(message)s"
|
MESSAGE_FORMAT = "%(asctime)s %(name)s %(levelname)s: %(message)s"
|
||||||
DATE_FORMAT = u"%d/%m/%Y %H:%M:%S"
|
DATE_FORMAT = "%d/%m/%Y %H:%M:%S"
|
||||||
|
|
||||||
formatter = logging.Formatter(MESSAGE_FORMAT, datefmt=DATE_FORMAT)
|
formatter = logging.Formatter(MESSAGE_FORMAT, datefmt=DATE_FORMAT)
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
############################################################
|
############################################################
|
||||||
from __future__ import print_function
|
|
||||||
from builtins import range
|
from builtins import range
|
||||||
import requests
|
import requests
|
||||||
import keys
|
import keys
|
||||||
|
@ -15,7 +15,7 @@ if system == "Windows":
|
|||||||
import languageHandler
|
import languageHandler
|
||||||
import paths
|
import paths
|
||||||
#check if TWBlue is installed (Windows only)
|
#check if TWBlue is installed (Windows only)
|
||||||
if os.path.exists(paths.app_path(u"Uninstall.exe")):
|
if os.path.exists(paths.app_path("Uninstall.exe")):
|
||||||
paths.mode="installed"
|
paths.mode="installed"
|
||||||
import commandline
|
import commandline
|
||||||
import config
|
import config
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from . import widgets
|
from . import widgets
|
@ -31,7 +31,7 @@ class list(object):
|
|||||||
if self.system == "Windows":
|
if self.system == "Windows":
|
||||||
self.list = wx.ListCtrl(parent, -1, **self.listArguments)
|
self.list = wx.ListCtrl(parent, -1, **self.listArguments)
|
||||||
for i in range(0, len(self.columns)):
|
for i in range(0, len(self.columns)):
|
||||||
self.list.InsertColumn(i, u"%s" % (self.columns[i]))
|
self.list.InsertColumn(i, "%s" % (self.columns[i]))
|
||||||
else:
|
else:
|
||||||
self.list = wx.ListBox(parent, -1, choices=[])
|
self.list = wx.ListBox(parent, -1, choices=[])
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" A cross platform notification system.
|
""" A cross platform notification system.
|
||||||
Under Linux, the wx.NotificationMessage does not show a notification on the taskbar, so we decided to use dbus for showing notifications for linux and wx for Windows."""
|
Under Linux, the wx.NotificationMessage does not show a notification on the taskbar, so we decided to use dbus for showing notifications for linux and wx for Windows."""
|
||||||
from __future__ import absolute_import
|
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
notify = None
|
notify = None
|
||||||
|
16
src/paths.py
16
src/paths.py
@ -28,9 +28,9 @@ def config_path():
|
|||||||
global mode, directory
|
global mode, directory
|
||||||
if mode == "portable":
|
if mode == "portable":
|
||||||
if directory != None: path = os.path.join(directory, "config")
|
if directory != None: path = os.path.join(directory, "config")
|
||||||
elif directory == None: path = app_path(u"config")
|
elif directory == None: path = app_path("config")
|
||||||
elif mode == "installed":
|
elif mode == "installed":
|
||||||
path = data_path(u"config")
|
path = data_path("config")
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
log.debug("%s path does not exist, creating..." % (path,))
|
log.debug("%s path does not exist, creating..." % (path,))
|
||||||
os.mkdir(path)
|
os.mkdir(path)
|
||||||
@ -41,9 +41,9 @@ def logs_path():
|
|||||||
global mode, directory
|
global mode, directory
|
||||||
if mode == "portable":
|
if mode == "portable":
|
||||||
if directory != None: path = os.path.join(directory, "logs")
|
if directory != None: path = os.path.join(directory, "logs")
|
||||||
elif directory == None: path = app_path(u"logs")
|
elif directory == None: path = app_path("logs")
|
||||||
elif mode == "installed":
|
elif mode == "installed":
|
||||||
path = data_path(u"logs")
|
path = data_path("logs")
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
log.debug("%s path does not exist, creating..." % (path,))
|
log.debug("%s path does not exist, creating..." % (path,))
|
||||||
os.mkdir(path)
|
os.mkdir(path)
|
||||||
@ -66,20 +66,20 @@ def data_path(app_name='TW blue'):
|
|||||||
|
|
||||||
@merge_paths
|
@merge_paths
|
||||||
def locale_path():
|
def locale_path():
|
||||||
return app_path(u"locales")
|
return app_path("locales")
|
||||||
|
|
||||||
@merge_paths
|
@merge_paths
|
||||||
def sound_path():
|
def sound_path():
|
||||||
return app_path(u"sounds")
|
return app_path("sounds")
|
||||||
|
|
||||||
@merge_paths
|
@merge_paths
|
||||||
def com_path():
|
def com_path():
|
||||||
global mode, directory
|
global mode, directory
|
||||||
if mode == "portable":
|
if mode == "portable":
|
||||||
if directory != None: path = os.path.join(directory, "com_cache")
|
if directory != None: path = os.path.join(directory, "com_cache")
|
||||||
elif directory == None: path = app_path(u"com_cache")
|
elif directory == None: path = app_path("com_cache")
|
||||||
elif mode == "installed":
|
elif mode == "installed":
|
||||||
path = data_path(u"com_cache")
|
path = data_path("com_cache")
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
log.debug("%s path does not exist, creating..." % (path,))
|
log.debug("%s path does not exist, creating..." % (path,))
|
||||||
os.mkdir(path)
|
os.mkdir(path)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import print_function
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
import winreg
|
import winreg
|
||||||
import os
|
import os
|
||||||
|
@ -2,7 +2,7 @@ from future import standard_library
|
|||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
import winreg
|
import winreg
|
||||||
|
|
||||||
SHELL_REGKEY = ur"Directory\shell"
|
SHELL_REGKEY = r"Directory\shell"
|
||||||
|
|
||||||
def context_menu_integrate(item_key_name, item_display_text, item_command):
|
def context_menu_integrate(item_key_name, item_display_text, item_command):
|
||||||
app_menu_key = winreg.OpenKey(winreg.HKEY_CLASSES_ROOT, SHELL_REGKEY, 0, winreg.KEY_WRITE)
|
app_menu_key = winreg.OpenKey(winreg.HKEY_CLASSES_ROOT, SHELL_REGKEY, 0, winreg.KEY_WRITE)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: cp1252 -*-
|
# -*- coding: cp1252 -*-
|
||||||
#from config_utils import Configuration, ConfigurationResetException
|
#from config_utils import Configuration, ConfigurationResetException
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import object
|
from builtins import object
|
||||||
import config
|
import config
|
||||||
import paths
|
import paths
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" The main session object. Here are the twitter functions to interact with the "model" of TWBlue."""
|
""" The main session object. Here are the twitter functions to interact with the "model" of TWBlue."""
|
||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
from builtins import str
|
from builtins import str
|
||||||
@ -178,10 +178,10 @@ class Session(object):
|
|||||||
results = []
|
results = []
|
||||||
data = getattr(self.twitter.twitter, update_function)(*args, **kwargs)
|
data = getattr(self.twitter.twitter, update_function)(*args, **kwargs)
|
||||||
if users == True:
|
if users == True:
|
||||||
if type(data) == dict and "cursor" in data:
|
if isinstance(data, dict) and "cursor" in data:
|
||||||
self.db[name]["cursor"] = data["next_cursor"]
|
self.db[name]["cursor"] = data["next_cursor"]
|
||||||
for i in data["users"]: results.append(i)
|
for i in data["users"]: results.append(i)
|
||||||
elif type(data) == list:
|
elif isinstance(data, list):
|
||||||
results.extend(data[1:])
|
results.extend(data[1:])
|
||||||
else:
|
else:
|
||||||
results.extend(data[1:])
|
results.extend(data[1:])
|
||||||
@ -414,11 +414,11 @@ class Session(object):
|
|||||||
output.speak("Generating database, this might take a while.",True)
|
output.speak("Generating database, this might take a while.",True)
|
||||||
shelf=shelve.open(paths.config_path(shelfname),'c')
|
shelf=shelve.open(paths.config_path(shelfname),'c')
|
||||||
for key,value in list(self.db.items()):
|
for key,value in list(self.db.items()):
|
||||||
if type(key) != str and type(key) != str:
|
if not isinstance(key, str) and not isinstance(key, str):
|
||||||
output.speak("Uh oh, while shelving the database, a key of type " + str(type(key)) + " has been found. It will be converted to type str, but this will cause all sorts of problems on deshelve. Please bring this to the attention of the " + application.name + " developers immediately. More information about the error will be written to the error log.",True)
|
output.speak("Uh oh, while shelving the database, a key of type " + str(type(key)) + " has been found. It will be converted to type str, but this will cause all sorts of problems on deshelve. Please bring this to the attention of the " + application.name + " developers immediately. More information about the error will be written to the error log.",True)
|
||||||
log.error("Uh oh, " + str(key) + " is of type " + str(type(key)) + "!")
|
log.error("Uh oh, " + str(key) + " is of type " + str(type(key)) + "!")
|
||||||
# Convert unicode objects to UTF-8 strings before shelve these objects.
|
# Convert unicode objects to UTF-8 strings before shelve these objects.
|
||||||
if type(value) == list and self.settings["general"]["persist_size"] != -1 and len(value) > self.settings["general"]["persist_size"]:
|
if isinstance(value, list) and self.settings["general"]["persist_size"] != -1 and len(value) > self.settings["general"]["persist_size"]:
|
||||||
shelf[str(key.encode("utf-8"))]=value[self.settings["general"]["persist_size"]:]
|
shelf[str(key.encode("utf-8"))]=value[self.settings["general"]["persist_size"]:]
|
||||||
else:
|
else:
|
||||||
shelf[str(key.encode("utf-8"))]=value
|
shelf[str(key.encode("utf-8"))]=value
|
||||||
@ -484,5 +484,5 @@ class Session(object):
|
|||||||
if "@%s" % (i["screen_name"]) not in tweet["message"] and i["screen_name"] != tweet["user"]["screen_name"]:
|
if "@%s" % (i["screen_name"]) not in tweet["message"] and i["screen_name"] != tweet["user"]["screen_name"]:
|
||||||
if "retweeted_status" in tweet and tweet["retweeted_status"]["user"]["screen_name"] == i["screen_name"]:
|
if "retweeted_status" in tweet and tweet["retweeted_status"]["user"]["screen_name"] == i["screen_name"]:
|
||||||
continue
|
continue
|
||||||
tweet["message"] = u"@%s %s" % (i["screen_name"], tweet["message"])
|
tweet["message"] = "@%s %s" % (i["screen_name"], tweet["message"])
|
||||||
return tweet
|
return tweet
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from builtins import object
|
from builtins import object
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -4,18 +4,18 @@ from multiplatform_widgets import widgets
|
|||||||
import application
|
import application
|
||||||
class sessionManagerWindow(wx.Dialog):
|
class sessionManagerWindow(wx.Dialog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(sessionManagerWindow, self).__init__(parent=None, title=_(u"Session manager"), size=wx.DefaultSize)
|
super(sessionManagerWindow, self).__init__(parent=None, title=_("Session manager"), size=wx.DefaultSize)
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
label = wx.StaticText(panel, -1, _(u"Accounts list"), size=wx.DefaultSize)
|
label = wx.StaticText(panel, -1, _("Accounts list"), size=wx.DefaultSize)
|
||||||
listSizer = wx.BoxSizer(wx.HORIZONTAL)
|
listSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
self.list = widgets.list(panel, _(u"Account"), style=wx.LC_SINGLE_SEL|wx.LC_REPORT)
|
self.list = widgets.list(panel, _("Account"), style=wx.LC_SINGLE_SEL|wx.LC_REPORT)
|
||||||
listSizer.Add(label, 0, wx.ALL, 5)
|
listSizer.Add(label, 0, wx.ALL, 5)
|
||||||
listSizer.Add(self.list.list, 0, wx.ALL, 5)
|
listSizer.Add(self.list.list, 0, wx.ALL, 5)
|
||||||
sizer.Add(listSizer, 0, wx.ALL, 5)
|
sizer.Add(listSizer, 0, wx.ALL, 5)
|
||||||
self.new = wx.Button(panel, -1, _(u"New account"), size=wx.DefaultSize)
|
self.new = wx.Button(panel, -1, _("New account"), size=wx.DefaultSize)
|
||||||
self.remove = wx.Button(panel, -1, _(u"Remove account"))
|
self.remove = wx.Button(panel, -1, _("Remove account"))
|
||||||
self.configuration = wx.Button(panel, -1, _(u"Global Settings"))
|
self.configuration = wx.Button(panel, -1, _("Global Settings"))
|
||||||
ok = wx.Button(panel, wx.ID_OK, size=wx.DefaultSize)
|
ok = wx.Button(panel, wx.ID_OK, size=wx.DefaultSize)
|
||||||
ok.SetDefault()
|
ok.SetDefault()
|
||||||
cancel = wx.Button(panel, wx.ID_CANCEL, size=wx.DefaultSize)
|
cancel = wx.Button(panel, wx.ID_CANCEL, size=wx.DefaultSize)
|
||||||
@ -38,29 +38,29 @@ class sessionManagerWindow(wx.Dialog):
|
|||||||
|
|
||||||
def ok(self, ev):
|
def ok(self, ev):
|
||||||
if self.list.get_count() == 0:
|
if self.list.get_count() == 0:
|
||||||
wx.MessageDialog(None, _(u"You need to configure an account."), _(u"Account Error"), wx.ICON_ERROR).ShowModal()
|
wx.MessageDialog(None, _("You need to configure an account."), _("Account Error"), wx.ICON_ERROR).ShowModal()
|
||||||
return
|
return
|
||||||
self.controller.do_ok()
|
self.controller.do_ok()
|
||||||
self.EndModal(wx.ID_OK)
|
self.EndModal(wx.ID_OK)
|
||||||
|
|
||||||
def new_account_dialog(self):
|
def new_account_dialog(self):
|
||||||
return wx.MessageDialog(self, _(u"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?"), _(u"Authorization"), wx.YES_NO).ShowModal()
|
return wx.MessageDialog(self, _("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?"), _("Authorization"), wx.YES_NO).ShowModal()
|
||||||
|
|
||||||
def add_new_session_to_list(self):
|
def add_new_session_to_list(self):
|
||||||
total = self.list.get_count()
|
total = self.list.get_count()
|
||||||
name = _(u"Authorized account %d") % (total+1)
|
name = _("Authorized account %d") % (total+1)
|
||||||
self.list.insert_item(False, name)
|
self.list.insert_item(False, name)
|
||||||
if self.list.get_count() == 1:
|
if self.list.get_count() == 1:
|
||||||
self.list.select_item(0)
|
self.list.select_item(0)
|
||||||
|
|
||||||
def show_unauthorised_error(self):
|
def show_unauthorised_error(self):
|
||||||
wx.MessageDialog(None, _(u"Your access token is invalid or the authorization has failed. Please try again."), _(u"Invalid user token"), wx.ICON_ERROR).ShowModal()
|
wx.MessageDialog(None, _("Your access token is invalid or the authorization has failed. Please try again."), _("Invalid user token"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def get_response(self):
|
def get_response(self):
|
||||||
return self.ShowModal()
|
return self.ShowModal()
|
||||||
|
|
||||||
def remove_account_dialog(self):
|
def remove_account_dialog(self):
|
||||||
return wx.MessageDialog(self, _(u"Do you really want to delete this account?"), _(u"Remove account"), wx.YES_NO).ShowModal()
|
return wx.MessageDialog(self, _("Do you really want to delete this account?"), _("Remove account"), wx.YES_NO).ShowModal()
|
||||||
|
|
||||||
def get_selected(self):
|
def get_selected(self):
|
||||||
return self.list.get_selected()
|
return self.list.get_selected()
|
||||||
|
@ -102,7 +102,7 @@ def wx_files():
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
setup(
|
setup(
|
||||||
name = application.name,
|
name = application.name,
|
||||||
author = u", ".join(application.authors),
|
author = ", ".join(application.authors),
|
||||||
author_email = application.authorEmail,
|
author_email = application.authorEmail,
|
||||||
version = application.version,
|
version = application.version,
|
||||||
url = application.url,
|
url = application.url,
|
||||||
|
@ -139,7 +139,7 @@ class URLStream(object):
|
|||||||
|
|
||||||
def play(self, url=None, volume=1.0, stream=None,announce=True):
|
def play(self, url=None, volume=1.0, stream=None,announce=True):
|
||||||
if announce:
|
if announce:
|
||||||
output.speak(_(u"Playing..."))
|
output.speak(_("Playing..."))
|
||||||
log.debug("Attempting to play an URL...")
|
log.debug("Attempting to play an URL...")
|
||||||
if url != None:
|
if url != None:
|
||||||
self.prepare(url)
|
self.prepare(url)
|
||||||
@ -155,7 +155,7 @@ class URLStream(object):
|
|||||||
|
|
||||||
def stop_audio(self,delete=False):
|
def stop_audio(self,delete=False):
|
||||||
if hasattr(self, "stream"):
|
if hasattr(self, "stream"):
|
||||||
output.speak(_(u"Stopped."), True)
|
output.speak(_("Stopped."), True)
|
||||||
try:
|
try:
|
||||||
self.stream.stop()
|
self.stream.stop()
|
||||||
log.debug("Stopped audio stream.")
|
log.debug("Stopped audio stream.")
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from . import buffers, utils, compose, twitter
|
from . import buffers, utils, compose, twitter
|
||||||
|
@ -19,5 +19,5 @@ class handler(http.server.BaseHTTPRequestHandler):
|
|||||||
params = parse_qs(urlparse(self.path).query)
|
params = parse_qs(urlparse(self.path).query)
|
||||||
global verifier
|
global verifier
|
||||||
verifier = params.get('oauth_verifier', [None])[0]
|
verifier = params.get('oauth_verifier', [None])[0]
|
||||||
self.wfile.write(u"You have successfully logged into Twitter with {0}. You can close this window now.".format(application.name))
|
self.wfile.write("You have successfully logged into Twitter with {0}. You can close this window now.".format(application.name))
|
||||||
self.finish()
|
self.finish()
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from . import stream, indibidual
|
from . import stream, indibidual
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
from builtins import str
|
from builtins import str
|
||||||
@ -41,7 +41,7 @@ def compose_tweet(tweet, db, relative_times, show_screen_names=False):
|
|||||||
if relative_times == True:
|
if relative_times == True:
|
||||||
ts = original_date.humanize(locale=languageHandler.getLanguage())
|
ts = original_date.humanize(locale=languageHandler.getLanguage())
|
||||||
else:
|
else:
|
||||||
ts = original_date.replace(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.getLanguage())
|
ts = original_date.replace(seconds=db["utc_offset"]).format(_("dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.getLanguage())
|
||||||
else:
|
else:
|
||||||
ts = tweet["created_at"]
|
ts = tweet["created_at"]
|
||||||
if "message" in tweet:
|
if "message" in tweet:
|
||||||
@ -82,16 +82,16 @@ def compose_dm(tweet, db, relative_times, show_screen_names=False):
|
|||||||
if relative_times == True:
|
if relative_times == True:
|
||||||
ts = original_date.humanize(locale=languageHandler.getLanguage())
|
ts = original_date.humanize(locale=languageHandler.getLanguage())
|
||||||
else:
|
else:
|
||||||
ts = original_date.replace(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.getLanguage())
|
ts = original_date.replace(seconds=db["utc_offset"]).format(_("dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.getLanguage())
|
||||||
else:
|
else:
|
||||||
ts = tweet["created_at"]
|
ts = tweet["created_at"]
|
||||||
text = StripChars(tweet["text"])
|
text = StripChars(tweet["text"])
|
||||||
source = "DM"
|
source = "DM"
|
||||||
if db["user_name"] == tweet["sender"]["screen_name"]:
|
if db["user_name"] == tweet["sender"]["screen_name"]:
|
||||||
if show_screen_names:
|
if show_screen_names:
|
||||||
user = _(u"Dm to %s ") % (tweet["recipient"]["screen_name"],)
|
user = _("Dm to %s ") % (tweet["recipient"]["screen_name"],)
|
||||||
else:
|
else:
|
||||||
user = _(u"Dm to %s ") % (tweet["recipient"]["name"],)
|
user = _("Dm to %s ") % (tweet["recipient"]["name"],)
|
||||||
else:
|
else:
|
||||||
if show_screen_names:
|
if show_screen_names:
|
||||||
user = tweet["sender"]["screen_name"]
|
user = tweet["sender"]["screen_name"]
|
||||||
@ -126,7 +126,7 @@ def compose_quoted_tweet(quoted_tweet, original_tweet, show_screen_names=False):
|
|||||||
original_text = StripChars(original_tweet["full_text"])
|
original_text = StripChars(original_tweet["full_text"])
|
||||||
else:
|
else:
|
||||||
original_text = StripChars(original_tweet["text"])
|
original_text = StripChars(original_tweet["text"])
|
||||||
quoted_tweet["message"] = _(u"{0}. Quoted tweet from @{1}: {2}").format( quoted_tweet[value], original_user, original_text)
|
quoted_tweet["message"] = _("{0}. Quoted tweet from @{1}: {2}").format( quoted_tweet[value], original_user, original_text)
|
||||||
quoted_tweet = tweets.clear_url(quoted_tweet)
|
quoted_tweet = tweets.clear_url(quoted_tweet)
|
||||||
return quoted_tweet
|
return quoted_tweet
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ def compose_followers_list(tweet, db, relative_times=True, show_screen_names=Fal
|
|||||||
if relative_times == True:
|
if relative_times == True:
|
||||||
ts = original_date.humanize(locale=languageHandler.getLanguage())
|
ts = original_date.humanize(locale=languageHandler.getLanguage())
|
||||||
else:
|
else:
|
||||||
ts = original_date.replace(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.getLanguage())
|
ts = original_date.replace(seconds=db["utc_offset"]).format(_("dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.getLanguage())
|
||||||
else:
|
else:
|
||||||
ts = tweet["created_at"]
|
ts = tweet["created_at"]
|
||||||
if "status" in tweet:
|
if "status" in tweet:
|
||||||
@ -145,12 +145,12 @@ def compose_followers_list(tweet, db, relative_times=True, show_screen_names=Fal
|
|||||||
if relative_times:
|
if relative_times:
|
||||||
ts2 = original_date2.humanize(locale=languageHandler.getLanguage())
|
ts2 = original_date2.humanize(locale=languageHandler.getLanguage())
|
||||||
else:
|
else:
|
||||||
ts2 = original_date2.replace(seconds=db["utc_offset"]).format(_(u"dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.getLanguage())
|
ts2 = original_date2.replace(seconds=db["utc_offset"]).format(_("dddd, MMMM D, YYYY H:m:s"), locale=languageHandler.getLanguage())
|
||||||
else:
|
else:
|
||||||
ts2 = _("Unavailable")
|
ts2 = _("Unavailable")
|
||||||
else:
|
else:
|
||||||
ts2 = _("Unavailable")
|
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)]
|
return [_("%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)]
|
||||||
|
|
||||||
def compose_event(data, username, show_screen_names=False):
|
def compose_event(data, username, show_screen_names=False):
|
||||||
if show_screen_names:
|
if show_screen_names:
|
||||||
@ -160,45 +160,45 @@ def compose_event(data, username, show_screen_names=False):
|
|||||||
if data["event"] == "block":
|
if data["event"] == "block":
|
||||||
event = _("You've blocked %s") % (data["target"][value])
|
event = _("You've blocked %s") % (data["target"][value])
|
||||||
elif data["event"] == "unblock":
|
elif data["event"] == "unblock":
|
||||||
event = _(u"You've unblocked %s") % (data["target"][value])
|
event = _("You've unblocked %s") % (data["target"][value])
|
||||||
elif data["event"] == "follow":
|
elif data["event"] == "follow":
|
||||||
if data["target"]["screen_name"] == username:
|
if data["target"]["screen_name"] == username:
|
||||||
event = _(u"%s(@%s) has followed you") % (data["source"]["name"], data["source"]["screen_name"])
|
event = _("%s(@%s) has followed you") % (data["source"]["name"], data["source"]["screen_name"])
|
||||||
elif data["source"]["screen_name"] == username:
|
elif data["source"]["screen_name"] == username:
|
||||||
event = _(u"You've followed %s(@%s)") % (data["target"]["name"], data["target"]["screen_name"])
|
event = _("You've followed %s(@%s)") % (data["target"]["name"], data["target"]["screen_name"])
|
||||||
elif data["event"] == "unfollow":
|
elif data["event"] == "unfollow":
|
||||||
event = _(u"You've unfollowed %s (@%s)") % (data["target"]["name"], data["target"]["screen_name"])
|
event = _("You've unfollowed %s (@%s)") % (data["target"]["name"], data["target"]["screen_name"])
|
||||||
elif data["event"] == "favorite":
|
elif data["event"] == "favorite":
|
||||||
if data["source"]["screen_name"] == username:
|
if data["source"]["screen_name"] == username:
|
||||||
event = _(u"You've liked: %s, %s") % (data["target"][value], data["target_object"]["text"])
|
event = _("You've liked: %s, %s") % (data["target"][value], data["target_object"]["text"])
|
||||||
else:
|
else:
|
||||||
event = _(u"%s(@%s) has liked: %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["text"])
|
event = _("%s(@%s) has liked: %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["text"])
|
||||||
elif data["event"] == "unfavorite":
|
elif data["event"] == "unfavorite":
|
||||||
if data["source"]["screen_name"] == username: event = _(u"You've unliked: %s, %s") % (data["target"][value], data["target_object"]["text"])
|
if data["source"]["screen_name"] == username: event = _("You've unliked: %s, %s") % (data["target"][value], data["target_object"]["text"])
|
||||||
else: event = _(u"%s(@%s) has unliked: %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["text"])
|
else: event = _("%s(@%s) has unliked: %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["text"])
|
||||||
elif data["event"] == "list_created":
|
elif data["event"] == "list_created":
|
||||||
event = _(u"You've created the list %s") % (data["target_object"]["name"])
|
event = _("You've created the list %s") % (data["target_object"]["name"])
|
||||||
elif data["event"] == "list_destroyed":
|
elif data["event"] == "list_destroyed":
|
||||||
event = _("You've deleted the list %s") % (data["target_object"]["name"])
|
event = _("You've deleted the list %s") % (data["target_object"]["name"])
|
||||||
elif data["event"] == "list_updated":
|
elif data["event"] == "list_updated":
|
||||||
event = _("You've updated the list %s") % (data["target_object"]["name"])
|
event = _("You've updated the list %s") % (data["target_object"]["name"])
|
||||||
elif data["event"] == "list_member_added":
|
elif data["event"] == "list_member_added":
|
||||||
if data["source"]["screen_name"] == username: event = _(u"You've added %s(@%s) to the list %s") % (data["target"]["name"], data["target"]["screen_name"], data["target_object"]["name"])
|
if data["source"]["screen_name"] == username: event = _("You've added %s(@%s) to the list %s") % (data["target"]["name"], data["target"]["screen_name"], data["target_object"]["name"])
|
||||||
else: event = _(u"%s(@%s) has added you to the list %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["name"])
|
else: event = _("%s(@%s) has added you to the list %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["name"])
|
||||||
elif data["event"] == "list_member_removed":
|
elif data["event"] == "list_member_removed":
|
||||||
if data["source"]["screen_name"] == username: event = _(u"You'be removed %s(@%s) from the list %s") % (data["target"]["name"], data["target"]["screen_name"], data["target_object"]["name"])
|
if data["source"]["screen_name"] == username: event = _("You'be removed %s(@%s) from the list %s") % (data["target"]["name"], data["target"]["screen_name"], data["target_object"]["name"])
|
||||||
else: event = _(u"%s(@%s) has removed you from the list %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["name"])
|
else: event = _("%s(@%s) has removed you from the list %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["name"])
|
||||||
elif data["event"] == "list_user_subscribed":
|
elif data["event"] == "list_user_subscribed":
|
||||||
if data["source"]["screen_name"] == username: event = _(u"You've subscribed to the list %s, which is owned by %s(@%s)") % (data["target_object"]["name"], data["target"]["name"], data["target"]["screen_name"])
|
if data["source"]["screen_name"] == username: event = _("You've subscribed to the list %s, which is owned by %s(@%s)") % (data["target_object"]["name"], data["target"]["name"], data["target"]["screen_name"])
|
||||||
else: event = _(u"%s(@%s) has suscribed you to the list %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["name"])
|
else: event = _("%s(@%s) has suscribed you to the list %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["name"])
|
||||||
elif data["event"] == "list_user_unsubscribed":
|
elif data["event"] == "list_user_unsubscribed":
|
||||||
if data["source"]["screen_name"] == username: event = _(u"You've unsubscribed from the list %s, which is owned by %s(@%s)") % (data["target_object"]["name"], data["target"]["name"], data["target"]["screen_name"])
|
if data["source"]["screen_name"] == username: event = _("You've unsubscribed from the list %s, which is owned by %s(@%s)") % (data["target_object"]["name"], data["target"]["name"], data["target"]["screen_name"])
|
||||||
else: event = _("You've been unsubscribed from the list %s, which is owned by %s(@%s)") % (data["target_object"]["name"], data["source"]["name"], data["source"]["screen_name"])
|
else: event = _("You've been unsubscribed from the list %s, which is owned by %s(@%s)") % (data["target_object"]["name"], data["source"]["name"], data["source"]["screen_name"])
|
||||||
elif data["event"] == "retweeted_retweet":
|
elif data["event"] == "retweeted_retweet":
|
||||||
if data["source"]["screen_name"] == username: event = _(u"You have retweeted a retweet from %s(@%s): %s") % (data["target"]["name"], data["target"]["screen_name"], data["target_object"]["retweeted_status"]["text"])
|
if data["source"]["screen_name"] == username: event = _("You have retweeted a retweet from %s(@%s): %s") % (data["target"]["name"], data["target"]["screen_name"], data["target_object"]["retweeted_status"]["text"])
|
||||||
else: event = _(u"%s(@%s) has retweeted your retweet: %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["retweeted_status"]["text"])
|
else: event = _("%s(@%s) has retweeted your retweet: %s") % (data["source"]["name"], data["source"]["screen_name"], data["target_object"]["retweeted_status"]["text"])
|
||||||
elif data["event"] == "quoted_tweet":
|
elif data["event"] == "quoted_tweet":
|
||||||
event = _(u"@{0} quoted your tweet: {1}").format(data["source"]["screen_name"], data["target_object"]["text"])
|
event = _("@{0} quoted your tweet: {1}").format(data["source"]["screen_name"], data["target_object"]["text"])
|
||||||
else:
|
else:
|
||||||
event = _("Unknown")
|
event = _("Unknown")
|
||||||
log.error("event: %s\n target: %s\n source: %s\n target_object: %s" % (data["event"], data["target"], data["source"], data["target_object"]))
|
log.error("event: %s\n target: %s\n source: %s\n target_object: %s" % (data["event"], data["target"], data["source"], data["target_object"]))
|
||||||
@ -206,10 +206,10 @@ def compose_event(data, username, show_screen_names=False):
|
|||||||
|
|
||||||
def compose_list(list):
|
def compose_list(list):
|
||||||
name = list["name"]
|
name = list["name"]
|
||||||
if list["description"] == None: description = _(u"No description available")
|
if list["description"] == None: description = _("No description available")
|
||||||
else: description = list["description"]
|
else: description = list["description"]
|
||||||
user = list["user"]["name"]
|
user = list["user"]["name"]
|
||||||
members = str(list["member_count"])
|
members = str(list["member_count"])
|
||||||
if list["mode"] == "private": status = _(u"private")
|
if list["mode"] == "private": status = _("private")
|
||||||
else: status = _(u"public")
|
else: status = _("public")
|
||||||
return [name, description, user, members, status]
|
return [name, description, user, members, status]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
from builtins import object
|
from builtins import object
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import print_function
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from builtins import range
|
from builtins import range
|
||||||
import url_shortener, re
|
import url_shortener, re
|
||||||
@ -139,9 +139,9 @@ def is_allowed(tweet, clients):
|
|||||||
|
|
||||||
def twitter_error(error):
|
def twitter_error(error):
|
||||||
if error.error_code == 403:
|
if error.error_code == 403:
|
||||||
msg = _(u"Sorry, you are not authorised to see this status.")
|
msg = _("Sorry, you are not authorised to see this status.")
|
||||||
elif error.error_code == 404:
|
elif error.error_code == 404:
|
||||||
msg = _(u"No status found with that ID")
|
msg = _("No status found with that ID")
|
||||||
else:
|
else:
|
||||||
msg = _(u"Error code {0}").format(error.error_code,)
|
msg = _("Error code {0}").format(error.error_code,)
|
||||||
output.speak(msg)
|
output.speak(msg)
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
import application
|
import application
|
||||||
from . import update
|
from . import update
|
||||||
import platform
|
import platform
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import division
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from past.utils import old_div
|
from past.utils import old_div
|
||||||
def convert_bytes(n):
|
def convert_bytes(n):
|
||||||
@ -27,19 +27,19 @@ def seconds_to_string(seconds, precision=0):
|
|||||||
sec_string = sec.__format__(sec_spec)
|
sec_string = sec.__format__(sec_spec)
|
||||||
string = ""
|
string = ""
|
||||||
if day == 1:
|
if day == 1:
|
||||||
string += _(u"%d day, ") % day
|
string += _("%d day, ") % day
|
||||||
elif day >= 2:
|
elif day >= 2:
|
||||||
string += _(u"%d days, ") % day
|
string += _("%d days, ") % day
|
||||||
if (hour == 1):
|
if (hour == 1):
|
||||||
string += _(u"%d hour, ") % hour
|
string += _("%d hour, ") % hour
|
||||||
elif (hour >= 2):
|
elif (hour >= 2):
|
||||||
string += _("%d hours, ") % hour
|
string += _("%d hours, ") % hour
|
||||||
if (min == 1):
|
if (min == 1):
|
||||||
string += _(u"%d minute, ") % min
|
string += _("%d minute, ") % min
|
||||||
elif (min >= 2):
|
elif (min >= 2):
|
||||||
string += _(u"%d minutes, ") % min
|
string += _("%d minutes, ") % min
|
||||||
if sec >= 0 and sec <= 2:
|
if sec >= 0 and sec <= 2:
|
||||||
string += _(u"%s second") % sec_string
|
string += _("%s second") % sec_string
|
||||||
else:
|
else:
|
||||||
string += _(u"%s seconds") % sec_string
|
string += _("%s seconds") % sec_string
|
||||||
return string
|
return string
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from __future__ import division
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from past.utils import old_div
|
from past.utils import old_div
|
||||||
import wx
|
import wx
|
||||||
@ -10,7 +10,7 @@ from . import utils
|
|||||||
progress_dialog = None
|
progress_dialog = None
|
||||||
|
|
||||||
def available_update_dialog(version, description, date):
|
def available_update_dialog(version, description, date):
|
||||||
dialog = wx.MessageDialog(None, _(u"There's a new %s version available, released on %s. Would you like to download it now?\n\n %s version: %s\n\nChanges:\n%s") % (application.name, date, application.name, version, description), _(u"New version for %s") % application.name, style=wx.YES|wx.NO|wx.ICON_WARNING)
|
dialog = wx.MessageDialog(None, _("There's a new %s version available, released on %s. Would you like to download it now?\n\n %s version: %s\n\nChanges:\n%s") % (application.name, date, application.name, version, description), _("New version for %s") % application.name, style=wx.YES|wx.NO|wx.ICON_WARNING)
|
||||||
if dialog.ShowModal() == wx.ID_YES:
|
if dialog.ShowModal() == wx.ID_YES:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
@ -18,7 +18,7 @@ def available_update_dialog(version, description, date):
|
|||||||
|
|
||||||
|
|
||||||
def create_progress_dialog():
|
def create_progress_dialog():
|
||||||
return wx.ProgressDialog(_(u"Download in Progress"), _(u"Downloading the new version..."), parent=None, maximum=100)
|
return wx.ProgressDialog(_("Download in Progress"), _("Downloading the new version..."), parent=None, maximum=100)
|
||||||
|
|
||||||
def progress_callback(total_downloaded, total_size):
|
def progress_callback(total_downloaded, total_size):
|
||||||
global progress_dialog
|
global progress_dialog
|
||||||
@ -28,7 +28,7 @@ def progress_callback(total_downloaded, total_size):
|
|||||||
if total_downloaded == total_size:
|
if total_downloaded == total_size:
|
||||||
progress_dialog.Destroy()
|
progress_dialog.Destroy()
|
||||||
else:
|
else:
|
||||||
progress_dialog.Update(old_div((total_downloaded*100),total_size), _(u"Updating... %s of %s") % (str(utils.convert_bytes(total_downloaded)), str(utils.convert_bytes(total_size))))
|
progress_dialog.Update(old_div((total_downloaded*100),total_size), _("Updating... %s of %s") % (str(utils.convert_bytes(total_downloaded)), str(utils.convert_bytes(total_size))))
|
||||||
|
|
||||||
def update_finished():
|
def update_finished():
|
||||||
ms = wx.MessageDialog(None, _(u"The update has been downloaded and installed successfully. Press OK to continue."), _(u"Done!")).ShowModal()
|
ms = wx.MessageDialog(None, _("The update has been downloaded and installed successfully. Press OK to continue."), _("Done!")).ShowModal()
|
@ -1,3 +1,3 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from . import shorteners
|
from . import shorteners
|
||||||
from .__main__ import *
|
from .__main__ import *
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from . import shorteners
|
from . import shorteners
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from .url_shortener import URLShortener
|
from .url_shortener import URLShortener
|
||||||
from .hkcim import HKCShortener
|
from .hkcim import HKCShortener
|
||||||
from .isgd import IsgdShortener
|
from .isgd import IsgdShortener
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
import urllib.request, urllib.parse, urllib.error
|
import urllib.request, urllib.parse, urllib.error
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
import urllib.request, urllib.parse, urllib.error
|
import urllib.request, urllib.parse, urllib.error
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
import urllib.request, urllib.parse, urllib.error
|
import urllib.request, urllib.parse, urllib.error
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
import urllib.request, urllib.parse, urllib.error
|
import urllib.request, urllib.parse, urllib.error
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
import urllib.request, urllib.parse, urllib.error
|
import urllib.request, urllib.parse, urllib.error
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
from .url_shortener import URLShortener
|
from .url_shortener import URLShortener
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from future import standard_library
|
from future import standard_library
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
import urllib.request, urllib.parse, urllib.error
|
import urllib.request, urllib.parse, urllib.error
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
import platform
|
import platform
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
from .wxUtils import *
|
from .wxUtils import *
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from .base import basePanel
|
from .base import basePanel
|
||||||
from .dm import dmPanel
|
from .dm import dmPanel
|
||||||
from .events import eventsPanel
|
from .events import eventsPanel
|
||||||
|
@ -8,7 +8,7 @@ class basePanel(wx.Panel):
|
|||||||
self.list.list.Bind(wx.EVT_LIST_ITEM_FOCUSED, f)
|
self.list.list.Bind(wx.EVT_LIST_ITEM_FOCUSED, f)
|
||||||
|
|
||||||
def create_list(self):
|
def create_list(self):
|
||||||
self.list = widgets.list(self, _(u"User"), _(u"Text"), _(u"Date"), _(u"Client"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES)
|
self.list = widgets.list(self, _("User"), _("Text"), _("Date"), _("Client"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES)
|
||||||
self.list.set_windows_size(0, 60)
|
self.list.set_windows_size(0, 60)
|
||||||
self.list.set_windows_size(1, 320)
|
self.list.set_windows_size(1, 320)
|
||||||
self.list.set_windows_size(2, 110)
|
self.list.set_windows_size(2, 110)
|
||||||
@ -21,10 +21,10 @@ class basePanel(wx.Panel):
|
|||||||
self.type = "baseBuffer"
|
self.type = "baseBuffer"
|
||||||
self.sizer = wx.BoxSizer(wx.VERTICAL)
|
self.sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.create_list()
|
self.create_list()
|
||||||
self.tweet = wx.Button(self, -1, _(u"Tweet"))
|
self.tweet = wx.Button(self, -1, _("Tweet"))
|
||||||
self.retweet = wx.Button(self, -1, _(u"Retweet"))
|
self.retweet = wx.Button(self, -1, _("Retweet"))
|
||||||
self.reply = wx.Button(self, -1, _(u"Reply"))
|
self.reply = wx.Button(self, -1, _("Reply"))
|
||||||
self.dm = wx.Button(self, -1, _(u"Direct message"))
|
self.dm = wx.Button(self, -1, _("Direct message"))
|
||||||
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
btnSizer.Add(self.tweet, 0, wx.ALL, 5)
|
btnSizer.Add(self.tweet, 0, wx.ALL, 5)
|
||||||
btnSizer.Add(self.retweet, 0, wx.ALL, 5)
|
btnSizer.Add(self.retweet, 0, wx.ALL, 5)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
import wx
|
import wx
|
||||||
from .base import basePanel
|
from .base import basePanel
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ class eventsPanel(wx.Panel):
|
|||||||
super(eventsPanel, self).__init__(parent)
|
super(eventsPanel, self).__init__(parent)
|
||||||
self.name = name
|
self.name = name
|
||||||
sizer = wx.BoxSizer()
|
sizer = wx.BoxSizer()
|
||||||
self.list = widgets.list(self, _(u"Date"), _(u"Event"), size=(600,600), style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES)
|
self.list = widgets.list(self, _("Date"), _("Event"), size=(600,600), style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES)
|
||||||
self.tweet = wx.Button(self, -1, _(u"Tweet"))
|
self.tweet = wx.Button(self, -1, _("Tweet"))
|
||||||
self.delete_event = wx.Button(self, -1, _(u"Remove event"))
|
self.delete_event = wx.Button(self, -1, _("Remove event"))
|
||||||
|
|
||||||
def set_position(self, reversed=False):
|
def set_position(self, reversed=False):
|
||||||
if reversed == False:
|
if reversed == False:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
import wx
|
import wx
|
||||||
from .base import basePanel
|
from .base import basePanel
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
import wx
|
import wx
|
||||||
from .base import basePanel
|
from .base import basePanel
|
||||||
|
|
||||||
|
@ -8,17 +8,17 @@ class accountPanel(wx.Panel):
|
|||||||
self.name = name
|
self.name = name
|
||||||
self.type = "account"
|
self.type = "account"
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.login = wx.Button(self, -1, _(u"Login"))
|
self.login = wx.Button(self, -1, _("Login"))
|
||||||
sizer.Add(self.login, 0, wx.ALL, 5)
|
sizer.Add(self.login, 0, wx.ALL, 5)
|
||||||
self.autostart_account = wx.CheckBox(self, -1, _(u"Log in automatically"))
|
self.autostart_account = wx.CheckBox(self, -1, _("Log in automatically"))
|
||||||
sizer.Add(self.autostart_account, 0, wx.ALL, 5)
|
sizer.Add(self.autostart_account, 0, wx.ALL, 5)
|
||||||
self.SetSizer(sizer)
|
self.SetSizer(sizer)
|
||||||
|
|
||||||
def change_login(self, login=True):
|
def change_login(self, login=True):
|
||||||
if login == True:
|
if login == True:
|
||||||
self.login.SetLabel(_(u"Login"))
|
self.login.SetLabel(_("Login"))
|
||||||
else:
|
else:
|
||||||
self.login.SetLabel(_(u"Logout"))
|
self.login.SetLabel(_("Logout"))
|
||||||
|
|
||||||
def change_autostart(self, autostart=True):
|
def change_autostart(self, autostart=True):
|
||||||
self.autostart_account.SetValue(autostart)
|
self.autostart_account.SetValue(autostart)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
import wx
|
import wx
|
||||||
from multiplatform_widgets import widgets
|
from multiplatform_widgets import widgets
|
||||||
from .base import basePanel
|
from .base import basePanel
|
||||||
@ -8,10 +8,10 @@ class peoplePanel(basePanel):
|
|||||||
""" Buffer used to show people."""
|
""" Buffer used to show people."""
|
||||||
|
|
||||||
def create_list(self):
|
def create_list(self):
|
||||||
self.list = widgets.list(self, _(u"User"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL, size=(800, 800))
|
self.list = widgets.list(self, _("User"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL, size=(800, 800))
|
||||||
|
|
||||||
def __init__(self, parent, name):
|
def __init__(self, parent, name):
|
||||||
super(peoplePanel, self).__init__(parent, name)
|
super(peoplePanel, self).__init__(parent, name)
|
||||||
self.type = "people"
|
self.type = "people"
|
||||||
self.reply.SetLabel(_(u"Mention"))
|
self.reply.SetLabel(_("Mention"))
|
||||||
self.retweet.Disable()
|
self.retweet.Disable()
|
||||||
|
@ -5,7 +5,7 @@ from multiplatform_widgets import widgets
|
|||||||
class trendsPanel(wx.Panel):
|
class trendsPanel(wx.Panel):
|
||||||
def create_list(self):
|
def create_list(self):
|
||||||
""" Returns the list for put the tweets here."""
|
""" Returns the list for put the tweets here."""
|
||||||
self.list = widgets.list(self, _(u"Trending topic"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES)
|
self.list = widgets.list(self, _("Trending topic"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES)
|
||||||
self.list.set_windows_size(0, 30)
|
self.list.set_windows_size(0, 30)
|
||||||
self.list.set_size()
|
self.list.set_size()
|
||||||
|
|
||||||
@ -14,9 +14,9 @@ class trendsPanel(wx.Panel):
|
|||||||
self.type = "trends"
|
self.type = "trends"
|
||||||
self.sizer = wx.BoxSizer(wx.VERTICAL)
|
self.sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.create_list()
|
self.create_list()
|
||||||
self.tweet = wx.Button(self, -1, _(u"Tweet"))
|
self.tweet = wx.Button(self, -1, _("Tweet"))
|
||||||
self.tweetTrendBtn = wx.Button(self, -1, _(u"Tweet about this trend"))
|
self.tweetTrendBtn = wx.Button(self, -1, _("Tweet about this trend"))
|
||||||
self.search_topic = wx.Button(self, -1, _(u"Search topic"))
|
self.search_topic = wx.Button(self, -1, _("Search topic"))
|
||||||
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
btnSizer.Add(self.tweet, 0, wx.ALL, 5)
|
btnSizer.Add(self.tweet, 0, wx.ALL, 5)
|
||||||
btnSizer.Add(self.tweetTrendBtn, 0, wx.ALL, 5)
|
btnSizer.Add(self.tweetTrendBtn, 0, wx.ALL, 5)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
import wx
|
import wx
|
||||||
from .base import basePanel
|
from .base import basePanel
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
import wx
|
import wx
|
||||||
from .tweet_searches import searchPanel
|
from .tweet_searches import searchPanel
|
||||||
from multiplatform_widgets import widgets
|
from multiplatform_widgets import widgets
|
||||||
@ -7,7 +7,7 @@ from multiplatform_widgets import widgets
|
|||||||
class searchUsersPanel(searchPanel):
|
class searchUsersPanel(searchPanel):
|
||||||
def create_list(self):
|
def create_list(self):
|
||||||
""" Returns the list for put the tweets here."""
|
""" Returns the list for put the tweets here."""
|
||||||
self.list = widgets.list(self, _(u"User"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL, size=(800, 800))
|
self.list = widgets.list(self, _("User"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL, size=(800, 800))
|
||||||
|
|
||||||
def __init__(self, parent, name):
|
def __init__(self, parent, name):
|
||||||
super(searchUsersPanel, self).__init__(parent, name)
|
super(searchUsersPanel, self).__init__(parent, name)
|
||||||
|
@ -3,80 +3,80 @@ import wx
|
|||||||
import application
|
import application
|
||||||
|
|
||||||
def retweet_as_link(parent):
|
def retweet_as_link(parent):
|
||||||
return wx.MessageDialog(parent, _(u"This retweet is over 140 characters. Would you like to post it as a mention to the poster with your comments and a link to the original tweet?"), application.name, wx.YES_NO|wx.ICON_QUESTION).ShowModal()
|
return wx.MessageDialog(parent, _("This retweet is over 140 characters. Would you like to post it as a mention to the poster with your comments and a link to the original tweet?"), application.name, wx.YES_NO|wx.ICON_QUESTION).ShowModal()
|
||||||
|
|
||||||
def retweet_question(parent):
|
def retweet_question(parent):
|
||||||
return wx.MessageDialog(parent, _(u"Would you like to add a comment to this tweet?"), _("Retweet"), wx.YES_NO|wx.CANCEL|wx.ICON_QUESTION).ShowModal()
|
return wx.MessageDialog(parent, _("Would you like to add a comment to this tweet?"), _("Retweet"), wx.YES_NO|wx.CANCEL|wx.ICON_QUESTION).ShowModal()
|
||||||
|
|
||||||
def delete_tweet_dialog(parent):
|
def delete_tweet_dialog(parent):
|
||||||
return wx.MessageDialog(parent, _(u"Do you really want to delete this tweet? It will be deleted from Twitter as well."), _(u"Delete"), wx.ICON_QUESTION|wx.YES_NO).ShowModal()
|
return wx.MessageDialog(parent, _("Do you really want to delete this tweet? It will be deleted from Twitter as well."), _("Delete"), wx.ICON_QUESTION|wx.YES_NO).ShowModal()
|
||||||
|
|
||||||
def exit_dialog(parent):
|
def exit_dialog(parent):
|
||||||
dlg = wx.MessageDialog(parent, _(u"Do you really want to close {0}?").format(application.name,), _(u"Exit"), wx.YES_NO|wx.ICON_QUESTION)
|
dlg = wx.MessageDialog(parent, _("Do you really want to close {0}?").format(application.name,), _("Exit"), wx.YES_NO|wx.ICON_QUESTION)
|
||||||
return dlg.ShowModal()
|
return dlg.ShowModal()
|
||||||
|
|
||||||
def needs_restart():
|
def needs_restart():
|
||||||
wx.MessageDialog(None, _(u" {0} must be restarted for these changes to take effect.").format(application.name,), _("Restart {0} ").format(application.name,), wx.OK).ShowModal()
|
wx.MessageDialog(None, _(" {0} must be restarted for these changes to take effect.").format(application.name,), _("Restart {0} ").format(application.name,), wx.OK).ShowModal()
|
||||||
|
|
||||||
def delete_user_from_db():
|
def delete_user_from_db():
|
||||||
return wx.MessageDialog(None, _(u"Are you sure you want to delete this user from the database? This user will not appear in autocomplete results anymore."), _(u"Confirm"), wx.YES_NO|wx.ICON_QUESTION).ShowModal()
|
return wx.MessageDialog(None, _("Are you sure you want to delete this user from the database? This user will not appear in autocomplete results anymore."), _("Confirm"), wx.YES_NO|wx.ICON_QUESTION).ShowModal()
|
||||||
|
|
||||||
def get_ignored_client():
|
def get_ignored_client():
|
||||||
entry = wx.TextEntryDialog(None, _(u"Enter the name of the client : "), _(u"Add client"))
|
entry = wx.TextEntryDialog(None, _("Enter the name of the client : "), _("Add client"))
|
||||||
if entry.ShowModal() == wx.ID_OK:
|
if entry.ShowModal() == wx.ID_OK:
|
||||||
return entry.GetValue()
|
return entry.GetValue()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def clear_list():
|
def clear_list():
|
||||||
dlg = wx.MessageDialog(None, _(u"Do you really want to empty this buffer? It's items will be removed from the list but not from Twitter"), _(u"Empty buffer"), wx.ICON_QUESTION|wx.YES_NO)
|
dlg = wx.MessageDialog(None, _("Do you really want to empty this buffer? It's items will be removed from the list but not from Twitter"), _("Empty buffer"), wx.ICON_QUESTION|wx.YES_NO)
|
||||||
return dlg.ShowModal()
|
return dlg.ShowModal()
|
||||||
|
|
||||||
def remove_buffer():
|
def remove_buffer():
|
||||||
return wx.MessageDialog(None, _(u"Do you really want to destroy this buffer?"), _(u"Attention"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal()
|
return wx.MessageDialog(None, _("Do you really want to destroy this buffer?"), _("Attention"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal()
|
||||||
|
|
||||||
def user_not_exist():
|
def user_not_exist():
|
||||||
return wx.MessageDialog(None, _(u"That user does not exist"), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _("That user does not exist"), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def timeline_exist():
|
def timeline_exist():
|
||||||
return wx.MessageDialog(None, _(u"A timeline for this user already exists. You can't open another"), _(u"Existing timeline"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _("A timeline for this user already exists. You can't open another"), _("Existing timeline"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def no_tweets():
|
def no_tweets():
|
||||||
return wx.MessageDialog(None, _(u"This user has no tweets, so you can't open a timeline for them."), _(u"Error!"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _("This user has no tweets, so you can't open a timeline for them."), _("Error!"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def protected_user():
|
def protected_user():
|
||||||
return wx.MessageDialog(None, _(u"This is a protected Twitter user, which means you can't open a timeline using the Streaming API. The user's tweets will not update due to a twitter policy. Do you want to continue?"), _(u"Warning"), wx.ICON_WARNING|wx.YES_NO).ShowModal()
|
return wx.MessageDialog(None, _("This is a protected Twitter user, which means you can't open a timeline using the Streaming API. The user's tweets will not update due to a twitter policy. Do you want to continue?"), _("Warning"), wx.ICON_WARNING|wx.YES_NO).ShowModal()
|
||||||
|
|
||||||
def no_following():
|
def no_following():
|
||||||
return wx.MessageDialog(None, _(u"This is a protected user account, you need to follow this user to view their tweets or likes."), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _("This is a protected user account, you need to follow this user to view their tweets or likes."), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def donation():
|
def donation():
|
||||||
dlg = wx.MessageDialog(None, _(u"If you like {0} we need your help to keep it going. Help us by donating to the project. This will help us pay for the server, the domain and some other things to ensure that {0} will be actively maintained. Your donation will give us the means to continue the development of {0}, and to keep {0} free. Would you like to donate now?").format(application.name), _(u"We need your help"), wx.ICON_QUESTION|wx.YES_NO)
|
dlg = wx.MessageDialog(None, _("If you like {0} we need your help to keep it going. Help us by donating to the project. This will help us pay for the server, the domain and some other things to ensure that {0} will be actively maintained. Your donation will give us the means to continue the development of {0}, and to keep {0} free. Would you like to donate now?").format(application.name), _("We need your help"), wx.ICON_QUESTION|wx.YES_NO)
|
||||||
return dlg.ShowModal()
|
return dlg.ShowModal()
|
||||||
|
|
||||||
def no_tweets():
|
def no_tweets():
|
||||||
return wx.MessageDialog(None, _(u"This user has no tweets. {0} can't create a timeline.").format(application.name), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _("This user has no tweets. {0} can't create a timeline.").format(application.name), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def no_favs():
|
def no_favs():
|
||||||
return wx.MessageDialog(None, _(u"This user has no favorited tweets. {0} can't create a timeline.").format(application.name), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _("This user has no favorited tweets. {0} can't create a timeline.").format(application.name), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def no_followers():
|
def no_followers():
|
||||||
return wx.MessageDialog(None, _(u"This user has no followers. {0} can't create a timeline.").format(application.name), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _("This user has no followers. {0} can't create a timeline.").format(application.name), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def no_friends():
|
def no_friends():
|
||||||
return wx.MessageDialog(None, _(u"This user has no friends. {0} can't create a timeline.").format(application.name), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _("This user has no friends. {0} can't create a timeline.").format(application.name), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def view_geodata(geotext):
|
def view_geodata(geotext):
|
||||||
"""Specific message dialog to display geolocation data"""
|
"""Specific message dialog to display geolocation data"""
|
||||||
return wx.MessageDialog(None, _(u"Geolocation data: {0}").format(geotext), _(u"Geo data for this tweet")).ShowModal()
|
return wx.MessageDialog(None, _("Geolocation data: {0}").format(geotext), _("Geo data for this tweet")).ShowModal()
|
||||||
|
|
||||||
def changed_keymap():
|
def changed_keymap():
|
||||||
return wx.MessageDialog(None, _(u"TWBlue has detected that you're running windows 10 and has changed the default keymap to the Windows 10 keymap. It means that some keyboard shorcuts could be different. Please check the keystroke editor by pressing Alt+Win+K to see all available keystrokes for this keymap."), _(u"Information"), wx.OK).ShowModal()
|
return wx.MessageDialog(None, _("TWBlue has detected that you're running windows 10 and has changed the default keymap to the Windows 10 keymap. It means that some keyboard shorcuts could be different. Please check the keystroke editor by pressing Alt+Win+K to see all available keystrokes for this keymap."), _("Information"), wx.OK).ShowModal()
|
||||||
|
|
||||||
def unauthorized():
|
def unauthorized():
|
||||||
return wx.MessageDialog(None, _(u"You have been blocked from viewing this content"), _(u"Error"), wx.OK).ShowModal()
|
return wx.MessageDialog(None, _("You have been blocked from viewing this content"), _("Error"), wx.OK).ShowModal()
|
||||||
|
|
||||||
def blocked_timeline():
|
def blocked_timeline():
|
||||||
return wx.MessageDialog(None, _(u"You have been blocked from viewing someone's content. In order to avoid conflicts with the full session, TWBlue will remove the affected timeline."), _(u"Error"), wx.OK).ShowModal()
|
return wx.MessageDialog(None, _("You have been blocked from viewing someone's content. In order to avoid conflicts with the full session, TWBlue will remove the affected timeline."), _("Error"), wx.OK).ShowModal()
|
||||||
|
|
||||||
def suspended_user():
|
def suspended_user():
|
||||||
return wx.MessageDialog(None, _(u"TWBlue cannot load this timeline because the user has been suspended from Twitter."), _(u"Error"), wx.OK).ShowModal()
|
return wx.MessageDialog(None, _("TWBlue cannot load this timeline because the user has been suspended from Twitter."), _("Error"), wx.OK).ShowModal()
|
@ -1,2 +1,2 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
from . import baseDialog, trends, configuration, lists, message, search, find, show_user, update_profile, urlList, userSelection, utils
|
from . import baseDialog, trends, configuration, lists, message, search, find, show_user, update_profile, urlList, userSelection, utils
|
||||||
|
@ -6,18 +6,18 @@ from multiplatform_widgets import widgets
|
|||||||
|
|
||||||
class attachDialog(widgetUtils.BaseDialog):
|
class attachDialog(widgetUtils.BaseDialog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(attachDialog, self).__init__(None, title=_(u"Add an attachment"))
|
super(attachDialog, self).__init__(None, title=_("Add an attachment"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
lbl1 = wx.StaticText(panel, wx.NewId(), _(u"Attachments"))
|
lbl1 = wx.StaticText(panel, wx.NewId(), _("Attachments"))
|
||||||
self.attachments = widgets.list(panel, _(u"Type"), _(u"Title"), style=wx.LC_REPORT)
|
self.attachments = widgets.list(panel, _("Type"), _("Title"), style=wx.LC_REPORT)
|
||||||
box = wx.BoxSizer(wx.HORIZONTAL)
|
box = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
box.Add(lbl1, 0, wx.ALL, 5)
|
box.Add(lbl1, 0, wx.ALL, 5)
|
||||||
box.Add(self.attachments.list, 0, wx.ALL, 5)
|
box.Add(self.attachments.list, 0, wx.ALL, 5)
|
||||||
sizer.Add(box, 0, wx.ALL, 5)
|
sizer.Add(box, 0, wx.ALL, 5)
|
||||||
static = wx.StaticBox(panel, label=_(u"Add attachments"))
|
static = wx.StaticBox(panel, label=_("Add attachments"))
|
||||||
self.photo = wx.Button(panel, wx.NewId(), _(u"&Photo"))
|
self.photo = wx.Button(panel, wx.NewId(), _("&Photo"))
|
||||||
self.remove = wx.Button(panel, wx.NewId(), _(u"Remove attachment"))
|
self.remove = wx.Button(panel, wx.NewId(), _("Remove attachment"))
|
||||||
self.remove.Enable(False)
|
self.remove.Enable(False)
|
||||||
btnsizer = wx.StaticBoxSizer(static, wx.HORIZONTAL)
|
btnsizer = wx.StaticBoxSizer(static, wx.HORIZONTAL)
|
||||||
btnsizer.Add(self.photo, 0, wx.ALL, 5)
|
btnsizer.Add(self.photo, 0, wx.ALL, 5)
|
||||||
@ -33,14 +33,14 @@ class attachDialog(widgetUtils.BaseDialog):
|
|||||||
self.SetClientSize(sizer.CalcMin())
|
self.SetClientSize(sizer.CalcMin())
|
||||||
|
|
||||||
def get_image(self):
|
def get_image(self):
|
||||||
openFileDialog = wx.FileDialog(self, _(u"Select the picture to be uploaded"), "", "", _("Image files (*.png, *.jpg, *.gif)|*.png; *.jpg; *.gif"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
openFileDialog = wx.FileDialog(self, _("Select the picture to be uploaded"), "", "", _("Image files (*.png, *.jpg, *.gif)|*.png; *.jpg; *.gif"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
||||||
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
||||||
return (None, None)
|
return (None, None)
|
||||||
dsc = self.ask_description()
|
dsc = self.ask_description()
|
||||||
return (openFileDialog.GetPath(), dsc)
|
return (openFileDialog.GetPath(), dsc)
|
||||||
|
|
||||||
def ask_description(self):
|
def ask_description(self):
|
||||||
dlg = wx.TextEntryDialog(self, _(u"please provide a description"), _(u"Description"), defaultValue="")
|
dlg = wx.TextEntryDialog(self, _("please provide a description"), _("Description"), defaultValue="")
|
||||||
dlg.ShowModal()
|
dlg.ShowModal()
|
||||||
result = dlg.GetValue()
|
result = dlg.GetValue()
|
||||||
dlg.Destroy()
|
dlg.Destroy()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from builtins import range
|
from builtins import range
|
||||||
from . import baseDialog
|
from . import baseDialog
|
||||||
@ -14,36 +14,36 @@ class general(wx.Panel, baseDialog.BaseWXDialog):
|
|||||||
def __init__(self, parent, languages,keymaps):
|
def __init__(self, parent, languages,keymaps):
|
||||||
super(general, self).__init__(parent)
|
super(general, self).__init__(parent)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
language = wx.StaticText(self, -1, _(u"Language"))
|
language = wx.StaticText(self, -1, _("Language"))
|
||||||
self.language = wx.ListBox(self, -1, choices=languages)
|
self.language = wx.ListBox(self, -1, choices=languages)
|
||||||
self.language.SetSize(self.language.GetBestSize())
|
self.language.SetSize(self.language.GetBestSize())
|
||||||
langBox = wx.BoxSizer(wx.HORIZONTAL)
|
langBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
langBox.Add(language, 0, wx.ALL, 5)
|
langBox.Add(language, 0, wx.ALL, 5)
|
||||||
langBox.Add(self.language, 0, wx.ALL, 5)
|
langBox.Add(self.language, 0, wx.ALL, 5)
|
||||||
sizer.Add(langBox, 0, wx.ALL, 5)
|
sizer.Add(langBox, 0, wx.ALL, 5)
|
||||||
self.autostart = wx.CheckBox(self, -1, _(u"Run {0} at Windows startup").format(application.name,))
|
self.autostart = wx.CheckBox(self, -1, _("Run {0} at Windows startup").format(application.name,))
|
||||||
self.ask_at_exit = wx.CheckBox(self, -1, _(U"ask before exiting {0}").format(application.name,))
|
self.ask_at_exit = wx.CheckBox(self, -1, _("ask before exiting {0}").format(application.name,))
|
||||||
sizer.Add(self.autostart, 0, wx.ALL, 5)
|
sizer.Add(self.autostart, 0, wx.ALL, 5)
|
||||||
sizer.Add(self.ask_at_exit, 0, wx.ALL, 5)
|
sizer.Add(self.ask_at_exit, 0, wx.ALL, 5)
|
||||||
self.play_ready_sound = wx.CheckBox(self, -1, _(U"Play a sound when {0} launches").format(application.name,))
|
self.play_ready_sound = wx.CheckBox(self, -1, _("Play a sound when {0} launches").format(application.name,))
|
||||||
sizer.Add(self.play_ready_sound, 0, wx.ALL, 5)
|
sizer.Add(self.play_ready_sound, 0, wx.ALL, 5)
|
||||||
self.speak_ready_msg = wx.CheckBox(self, -1, _(U"Speak a message when {0} launches").format(application.name,))
|
self.speak_ready_msg = wx.CheckBox(self, -1, _("Speak a message when {0} launches").format(application.name,))
|
||||||
sizer.Add(self.speak_ready_msg, 0, wx.ALL, 5)
|
sizer.Add(self.speak_ready_msg, 0, wx.ALL, 5)
|
||||||
self.use_invisible_shorcuts = wx.CheckBox(self, -1, _(u"Use invisible interface's keyboard shortcuts while GUI is visible"))
|
self.use_invisible_shorcuts = wx.CheckBox(self, -1, _("Use invisible interface's keyboard shortcuts while GUI is visible"))
|
||||||
sizer.Add(self.use_invisible_shorcuts, 0, wx.ALL, 5)
|
sizer.Add(self.use_invisible_shorcuts, 0, wx.ALL, 5)
|
||||||
self.disable_sapi5 = wx.CheckBox(self, -1, _(u"Activate Sapi5 when any other screen reader is not being run"))
|
self.disable_sapi5 = wx.CheckBox(self, -1, _("Activate Sapi5 when any other screen reader is not being run"))
|
||||||
sizer.Add(self.disable_sapi5, 0, wx.ALL, 5)
|
sizer.Add(self.disable_sapi5, 0, wx.ALL, 5)
|
||||||
self.hide_gui = wx.CheckBox(self, -1, _(u"Hide GUI on launch"))
|
self.hide_gui = wx.CheckBox(self, -1, _("Hide GUI on launch"))
|
||||||
sizer.Add(self.hide_gui, 0, wx.ALL, 5)
|
sizer.Add(self.hide_gui, 0, wx.ALL, 5)
|
||||||
self.handle_longtweets = wx.CheckBox(self, wx.NewId(), _(u"Use Codeofdusk's longtweet handlers (may decrease client performance)"))
|
self.handle_longtweets = wx.CheckBox(self, wx.NewId(), _("Use Codeofdusk's longtweet handlers (may decrease client performance)"))
|
||||||
sizer.Add(self.handle_longtweets, 0, wx.ALL, 5)
|
sizer.Add(self.handle_longtweets, 0, wx.ALL, 5)
|
||||||
kmbox = wx.BoxSizer(wx.VERTICAL)
|
kmbox = wx.BoxSizer(wx.VERTICAL)
|
||||||
km_label = wx.StaticText(self, -1, _(u"Keymap"))
|
km_label = wx.StaticText(self, -1, _("Keymap"))
|
||||||
self.km = wx.ComboBox(self, -1, choices=keymaps, style=wx.CB_READONLY)
|
self.km = wx.ComboBox(self, -1, choices=keymaps, style=wx.CB_READONLY)
|
||||||
self.km.SetSize(self.km.GetBestSize())
|
self.km.SetSize(self.km.GetBestSize())
|
||||||
kmbox.Add(km_label, 0, wx.ALL, 5)
|
kmbox.Add(km_label, 0, wx.ALL, 5)
|
||||||
kmbox.Add(self.km, 0, wx.ALL, 5)
|
kmbox.Add(self.km, 0, wx.ALL, 5)
|
||||||
self.check_for_updates = wx.CheckBox(self, -1, _(U"Check for updates when {0} launches").format(application.name,))
|
self.check_for_updates = wx.CheckBox(self, -1, _("Check for updates when {0} launches").format(application.name,))
|
||||||
sizer.Add(self.check_for_updates, 0, wx.ALL, 5)
|
sizer.Add(self.check_for_updates, 0, wx.ALL, 5)
|
||||||
sizer.Add(kmbox, 0, wx.ALL, 5)
|
sizer.Add(kmbox, 0, wx.ALL, 5)
|
||||||
self.SetSizer(sizer)
|
self.SetSizer(sizer)
|
||||||
@ -53,32 +53,32 @@ class proxy(wx.Panel, baseDialog.BaseWXDialog):
|
|||||||
def __init__(self, parent, proxyTypes):
|
def __init__(self, parent, proxyTypes):
|
||||||
super(proxy, self).__init__(parent)
|
super(proxy, self).__init__(parent)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
type=wx.StaticText(self, wx.NewId(), _(u"Proxy type: "))
|
type=wx.StaticText(self, wx.NewId(), _("Proxy type: "))
|
||||||
self.type=wx.ComboBox(self, -1, choices=proxyTypes, style=wx.CB_READONLY)
|
self.type=wx.ComboBox(self, -1, choices=proxyTypes, style=wx.CB_READONLY)
|
||||||
self.type.SetSize(self.type.GetBestSize())
|
self.type.SetSize(self.type.GetBestSize())
|
||||||
typeBox = wx.BoxSizer(wx.HORIZONTAL)
|
typeBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
typeBox.Add(type, 0, wx.ALL, 5)
|
typeBox.Add(type, 0, wx.ALL, 5)
|
||||||
typeBox.Add(self.type, 0, wx.ALL, 5)
|
typeBox.Add(self.type, 0, wx.ALL, 5)
|
||||||
sizer.Add(typeBox, 0, wx.ALL, 5)
|
sizer.Add(typeBox, 0, wx.ALL, 5)
|
||||||
lbl = wx.StaticText(self, wx.NewId(), _(u"Proxy server: "))
|
lbl = wx.StaticText(self, wx.NewId(), _("Proxy server: "))
|
||||||
self.server = wx.TextCtrl(self, -1)
|
self.server = wx.TextCtrl(self, -1)
|
||||||
serverBox = wx.BoxSizer(wx.HORIZONTAL)
|
serverBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
serverBox.Add(lbl, 0, wx.ALL, 5)
|
serverBox.Add(lbl, 0, wx.ALL, 5)
|
||||||
serverBox.Add(self.server, 0, wx.ALL, 5)
|
serverBox.Add(self.server, 0, wx.ALL, 5)
|
||||||
sizer.Add(serverBox, 0, wx.ALL, 5)
|
sizer.Add(serverBox, 0, wx.ALL, 5)
|
||||||
lbl = wx.StaticText(self, wx.NewId(), _(u"Port: "))
|
lbl = wx.StaticText(self, wx.NewId(), _("Port: "))
|
||||||
self.port = wx.TextCtrl(self, wx.NewId())
|
self.port = wx.TextCtrl(self, wx.NewId())
|
||||||
portBox = wx.BoxSizer(wx.HORIZONTAL)
|
portBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
portBox.Add(lbl, 0, wx.ALL, 5)
|
portBox.Add(lbl, 0, wx.ALL, 5)
|
||||||
portBox.Add(self.port, 0, wx.ALL, 5)
|
portBox.Add(self.port, 0, wx.ALL, 5)
|
||||||
sizer.Add(portBox, 0, wx.ALL, 5)
|
sizer.Add(portBox, 0, wx.ALL, 5)
|
||||||
lbl = wx.StaticText(self, wx.NewId(), _(u"User: "))
|
lbl = wx.StaticText(self, wx.NewId(), _("User: "))
|
||||||
self.user = wx.TextCtrl(self, wx.NewId())
|
self.user = wx.TextCtrl(self, wx.NewId())
|
||||||
userBox = wx.BoxSizer(wx.HORIZONTAL)
|
userBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
userBox.Add(lbl, 0, wx.ALL, 5)
|
userBox.Add(lbl, 0, wx.ALL, 5)
|
||||||
userBox.Add(self.user, 0, wx.ALL, 5)
|
userBox.Add(self.user, 0, wx.ALL, 5)
|
||||||
sizer.Add(userBox, 0, wx.ALL, 5)
|
sizer.Add(userBox, 0, wx.ALL, 5)
|
||||||
lbl = wx.StaticText(self, wx.NewId(), _(u"Password: "))
|
lbl = wx.StaticText(self, wx.NewId(), _("Password: "))
|
||||||
self.password = wx.TextCtrl(self, wx.NewId(), style=wx.TE_PASSWORD)
|
self.password = wx.TextCtrl(self, wx.NewId(), style=wx.TE_PASSWORD)
|
||||||
passwordBox = wx.BoxSizer(wx.HORIZONTAL)
|
passwordBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
passwordBox.Add(lbl, 0, wx.ALL, 5)
|
passwordBox.Add(lbl, 0, wx.ALL, 5)
|
||||||
@ -90,35 +90,35 @@ class generalAccount(wx.Panel, baseDialog.BaseWXDialog):
|
|||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
super(generalAccount, self).__init__(parent)
|
super(generalAccount, self).__init__(parent)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.au = wx.Button(self, wx.NewId(), _(u"Autocompletion settings..."))
|
self.au = wx.Button(self, wx.NewId(), _("Autocompletion settings..."))
|
||||||
sizer.Add(self.au, 0, wx.ALL, 5)
|
sizer.Add(self.au, 0, wx.ALL, 5)
|
||||||
self.relative_time = wx.CheckBox(self, wx.NewId(), _(U"Relative timestamps"))
|
self.relative_time = wx.CheckBox(self, wx.NewId(), _("Relative timestamps"))
|
||||||
sizer.Add(self.relative_time, 0, wx.ALL, 5)
|
sizer.Add(self.relative_time, 0, wx.ALL, 5)
|
||||||
apiCallsBox = wx.BoxSizer(wx.HORIZONTAL)
|
apiCallsBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
apiCallsBox.Add(wx.StaticText(self, -1, _(u"API calls (One API call = 200 tweets, two API calls = 400 tweets, etc):")), 0, wx.ALL, 5)
|
apiCallsBox.Add(wx.StaticText(self, -1, _("API calls (One API call = 200 tweets, two API calls = 400 tweets, etc):")), 0, wx.ALL, 5)
|
||||||
self.apiCalls = wx.SpinCtrl(self, wx.NewId())
|
self.apiCalls = wx.SpinCtrl(self, wx.NewId())
|
||||||
self.apiCalls.SetRange(1, 10)
|
self.apiCalls.SetRange(1, 10)
|
||||||
self.apiCalls.SetSize(self.apiCalls.GetBestSize())
|
self.apiCalls.SetSize(self.apiCalls.GetBestSize())
|
||||||
apiCallsBox.Add(self.apiCalls, 0, wx.ALL, 5)
|
apiCallsBox.Add(self.apiCalls, 0, wx.ALL, 5)
|
||||||
sizer.Add(apiCallsBox, 0, wx.ALL, 5)
|
sizer.Add(apiCallsBox, 0, wx.ALL, 5)
|
||||||
tweetsPerCallBox = wx.BoxSizer(wx.HORIZONTAL)
|
tweetsPerCallBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
tweetsPerCallBox.Add(wx.StaticText(self, -1, _(u"Items on each API call")), 0, wx.ALL, 5)
|
tweetsPerCallBox.Add(wx.StaticText(self, -1, _("Items on each API call")), 0, wx.ALL, 5)
|
||||||
self.itemsPerApiCall = wx.SpinCtrl(self, wx.NewId())
|
self.itemsPerApiCall = wx.SpinCtrl(self, wx.NewId())
|
||||||
self.itemsPerApiCall.SetRange(0, 200)
|
self.itemsPerApiCall.SetRange(0, 200)
|
||||||
self.itemsPerApiCall.SetSize(self.itemsPerApiCall.GetBestSize())
|
self.itemsPerApiCall.SetSize(self.itemsPerApiCall.GetBestSize())
|
||||||
tweetsPerCallBox.Add(self.itemsPerApiCall, 0, wx.ALL, 5)
|
tweetsPerCallBox.Add(self.itemsPerApiCall, 0, wx.ALL, 5)
|
||||||
sizer.Add(tweetsPerCallBox, 0, wx.ALL, 5)
|
sizer.Add(tweetsPerCallBox, 0, wx.ALL, 5)
|
||||||
self.reverse_timelines = wx.CheckBox(self, wx.NewId(), _(u"Inverted buffers: The newest tweets will be shown at the beginning while the oldest at the end"))
|
self.reverse_timelines = wx.CheckBox(self, wx.NewId(), _("Inverted buffers: The newest tweets will be shown at the beginning while the oldest at the end"))
|
||||||
sizer.Add(self.reverse_timelines, 0, wx.ALL, 5)
|
sizer.Add(self.reverse_timelines, 0, wx.ALL, 5)
|
||||||
lbl = wx.StaticText(self, wx.NewId(), _(u"Retweet mode"))
|
lbl = wx.StaticText(self, wx.NewId(), _("Retweet mode"))
|
||||||
self.retweet_mode = wx.ComboBox(self, wx.NewId(), choices=[_(u"Ask"), _(u"Retweet without comments"), _(u"Retweet with comments")], style=wx.CB_READONLY)
|
self.retweet_mode = wx.ComboBox(self, wx.NewId(), choices=[_("Ask"), _("Retweet without comments"), _("Retweet with comments")], style=wx.CB_READONLY)
|
||||||
rMode = wx.BoxSizer(wx.HORIZONTAL)
|
rMode = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
rMode.Add(lbl, 0, wx.ALL, 5)
|
rMode.Add(lbl, 0, wx.ALL, 5)
|
||||||
rMode.Add(self.retweet_mode, 0, wx.ALL, 5)
|
rMode.Add(self.retweet_mode, 0, wx.ALL, 5)
|
||||||
sizer.Add(rMode, 0, wx.ALL, 5)
|
sizer.Add(rMode, 0, wx.ALL, 5)
|
||||||
self.show_screen_names = wx.CheckBox(self, wx.NewId(), _(U"Show screen names instead of full names"))
|
self.show_screen_names = wx.CheckBox(self, wx.NewId(), _("Show screen names instead of full names"))
|
||||||
sizer.Add(self.show_screen_names, 0, wx.ALL, 5)
|
sizer.Add(self.show_screen_names, 0, wx.ALL, 5)
|
||||||
PersistSizeLabel = wx.StaticText(self, -1, _(u"Number of items per buffer to cache in database (0 to disable caching, blank for unlimited)"))
|
PersistSizeLabel = wx.StaticText(self, -1, _("Number of items per buffer to cache in database (0 to disable caching, blank for unlimited)"))
|
||||||
self.persist_size = wx.TextCtrl(self, -1)
|
self.persist_size = wx.TextCtrl(self, -1)
|
||||||
sizer.Add(PersistSizeLabel, 0, wx.ALL, 5)
|
sizer.Add(PersistSizeLabel, 0, wx.ALL, 5)
|
||||||
sizer.Add(self.persist_size, 0, wx.ALL, 5)
|
sizer.Add(self.persist_size, 0, wx.ALL, 5)
|
||||||
@ -128,12 +128,12 @@ class other_buffers(wx.Panel):
|
|||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
super(other_buffers, self).__init__(parent)
|
super(other_buffers, self).__init__(parent)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.buffers = widgets.list(self, _(u"Buffer"), _(u"Name"), _(u"Status"), style=wx.LC_SINGLE_SEL|wx.LC_REPORT)
|
self.buffers = widgets.list(self, _("Buffer"), _("Name"), _("Status"), style=wx.LC_SINGLE_SEL|wx.LC_REPORT)
|
||||||
sizer.Add(self.buffers.list, 0, wx.ALL, 5)
|
sizer.Add(self.buffers.list, 0, wx.ALL, 5)
|
||||||
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
self.toggle_state = wx.Button(self, -1, _(u"Show/hide"))
|
self.toggle_state = wx.Button(self, -1, _("Show/hide"))
|
||||||
self.up = wx.Button(self, -1, _(u"Move up"))
|
self.up = wx.Button(self, -1, _("Move up"))
|
||||||
self.down = wx.Button(self, -1, _(u"Move down"))
|
self.down = wx.Button(self, -1, _("Move down"))
|
||||||
btnSizer.Add(self.toggle_state, 0, wx.ALL, 5)
|
btnSizer.Add(self.toggle_state, 0, wx.ALL, 5)
|
||||||
btnSizer.Add(self.up, 0, wx.ALL, 5)
|
btnSizer.Add(self.up, 0, wx.ALL, 5)
|
||||||
btnSizer.Add(self.down, 0, wx.ALL, 5)
|
btnSizer.Add(self.down, 0, wx.ALL, 5)
|
||||||
@ -143,9 +143,9 @@ class other_buffers(wx.Panel):
|
|||||||
def insert_buffers(self, buffers):
|
def insert_buffers(self, buffers):
|
||||||
for i in buffers:
|
for i in buffers:
|
||||||
if i[2] == True:
|
if i[2] == True:
|
||||||
self.buffers.insert_item(False, *[i[0], i[1], _(u"Show")])
|
self.buffers.insert_item(False, *[i[0], i[1], _("Show")])
|
||||||
else:
|
else:
|
||||||
self.buffers.insert_item(False, *[i[0], i[1], _(u"Hide")])
|
self.buffers.insert_item(False, *[i[0], i[1], _("Hide")])
|
||||||
|
|
||||||
def connect_hook_func(self, func):
|
def connect_hook_func(self, func):
|
||||||
self.buffers.list.Bind(wx.EVT_CHAR_HOOK, func)
|
self.buffers.list.Bind(wx.EVT_CHAR_HOOK, func)
|
||||||
@ -153,13 +153,13 @@ class other_buffers(wx.Panel):
|
|||||||
def move_up(self, *args, **kwargs):
|
def move_up(self, *args, **kwargs):
|
||||||
current = self.buffers.get_selected()
|
current = self.buffers.get_selected()
|
||||||
if current == -1:
|
if current == -1:
|
||||||
output.speak(_(u"Select a buffer first."), True)
|
output.speak(_("Select a buffer first."), True)
|
||||||
return False
|
return False
|
||||||
if self.buffers.get_text_column(current, 2) == _(u"Hide"):
|
if self.buffers.get_text_column(current, 2) == _("Hide"):
|
||||||
output.speak(_(u"The buffer is hidden, show it first."), True)
|
output.speak(_("The buffer is hidden, show it first."), True)
|
||||||
return False
|
return False
|
||||||
if current <= 0:
|
if current <= 0:
|
||||||
output.speak(_(u"The buffer is already at the top of the list."), True)
|
output.speak(_("The buffer is already at the top of the list."), True)
|
||||||
return False
|
return False
|
||||||
current_text = self.buffers.get_text_column(self.buffers.get_selected(), 0)
|
current_text = self.buffers.get_text_column(self.buffers.get_selected(), 0)
|
||||||
current_name = self.buffers.get_text_column(self.buffers.get_selected(), 1)
|
current_name = self.buffers.get_text_column(self.buffers.get_selected(), 1)
|
||||||
@ -177,13 +177,13 @@ class other_buffers(wx.Panel):
|
|||||||
def move_down(self, *args, **kwargs):
|
def move_down(self, *args, **kwargs):
|
||||||
current = self.buffers.get_selected()
|
current = self.buffers.get_selected()
|
||||||
if current == -1:
|
if current == -1:
|
||||||
output.speak(_(u"Select a buffer first."), True)
|
output.speak(_("Select a buffer first."), True)
|
||||||
return False
|
return False
|
||||||
if self.buffers.get_text_column(current, 2) == _(u"Hide"):
|
if self.buffers.get_text_column(current, 2) == _("Hide"):
|
||||||
output.speak(_(u"The buffer is hidden, show it first."), True)
|
output.speak(_("The buffer is hidden, show it first."), True)
|
||||||
return False
|
return False
|
||||||
if current+1 >= self.buffers.get_count():
|
if current+1 >= self.buffers.get_count():
|
||||||
output.speak(_(u"The buffer is already at the bottom of the list."), True)
|
output.speak(_("The buffer is already at the bottom of the list."), True)
|
||||||
return False
|
return False
|
||||||
current_text = self.buffers.get_text_column(self.buffers.get_selected(), 0)
|
current_text = self.buffers.get_text_column(self.buffers.get_selected(), 0)
|
||||||
current_name = self.buffers.get_text_column(self.buffers.get_selected(), 1)
|
current_name = self.buffers.get_text_column(self.buffers.get_selected(), 1)
|
||||||
@ -208,15 +208,15 @@ class other_buffers(wx.Panel):
|
|||||||
def change_selected_item(self):
|
def change_selected_item(self):
|
||||||
current = self.buffers.get_selected()
|
current = self.buffers.get_selected()
|
||||||
text = self.buffers.get_text_column(current, 2)
|
text = self.buffers.get_text_column(current, 2)
|
||||||
if text == _(u"Show"):
|
if text == _("Show"):
|
||||||
self.buffers.set_text_column(current, 2, _(u"Hide"))
|
self.buffers.set_text_column(current, 2, _("Hide"))
|
||||||
else:
|
else:
|
||||||
self.buffers.set_text_column(current, 2, _(u"Show"))
|
self.buffers.set_text_column(current, 2, _("Show"))
|
||||||
output.speak(self.buffers.get_text_column(current, 2),True)
|
output.speak(self.buffers.get_text_column(current, 2),True)
|
||||||
def get_list(self):
|
def get_list(self):
|
||||||
buffers_list = []
|
buffers_list = []
|
||||||
for i in range(0, self.buffers.get_count()):
|
for i in range(0, self.buffers.get_count()):
|
||||||
if self.buffers.get_text_column(i, 2) == _(u"Show"):
|
if self.buffers.get_text_column(i, 2) == _("Show"):
|
||||||
buffers_list.append(self.buffers.get_text_column(i, 0))
|
buffers_list.append(self.buffers.get_text_column(i, 0))
|
||||||
return buffers_list
|
return buffers_list
|
||||||
|
|
||||||
@ -224,14 +224,14 @@ class ignoredClients(wx.Panel):
|
|||||||
def __init__(self, parent, choices):
|
def __init__(self, parent, choices):
|
||||||
super(ignoredClients, self).__init__(parent=parent)
|
super(ignoredClients, self).__init__(parent=parent)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
label = wx.StaticText(self, -1, _(u"Ignored clients"))
|
label = wx.StaticText(self, -1, _("Ignored clients"))
|
||||||
self.clients = wx.ListBox(self, -1, choices=choices)
|
self.clients = wx.ListBox(self, -1, choices=choices)
|
||||||
self.clients.SetSize(self.clients.GetBestSize())
|
self.clients.SetSize(self.clients.GetBestSize())
|
||||||
clientsBox = wx.BoxSizer(wx.HORIZONTAL)
|
clientsBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
clientsBox.Add(label, 0, wx.ALL, 5)
|
clientsBox.Add(label, 0, wx.ALL, 5)
|
||||||
clientsBox.Add(self.clients, 0, wx.ALL, 5)
|
clientsBox.Add(self.clients, 0, wx.ALL, 5)
|
||||||
self.add = wx.Button(self, -1, _(u"Add client"))
|
self.add = wx.Button(self, -1, _("Add client"))
|
||||||
self.remove = wx.Button(self, -1, _(u"Remove client"))
|
self.remove = wx.Button(self, -1, _("Remove client"))
|
||||||
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
btnBox.Add(self.add, 0, wx.ALL, 5)
|
btnBox.Add(self.add, 0, wx.ALL, 5)
|
||||||
btnBox.Add(self.remove, 0, wx.ALL, 5)
|
btnBox.Add(self.remove, 0, wx.ALL, 5)
|
||||||
@ -255,7 +255,7 @@ class sound(wx.Panel):
|
|||||||
def __init__(self, parent, input_devices, output_devices, soundpacks):
|
def __init__(self, parent, input_devices, output_devices, soundpacks):
|
||||||
wx.Panel.__init__(self, parent)
|
wx.Panel.__init__(self, parent)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
volume = wx.StaticText(self, -1, _(u"Volume"))
|
volume = wx.StaticText(self, -1, _("Volume"))
|
||||||
self.volumeCtrl = wx.Slider(self)
|
self.volumeCtrl = wx.Slider(self)
|
||||||
self.volumeCtrl.SetRange(0, 100)
|
self.volumeCtrl.SetRange(0, 100)
|
||||||
self.volumeCtrl.SetSize(self.volumeCtrl.GetBestSize())
|
self.volumeCtrl.SetSize(self.volumeCtrl.GetBestSize())
|
||||||
@ -263,16 +263,16 @@ class sound(wx.Panel):
|
|||||||
volumeBox.Add(volume, 0, wx.ALL, 5)
|
volumeBox.Add(volume, 0, wx.ALL, 5)
|
||||||
volumeBox.Add(self.volumeCtrl, 0, wx.ALL, 5)
|
volumeBox.Add(self.volumeCtrl, 0, wx.ALL, 5)
|
||||||
sizer.Add(volumeBox, 0, wx.ALL, 5)
|
sizer.Add(volumeBox, 0, wx.ALL, 5)
|
||||||
self.session_mute = wx.CheckBox(self, -1, _(u"Session mute"))
|
self.session_mute = wx.CheckBox(self, -1, _("Session mute"))
|
||||||
sizer.Add(self.session_mute, 0, wx.ALL, 5)
|
sizer.Add(self.session_mute, 0, wx.ALL, 5)
|
||||||
output_label = wx.StaticText(self, -1, _(u"Output device"))
|
output_label = wx.StaticText(self, -1, _("Output device"))
|
||||||
self.output = wx.ComboBox(self, -1, choices=output_devices, style=wx.CB_READONLY)
|
self.output = wx.ComboBox(self, -1, choices=output_devices, style=wx.CB_READONLY)
|
||||||
self.output.SetSize(self.output.GetBestSize())
|
self.output.SetSize(self.output.GetBestSize())
|
||||||
outputBox = wx.BoxSizer(wx.HORIZONTAL)
|
outputBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
outputBox.Add(output_label, 0, wx.ALL, 5)
|
outputBox.Add(output_label, 0, wx.ALL, 5)
|
||||||
outputBox.Add(self.output, 0, wx.ALL, 5)
|
outputBox.Add(self.output, 0, wx.ALL, 5)
|
||||||
sizer.Add(outputBox, 0, wx.ALL, 5)
|
sizer.Add(outputBox, 0, wx.ALL, 5)
|
||||||
input_label = wx.StaticText(self, -1, _(u"Input device"))
|
input_label = wx.StaticText(self, -1, _("Input device"))
|
||||||
self.input = wx.ComboBox(self, -1, choices=input_devices, style=wx.CB_READONLY)
|
self.input = wx.ComboBox(self, -1, choices=input_devices, style=wx.CB_READONLY)
|
||||||
self.input.SetSize(self.input.GetBestSize())
|
self.input.SetSize(self.input.GetBestSize())
|
||||||
inputBox = wx.BoxSizer(wx.HORIZONTAL)
|
inputBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
@ -280,17 +280,17 @@ class sound(wx.Panel):
|
|||||||
inputBox.Add(self.input, 0, wx.ALL, 5)
|
inputBox.Add(self.input, 0, wx.ALL, 5)
|
||||||
sizer.Add(inputBox, 0, wx.ALL, 5)
|
sizer.Add(inputBox, 0, wx.ALL, 5)
|
||||||
soundBox = wx.BoxSizer(wx.VERTICAL)
|
soundBox = wx.BoxSizer(wx.VERTICAL)
|
||||||
soundpack_label = wx.StaticText(self, -1, _(u"Sound pack"))
|
soundpack_label = wx.StaticText(self, -1, _("Sound pack"))
|
||||||
self.soundpack = wx.ComboBox(self, -1, choices=soundpacks, style=wx.CB_READONLY)
|
self.soundpack = wx.ComboBox(self, -1, choices=soundpacks, style=wx.CB_READONLY)
|
||||||
self.soundpack.SetSize(self.soundpack.GetBestSize())
|
self.soundpack.SetSize(self.soundpack.GetBestSize())
|
||||||
soundBox.Add(soundpack_label, 0, wx.ALL, 5)
|
soundBox.Add(soundpack_label, 0, wx.ALL, 5)
|
||||||
soundBox.Add(self.soundpack, 0, wx.ALL, 5)
|
soundBox.Add(self.soundpack, 0, wx.ALL, 5)
|
||||||
sizer.Add(soundBox, 0, wx.ALL, 5)
|
sizer.Add(soundBox, 0, wx.ALL, 5)
|
||||||
self.indicate_audio = wx.CheckBox(self, -1, _(u"Indicate audio tweets with sound"))
|
self.indicate_audio = wx.CheckBox(self, -1, _("Indicate audio tweets with sound"))
|
||||||
sizer.Add(self.indicate_audio, 0, wx.ALL, 5)
|
sizer.Add(self.indicate_audio, 0, wx.ALL, 5)
|
||||||
self.indicate_geo = wx.CheckBox(self, -1, _(u"Indicate geotweets with sound"))
|
self.indicate_geo = wx.CheckBox(self, -1, _("Indicate geotweets with sound"))
|
||||||
sizer.Add(self.indicate_geo, 0, wx.ALL, 5)
|
sizer.Add(self.indicate_geo, 0, wx.ALL, 5)
|
||||||
self.indicate_img = wx.CheckBox(self, -1, _(u"Indicate tweets containing images with sound"))
|
self.indicate_img = wx.CheckBox(self, -1, _("Indicate tweets containing images with sound"))
|
||||||
sizer.Add(self.indicate_img, 0, wx.ALL, 5)
|
sizer.Add(self.indicate_img, 0, wx.ALL, 5)
|
||||||
self.SetSizer(sizer)
|
self.SetSizer(sizer)
|
||||||
|
|
||||||
@ -301,13 +301,13 @@ class extrasPanel(wx.Panel):
|
|||||||
def __init__(self, parent, ocr_languages=[], translation_languages=[]):
|
def __init__(self, parent, ocr_languages=[], translation_languages=[]):
|
||||||
super(extrasPanel, self).__init__(parent)
|
super(extrasPanel, self).__init__(parent)
|
||||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
OCRBox = wx.StaticBox(self, label=_(u"Language for OCR"))
|
OCRBox = wx.StaticBox(self, label=_("Language for OCR"))
|
||||||
self.ocr_lang = wx.ListBox(self, -1, choices=ocr_languages)
|
self.ocr_lang = wx.ListBox(self, -1, choices=ocr_languages)
|
||||||
self.ocr_lang.SetSize(self.ocr_lang.GetBestSize())
|
self.ocr_lang.SetSize(self.ocr_lang.GetBestSize())
|
||||||
ocrLanguageSizer = wx.StaticBoxSizer(OCRBox, wx.HORIZONTAL)
|
ocrLanguageSizer = wx.StaticBoxSizer(OCRBox, wx.HORIZONTAL)
|
||||||
ocrLanguageSizer.Add(self.ocr_lang, 0, wx.ALL, 5)
|
ocrLanguageSizer.Add(self.ocr_lang, 0, wx.ALL, 5)
|
||||||
mainSizer.Add(ocrLanguageSizer, 0, wx.ALL, 5)
|
mainSizer.Add(ocrLanguageSizer, 0, wx.ALL, 5)
|
||||||
lbl = wx.StaticText(self, wx.NewId(), _(u"API Key for SndUp"))
|
lbl = wx.StaticText(self, wx.NewId(), _("API Key for SndUp"))
|
||||||
self.sndup_apiKey = wx.TextCtrl(self, -1)
|
self.sndup_apiKey = wx.TextCtrl(self, -1)
|
||||||
sndupBox = wx.BoxSizer(wx.HORIZONTAL)
|
sndupBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
sndupBox.Add(lbl, 0, wx.ALL, 5)
|
sndupBox.Add(lbl, 0, wx.ALL, 5)
|
||||||
@ -322,46 +322,46 @@ class configurationDialog(baseDialog.BaseWXDialog):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(configurationDialog, self).__init__(None, -1)
|
super(configurationDialog, self).__init__(None, -1)
|
||||||
self.panel = wx.Panel(self)
|
self.panel = wx.Panel(self)
|
||||||
self.SetTitle(_(u"{0} preferences").format(application.name,))
|
self.SetTitle(_("{0} preferences").format(application.name,))
|
||||||
self.sizer = wx.BoxSizer(wx.VERTICAL)
|
self.sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.notebook = wx.Notebook(self.panel)
|
self.notebook = wx.Notebook(self.panel)
|
||||||
|
|
||||||
def create_general(self, languageList,keymaps):
|
def create_general(self, languageList,keymaps):
|
||||||
self.general = general(self.notebook, languageList,keymaps)
|
self.general = general(self.notebook, languageList,keymaps)
|
||||||
self.notebook.AddPage(self.general, _(u"General"))
|
self.notebook.AddPage(self.general, _("General"))
|
||||||
self.general.SetFocus()
|
self.general.SetFocus()
|
||||||
|
|
||||||
def create_proxy(self, proxyTypes):
|
def create_proxy(self, proxyTypes):
|
||||||
self.proxy = proxy(self.notebook, proxyTypes)
|
self.proxy = proxy(self.notebook, proxyTypes)
|
||||||
self.notebook.AddPage(self.proxy, _(u"Proxy"))
|
self.notebook.AddPage(self.proxy, _("Proxy"))
|
||||||
|
|
||||||
def create_general_account(self):
|
def create_general_account(self):
|
||||||
self.general = generalAccount(self.notebook)
|
self.general = generalAccount(self.notebook)
|
||||||
self.notebook.AddPage(self.general, _(u"General"))
|
self.notebook.AddPage(self.general, _("General"))
|
||||||
self.general.SetFocus()
|
self.general.SetFocus()
|
||||||
|
|
||||||
def create_other_buffers(self):
|
def create_other_buffers(self):
|
||||||
self.buffers = other_buffers(self.notebook)
|
self.buffers = other_buffers(self.notebook)
|
||||||
self.notebook.AddPage(self.buffers, _(u"Buffers"))
|
self.notebook.AddPage(self.buffers, _("Buffers"))
|
||||||
|
|
||||||
def create_ignored_clients(self, ignored_clients_list):
|
def create_ignored_clients(self, ignored_clients_list):
|
||||||
self.ignored_clients = ignoredClients(self.notebook, ignored_clients_list)
|
self.ignored_clients = ignoredClients(self.notebook, ignored_clients_list)
|
||||||
self.notebook.AddPage(self.ignored_clients, _(u"Ignored clients"))
|
self.notebook.AddPage(self.ignored_clients, _("Ignored clients"))
|
||||||
|
|
||||||
def create_sound(self, output_devices, input_devices, soundpacks):
|
def create_sound(self, output_devices, input_devices, soundpacks):
|
||||||
self.sound = sound(self.notebook, output_devices, input_devices, soundpacks)
|
self.sound = sound(self.notebook, output_devices, input_devices, soundpacks)
|
||||||
self.notebook.AddPage(self.sound, _(u"Sound"))
|
self.notebook.AddPage(self.sound, _("Sound"))
|
||||||
|
|
||||||
def create_extras(self, ocr_languages=[], translator_languages=[]):
|
def create_extras(self, ocr_languages=[], translator_languages=[]):
|
||||||
self.extras = extrasPanel(self.notebook, ocr_languages, translator_languages)
|
self.extras = extrasPanel(self.notebook, ocr_languages, translator_languages)
|
||||||
self.notebook.AddPage(self.extras, _(u"Extras"))
|
self.notebook.AddPage(self.extras, _("Extras"))
|
||||||
|
|
||||||
def realize(self):
|
def realize(self):
|
||||||
self.sizer.Add(self.notebook, 0, wx.ALL, 5)
|
self.sizer.Add(self.notebook, 0, wx.ALL, 5)
|
||||||
ok_cancel_box = wx.BoxSizer(wx.HORIZONTAL)
|
ok_cancel_box = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
ok = wx.Button(self.panel, wx.ID_OK, _(u"Save"))
|
ok = wx.Button(self.panel, wx.ID_OK, _("Save"))
|
||||||
ok.SetDefault()
|
ok.SetDefault()
|
||||||
cancel = wx.Button(self.panel, wx.ID_CANCEL, _(u"Close"))
|
cancel = wx.Button(self.panel, wx.ID_CANCEL, _("Close"))
|
||||||
self.SetEscapeId(cancel.GetId())
|
self.SetEscapeId(cancel.GetId())
|
||||||
ok_cancel_box.Add(ok, 0, wx.ALL, 5)
|
ok_cancel_box.Add(ok, 0, wx.ALL, 5)
|
||||||
ok_cancel_box.Add(cancel, 0, wx.ALL, 5)
|
ok_cancel_box.Add(cancel, 0, wx.ALL, 5)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from . import baseDialog
|
from . import baseDialog
|
||||||
import wx
|
import wx
|
||||||
@ -9,17 +9,17 @@ class findDialog(baseDialog.BaseWXDialog):
|
|||||||
super(findDialog, self).__init__(None, -1)
|
super(findDialog, self).__init__(None, -1)
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.SetTitle(_(u"Find in current buffer"))
|
self.SetTitle(_("Find in current buffer"))
|
||||||
label = wx.StaticText(panel, -1, _(u"String"))
|
label = wx.StaticText(panel, -1, _("String"))
|
||||||
self.string = wx.TextCtrl(panel, -1, value)
|
self.string = wx.TextCtrl(panel, -1, value)
|
||||||
dc = wx.WindowDC(self.string)
|
dc = wx.WindowDC(self.string)
|
||||||
dc.SetFont(self.string.GetFont())
|
dc.SetFont(self.string.GetFont())
|
||||||
self.string.SetSize(dc.GetTextExtent("0"*40))
|
self.string.SetSize(dc.GetTextExtent("0"*40))
|
||||||
sizer.Add(label, 0, wx.ALL, 5)
|
sizer.Add(label, 0, wx.ALL, 5)
|
||||||
sizer.Add(self.string, 0, wx.ALL, 5)
|
sizer.Add(self.string, 0, wx.ALL, 5)
|
||||||
ok = wx.Button(panel, wx.ID_OK, _(u"OK"))
|
ok = wx.Button(panel, wx.ID_OK, _("OK"))
|
||||||
ok.SetDefault()
|
ok.SetDefault()
|
||||||
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Cancel"))
|
cancel = wx.Button(panel, wx.ID_CANCEL, _("Cancel"))
|
||||||
btnsizer = wx.BoxSizer()
|
btnsizer = wx.BoxSizer()
|
||||||
btnsizer.Add(ok, 0, wx.ALL, 5)
|
btnsizer.Add(ok, 0, wx.ALL, 5)
|
||||||
btnsizer.Add(cancel, 0, wx.ALL, 5)
|
btnsizer.Add(cancel, 0, wx.ALL, 5)
|
||||||
|
@ -7,18 +7,18 @@ class listViewer(widgetUtils.BaseDialog):
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(listViewer, self).__init__(parent=None, *args, **kwargs)
|
super(listViewer, self).__init__(parent=None, *args, **kwargs)
|
||||||
self.SetTitle(_(u"Lists manager"))
|
self.SetTitle(_("Lists manager"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
label = wx.StaticText(panel, -1, _(u"Lists"))
|
label = wx.StaticText(panel, -1, _("Lists"))
|
||||||
self.lista = widgets.list(panel, _(u"List"), _(u"Description"), _(u"Owner"), _(u"Members"), _(u"mode"), size=(800, 800), style=wx.LC_REPORT|wx.LC_SINGLE_SEL)
|
self.lista = widgets.list(panel, _("List"), _("Description"), _("Owner"), _("Members"), _("mode"), size=(800, 800), style=wx.LC_REPORT|wx.LC_SINGLE_SEL)
|
||||||
self.lista.list.SetFocus()
|
self.lista.list.SetFocus()
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
sizer.Add(label)
|
sizer.Add(label)
|
||||||
sizer.Add(self.lista.list)
|
sizer.Add(self.lista.list)
|
||||||
self.createBtn = wx.Button(panel, wx.NewId(), _(u"Create a new list"))
|
self.createBtn = wx.Button(panel, wx.NewId(), _("Create a new list"))
|
||||||
self.editBtn = wx.Button(panel, -1, _(u"Edit"))
|
self.editBtn = wx.Button(panel, -1, _("Edit"))
|
||||||
self.deleteBtn = wx.Button(panel, -1, _(u"Remove"))
|
self.deleteBtn = wx.Button(panel, -1, _("Remove"))
|
||||||
self.view = wx.Button(panel, -1, _(u"Open in buffer"))
|
self.view = wx.Button(panel, -1, _("Open in buffer"))
|
||||||
# self.members = wx.Button(panel, -1, _(u"View members"))
|
# self.members = wx.Button(panel, -1, _(u"View members"))
|
||||||
# self.members.Disable()
|
# self.members.Disable()
|
||||||
# self.subscriptors = wx.Button(panel, -1, _(u"View subscribers"))
|
# self.subscriptors = wx.Button(panel, -1, _(u"View subscribers"))
|
||||||
@ -48,9 +48,9 @@ class userListViewer(listViewer):
|
|||||||
def __init__(self, username, *args, **kwargs):
|
def __init__(self, username, *args, **kwargs):
|
||||||
self.username = username
|
self.username = username
|
||||||
super(userListViewer, self).__init__(*args, **kwargs)
|
super(userListViewer, self).__init__(*args, **kwargs)
|
||||||
self.SetTitle(_(u"Viewing lists for %s") % (self.username))
|
self.SetTitle(_("Viewing lists for %s") % (self.username))
|
||||||
self.createBtn.SetLabel(_(u"Subscribe"))
|
self.createBtn.SetLabel(_("Subscribe"))
|
||||||
self.deleteBtn.SetLabel(_(u"Unsubscribe"))
|
self.deleteBtn.SetLabel(_("Unsubscribe"))
|
||||||
self.editBtn.Disable()
|
self.editBtn.Disable()
|
||||||
self.view.Disable()
|
self.view.Disable()
|
||||||
|
|
||||||
@ -58,22 +58,22 @@ class createListDialog(widgetUtils.BaseDialog):
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(createListDialog, self).__init__(parent=None, *args, **kwargs)
|
super(createListDialog, self).__init__(parent=None, *args, **kwargs)
|
||||||
self.SetTitle(_(u"Create a new list"))
|
self.SetTitle(_("Create a new list"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
name = wx.StaticText(panel, -1, _(u"Name (20 characters maximun)"))
|
name = wx.StaticText(panel, -1, _("Name (20 characters maximun)"))
|
||||||
self.name = wx.TextCtrl(panel, -1)
|
self.name = wx.TextCtrl(panel, -1)
|
||||||
nameSizer = wx.BoxSizer(wx.HORIZONTAL)
|
nameSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
nameSizer.Add(name)
|
nameSizer.Add(name)
|
||||||
nameSizer.Add(self.name)
|
nameSizer.Add(self.name)
|
||||||
description = wx.StaticText(panel, -1, _(u"Description"))
|
description = wx.StaticText(panel, -1, _("Description"))
|
||||||
self.description = wx.TextCtrl(panel, -1)
|
self.description = wx.TextCtrl(panel, -1)
|
||||||
descriptionSizer = wx.BoxSizer(wx.HORIZONTAL)
|
descriptionSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
descriptionSizer.Add(description)
|
descriptionSizer.Add(description)
|
||||||
descriptionSizer.Add(self.description)
|
descriptionSizer.Add(self.description)
|
||||||
mode = wx.StaticText(panel, -1, _(u"Mode"))
|
mode = wx.StaticText(panel, -1, _("Mode"))
|
||||||
self.public = wx.RadioButton(panel, -1, _(u"Public"), style=wx.RB_GROUP)
|
self.public = wx.RadioButton(panel, -1, _("Public"), style=wx.RB_GROUP)
|
||||||
self.private = wx.RadioButton(panel, -1, _(u"Private"))
|
self.private = wx.RadioButton(panel, -1, _("Private"))
|
||||||
modeBox = wx.BoxSizer(wx.HORIZONTAL)
|
modeBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
modeBox.Add(mode)
|
modeBox.Add(mode)
|
||||||
modeBox.Add(self.public)
|
modeBox.Add(self.public)
|
||||||
@ -93,7 +93,7 @@ class editListDialog(createListDialog):
|
|||||||
|
|
||||||
def __init__(self, list, *args, **kwargs):
|
def __init__(self, list, *args, **kwargs):
|
||||||
super(editListDialog, self).__init__(*args, **kwargs)
|
super(editListDialog, self).__init__(*args, **kwargs)
|
||||||
self.SetTitle(_(u"Editing the list %s") % (list["name"]))
|
self.SetTitle(_("Editing the list %s") % (list["name"]))
|
||||||
self.name.ChangeValue(list["name"])
|
self.name.ChangeValue(list["name"])
|
||||||
self.description.ChangeValue(list["description"])
|
self.description.ChangeValue(list["description"])
|
||||||
if list["mode"] == "public":
|
if list["mode"] == "public":
|
||||||
@ -104,8 +104,8 @@ class editListDialog(createListDialog):
|
|||||||
class addUserListDialog(listViewer):
|
class addUserListDialog(listViewer):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(addUserListDialog, self).__init__(*args, **kwargs)
|
super(addUserListDialog, self).__init__(*args, **kwargs)
|
||||||
self.SetTitle(_(u"Select a list to add the user"))
|
self.SetTitle(_("Select a list to add the user"))
|
||||||
self.createBtn.SetLabel(_(u"Add"))
|
self.createBtn.SetLabel(_("Add"))
|
||||||
self.createBtn.SetDefault()
|
self.createBtn.SetDefault()
|
||||||
self.createBtn.Bind(wx.EVT_BUTTON, self.ok)
|
self.createBtn.Bind(wx.EVT_BUTTON, self.ok)
|
||||||
self.editBtn.Disable()
|
self.editBtn.Disable()
|
||||||
@ -120,8 +120,8 @@ class addUserListDialog(listViewer):
|
|||||||
class removeUserListDialog(listViewer):
|
class removeUserListDialog(listViewer):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(removeUserListDialog, self).__init__(*args, **kwargs)
|
super(removeUserListDialog, self).__init__(*args, **kwargs)
|
||||||
self.SetTitle(_(u"Select a list to remove the user"))
|
self.SetTitle(_("Select a list to remove the user"))
|
||||||
self.createBtn.SetLabel(_(u"Remove"))
|
self.createBtn.SetLabel(_("Remove"))
|
||||||
self.createBtn.SetDefault()
|
self.createBtn.SetDefault()
|
||||||
self.createBtn.SetId(wx.ID_OK)
|
self.createBtn.SetId(wx.ID_OK)
|
||||||
self.editBtn.Disable()
|
self.editBtn.Disable()
|
||||||
|
@ -71,20 +71,20 @@ class tweet(textLimited):
|
|||||||
self.mainBox = wx.BoxSizer(wx.VERTICAL)
|
self.mainBox = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.createTextArea(message, text)
|
self.createTextArea(message, text)
|
||||||
self.mainBox.Add(self.textBox, 0, wx.ALL, 5)
|
self.mainBox.Add(self.textBox, 0, wx.ALL, 5)
|
||||||
self.long_tweet = wx.CheckBox(self.panel, -1, _(u"&Long tweet"))
|
self.long_tweet = wx.CheckBox(self.panel, -1, _("&Long tweet"))
|
||||||
self.long_tweet.SetValue(True)
|
self.long_tweet.SetValue(True)
|
||||||
self.upload_image = wx.Button(self.panel, -1, _(u"&Upload image..."), size=wx.DefaultSize)
|
self.upload_image = wx.Button(self.panel, -1, _("&Upload image..."), size=wx.DefaultSize)
|
||||||
self.spellcheck = wx.Button(self.panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
self.spellcheck = wx.Button(self.panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
||||||
self.attach = wx.Button(self.panel, -1, _(u"&Attach audio..."), size=wx.DefaultSize)
|
self.attach = wx.Button(self.panel, -1, _("&Attach audio..."), size=wx.DefaultSize)
|
||||||
self.shortenButton = wx.Button(self.panel, -1, _(u"Sh&orten URL"), size=wx.DefaultSize)
|
self.shortenButton = wx.Button(self.panel, -1, _("Sh&orten URL"), size=wx.DefaultSize)
|
||||||
self.unshortenButton = wx.Button(self.panel, -1, _(u"&Expand URL"), size=wx.DefaultSize)
|
self.unshortenButton = wx.Button(self.panel, -1, _("&Expand URL"), size=wx.DefaultSize)
|
||||||
self.shortenButton.Disable()
|
self.shortenButton.Disable()
|
||||||
self.unshortenButton.Disable()
|
self.unshortenButton.Disable()
|
||||||
self.translateButton = wx.Button(self.panel, -1, _(u"&Translate..."), size=wx.DefaultSize)
|
self.translateButton = wx.Button(self.panel, -1, _("&Translate..."), size=wx.DefaultSize)
|
||||||
self.autocompletionButton = wx.Button(self.panel, -1, _(u"Auto&complete users"))
|
self.autocompletionButton = wx.Button(self.panel, -1, _("Auto&complete users"))
|
||||||
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Sen&d"), size=wx.DefaultSize)
|
self.okButton = wx.Button(self.panel, wx.ID_OK, _("Sen&d"), size=wx.DefaultSize)
|
||||||
self.okButton.SetDefault()
|
self.okButton.SetDefault()
|
||||||
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _(u"C&lose"), size=wx.DefaultSize)
|
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _("C&lose"), size=wx.DefaultSize)
|
||||||
self.buttonsBox1 = wx.BoxSizer(wx.HORIZONTAL)
|
self.buttonsBox1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
self.buttonsBox1.Add(self.upload_image, 0, wx.ALL, 10)
|
self.buttonsBox1.Add(self.upload_image, 0, wx.ALL, 10)
|
||||||
self.buttonsBox1.Add(self.spellcheck, 0, wx.ALL, 10)
|
self.buttonsBox1.Add(self.spellcheck, 0, wx.ALL, 10)
|
||||||
@ -115,7 +115,7 @@ class tweet(textLimited):
|
|||||||
self.SetClientSize(self.mainBox.CalcMin())
|
self.SetClientSize(self.mainBox.CalcMin())
|
||||||
|
|
||||||
def get_image(self):
|
def get_image(self):
|
||||||
openFileDialog = wx.FileDialog(self, _(u"Select the picture to be uploaded"), "", "", _("Image files (*.png, *.jpg, *.gif)|*.png; *.jpg; *.gif"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
openFileDialog = wx.FileDialog(self, _("Select the picture to be uploaded"), "", "", _("Image files (*.png, *.jpg, *.gif)|*.png; *.jpg; *.gif"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
||||||
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
||||||
return None
|
return None
|
||||||
return open(openFileDialog.GetPath(), "rb")
|
return open(openFileDialog.GetPath(), "rb")
|
||||||
@ -125,25 +125,25 @@ class retweet(tweet):
|
|||||||
def createControls(self, title, message, text):
|
def createControls(self, title, message, text):
|
||||||
self.mainBox = wx.BoxSizer(wx.VERTICAL)
|
self.mainBox = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.createTextArea(message, "")
|
self.createTextArea(message, "")
|
||||||
label = wx.StaticText(self.panel, -1, _(u"Retweet"))
|
label = wx.StaticText(self.panel, -1, _("Retweet"))
|
||||||
self.text2 = wx.TextCtrl(self.panel, -1, text, size=(439, -1), style=wx.TE_MULTILINE|wx.TE_READONLY)
|
self.text2 = wx.TextCtrl(self.panel, -1, text, size=(439, -1), style=wx.TE_MULTILINE|wx.TE_READONLY)
|
||||||
self.retweetBox = wx.BoxSizer(wx.HORIZONTAL)
|
self.retweetBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
self.retweetBox.Add(label, 0, wx.ALL, 5)
|
self.retweetBox.Add(label, 0, wx.ALL, 5)
|
||||||
self.retweetBox.Add(self.text2, 0, wx.ALL, 5)
|
self.retweetBox.Add(self.text2, 0, wx.ALL, 5)
|
||||||
self.mainBox.Add(self.textBox, 0, wx.ALL, 5)
|
self.mainBox.Add(self.textBox, 0, wx.ALL, 5)
|
||||||
self.mainBox.Add(self.retweetBox, 0, wx.ALL, 5)
|
self.mainBox.Add(self.retweetBox, 0, wx.ALL, 5)
|
||||||
self.upload_image = wx.Button(self.panel, -1, _(u"&Upload image..."), size=wx.DefaultSize)
|
self.upload_image = wx.Button(self.panel, -1, _("&Upload image..."), size=wx.DefaultSize)
|
||||||
self.spellcheck = wx.Button(self.panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
self.spellcheck = wx.Button(self.panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
||||||
self.attach = wx.Button(self.panel, -1, _(u"&Attach audio..."), size=wx.DefaultSize)
|
self.attach = wx.Button(self.panel, -1, _("&Attach audio..."), size=wx.DefaultSize)
|
||||||
self.shortenButton = wx.Button(self.panel, -1, _(u"Sh&orten URL"), size=wx.DefaultSize)
|
self.shortenButton = wx.Button(self.panel, -1, _("Sh&orten URL"), size=wx.DefaultSize)
|
||||||
self.unshortenButton = wx.Button(self.panel, -1, _(u"&Expand URL"), size=wx.DefaultSize)
|
self.unshortenButton = wx.Button(self.panel, -1, _("&Expand URL"), size=wx.DefaultSize)
|
||||||
self.shortenButton.Disable()
|
self.shortenButton.Disable()
|
||||||
self.unshortenButton.Disable()
|
self.unshortenButton.Disable()
|
||||||
self.translateButton = wx.Button(self.panel, -1, _(u"&Translate..."), size=wx.DefaultSize)
|
self.translateButton = wx.Button(self.panel, -1, _("&Translate..."), size=wx.DefaultSize)
|
||||||
self.autocompletionButton = wx.Button(self.panel, -1, _(u"Auto&complete users"))
|
self.autocompletionButton = wx.Button(self.panel, -1, _("Auto&complete users"))
|
||||||
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Sen&d"), size=wx.DefaultSize)
|
self.okButton = wx.Button(self.panel, wx.ID_OK, _("Sen&d"), size=wx.DefaultSize)
|
||||||
self.okButton.SetDefault()
|
self.okButton.SetDefault()
|
||||||
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _(u"C&lose"), size=wx.DefaultSize)
|
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _("C&lose"), size=wx.DefaultSize)
|
||||||
self.buttonsBox1 = wx.BoxSizer(wx.HORIZONTAL)
|
self.buttonsBox1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
self.buttonsBox1.Add(self.upload_image, 0, wx.ALL, 10)
|
self.buttonsBox1.Add(self.upload_image, 0, wx.ALL, 10)
|
||||||
self.buttonsBox1.Add(self.spellcheck, 0, wx.ALL, 10)
|
self.buttonsBox1.Add(self.spellcheck, 0, wx.ALL, 10)
|
||||||
@ -174,7 +174,7 @@ class retweet(tweet):
|
|||||||
self.SetClientSize(self.mainBox.CalcMin())
|
self.SetClientSize(self.mainBox.CalcMin())
|
||||||
|
|
||||||
def get_image(self):
|
def get_image(self):
|
||||||
openFileDialog = wx.FileDialog(self, _(u"Select the picture to be uploaded"), "", "", _("Image files (*.png, *.jpg, *.gif)|*.png; *.jpg; *.gif"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
openFileDialog = wx.FileDialog(self, _("Select the picture to be uploaded"), "", "", _("Image files (*.png, *.jpg, *.gif)|*.png; *.jpg; *.gif"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
||||||
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
||||||
return None
|
return None
|
||||||
return open(openFileDialog.GetPath(), "rb")
|
return open(openFileDialog.GetPath(), "rb")
|
||||||
@ -183,9 +183,9 @@ class dm(textLimited):
|
|||||||
def createControls(self, title, message, users):
|
def createControls(self, title, message, users):
|
||||||
self.panel = wx.Panel(self)
|
self.panel = wx.Panel(self)
|
||||||
self.mainBox = wx.BoxSizer(wx.VERTICAL)
|
self.mainBox = wx.BoxSizer(wx.VERTICAL)
|
||||||
label = wx.StaticText(self.panel, -1, _(u"&Recipient"))
|
label = wx.StaticText(self.panel, -1, _("&Recipient"))
|
||||||
self.cb = wx.ComboBox(self.panel, -1, choices=users, value=users[0], size=wx.DefaultSize)
|
self.cb = wx.ComboBox(self.panel, -1, choices=users, value=users[0], size=wx.DefaultSize)
|
||||||
self.autocompletionButton = wx.Button(self.panel, -1, _(u"Auto&complete users"))
|
self.autocompletionButton = wx.Button(self.panel, -1, _("Auto&complete users"))
|
||||||
self.createTextArea(message, text="")
|
self.createTextArea(message, text="")
|
||||||
userBox = wx.BoxSizer(wx.HORIZONTAL)
|
userBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
userBox.Add(label, 0, wx.ALL, 5)
|
userBox.Add(label, 0, wx.ALL, 5)
|
||||||
@ -194,15 +194,15 @@ class dm(textLimited):
|
|||||||
self.mainBox.Add(userBox, 0, wx.ALL, 5)
|
self.mainBox.Add(userBox, 0, wx.ALL, 5)
|
||||||
self.mainBox.Add(self.textBox, 0, wx.ALL, 5)
|
self.mainBox.Add(self.textBox, 0, wx.ALL, 5)
|
||||||
self.spellcheck = wx.Button(self.panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
self.spellcheck = wx.Button(self.panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
||||||
self.attach = wx.Button(self.panel, -1, _(u"&Attach audio..."), size=wx.DefaultSize)
|
self.attach = wx.Button(self.panel, -1, _("&Attach audio..."), size=wx.DefaultSize)
|
||||||
self.shortenButton = wx.Button(self.panel, -1, _(u"Sh&orten URL"), size=wx.DefaultSize)
|
self.shortenButton = wx.Button(self.panel, -1, _("Sh&orten URL"), size=wx.DefaultSize)
|
||||||
self.unshortenButton = wx.Button(self.panel, -1, _(u"&Expand URL"), size=wx.DefaultSize)
|
self.unshortenButton = wx.Button(self.panel, -1, _("&Expand URL"), size=wx.DefaultSize)
|
||||||
self.shortenButton.Disable()
|
self.shortenButton.Disable()
|
||||||
self.unshortenButton.Disable()
|
self.unshortenButton.Disable()
|
||||||
self.translateButton = wx.Button(self.panel, -1, _(u"&Translate..."), size=wx.DefaultSize)
|
self.translateButton = wx.Button(self.panel, -1, _("&Translate..."), size=wx.DefaultSize)
|
||||||
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Sen&d"), size=wx.DefaultSize)
|
self.okButton = wx.Button(self.panel, wx.ID_OK, _("Sen&d"), size=wx.DefaultSize)
|
||||||
self.okButton.SetDefault()
|
self.okButton.SetDefault()
|
||||||
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _(u"C&lose"), size=wx.DefaultSize)
|
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _("C&lose"), size=wx.DefaultSize)
|
||||||
self.buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
|
self.buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
self.buttonsBox.Add(self.spellcheck, 0, wx.ALL, 5)
|
self.buttonsBox.Add(self.spellcheck, 0, wx.ALL, 5)
|
||||||
self.buttonsBox.Add(self.attach, 0, wx.ALL, 5)
|
self.buttonsBox.Add(self.attach, 0, wx.ALL, 5)
|
||||||
@ -234,7 +234,7 @@ class dm(textLimited):
|
|||||||
class reply(textLimited):
|
class reply(textLimited):
|
||||||
|
|
||||||
def get_image(self):
|
def get_image(self):
|
||||||
openFileDialog = wx.FileDialog(self, _(u"Select the picture to be uploaded"), "", "", _("Image files (*.png, *.jpg, *.gif)|*.png; *.jpg; *.gif"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
openFileDialog = wx.FileDialog(self, _("Select the picture to be uploaded"), "", "", _("Image files (*.png, *.jpg, *.gif)|*.png; *.jpg; *.gif"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
|
||||||
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
if openFileDialog.ShowModal() == wx.ID_CANCEL:
|
||||||
return None
|
return None
|
||||||
return open(openFileDialog.GetPath(), "rb")
|
return open(openFileDialog.GetPath(), "rb")
|
||||||
@ -244,7 +244,7 @@ class reply(textLimited):
|
|||||||
self.createTextArea(message, text)
|
self.createTextArea(message, text)
|
||||||
self.mainBox.Add(self.textBox, 0, wx.ALL, 5)
|
self.mainBox.Add(self.textBox, 0, wx.ALL, 5)
|
||||||
self.usersbox = wx.BoxSizer(wx.VERTICAL)
|
self.usersbox = wx.BoxSizer(wx.VERTICAL)
|
||||||
self.mentionAll = wx.CheckBox(self.panel, -1, _(u"&Mention to all"), size=wx.DefaultSize)
|
self.mentionAll = wx.CheckBox(self.panel, -1, _("&Mention to all"), size=wx.DefaultSize)
|
||||||
self.mentionAll.Disable()
|
self.mentionAll.Disable()
|
||||||
self.usersbox.Add(self.mentionAll, 0, wx.ALL, 5)
|
self.usersbox.Add(self.mentionAll, 0, wx.ALL, 5)
|
||||||
self.checkboxes = []
|
self.checkboxes = []
|
||||||
@ -253,20 +253,20 @@ class reply(textLimited):
|
|||||||
self.checkboxes.append(user_checkbox)
|
self.checkboxes.append(user_checkbox)
|
||||||
self.usersbox.Add(self.checkboxes[-1], 0, wx.ALL, 5)
|
self.usersbox.Add(self.checkboxes[-1], 0, wx.ALL, 5)
|
||||||
self.mainBox.Add(self.usersbox, 0, wx.ALL, 10)
|
self.mainBox.Add(self.usersbox, 0, wx.ALL, 10)
|
||||||
self.long_tweet = wx.CheckBox(self.panel, -1, _(u"&Long tweet"))
|
self.long_tweet = wx.CheckBox(self.panel, -1, _("&Long tweet"))
|
||||||
self.long_tweet.SetValue(True)
|
self.long_tweet.SetValue(True)
|
||||||
self.upload_image = wx.Button(self.panel, -1, _(u"&Upload image..."), size=wx.DefaultSize)
|
self.upload_image = wx.Button(self.panel, -1, _("&Upload image..."), size=wx.DefaultSize)
|
||||||
self.spellcheck = wx.Button(self.panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
self.spellcheck = wx.Button(self.panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
||||||
self.attach = wx.Button(self.panel, -1, _(u"&Attach audio..."), size=wx.DefaultSize)
|
self.attach = wx.Button(self.panel, -1, _("&Attach audio..."), size=wx.DefaultSize)
|
||||||
self.shortenButton = wx.Button(self.panel, -1, _(u"Sh&orten URL"), size=wx.DefaultSize)
|
self.shortenButton = wx.Button(self.panel, -1, _("Sh&orten URL"), size=wx.DefaultSize)
|
||||||
self.unshortenButton = wx.Button(self.panel, -1, _(u"&Expand URL"), size=wx.DefaultSize)
|
self.unshortenButton = wx.Button(self.panel, -1, _("&Expand URL"), size=wx.DefaultSize)
|
||||||
self.shortenButton.Disable()
|
self.shortenButton.Disable()
|
||||||
self.unshortenButton.Disable()
|
self.unshortenButton.Disable()
|
||||||
self.translateButton = wx.Button(self.panel, -1, _(u"&Translate..."), size=wx.DefaultSize)
|
self.translateButton = wx.Button(self.panel, -1, _("&Translate..."), size=wx.DefaultSize)
|
||||||
self.autocompletionButton = wx.Button(self.panel, -1, _(u"Auto&complete users"))
|
self.autocompletionButton = wx.Button(self.panel, -1, _("Auto&complete users"))
|
||||||
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Sen&d"), size=wx.DefaultSize)
|
self.okButton = wx.Button(self.panel, wx.ID_OK, _("Sen&d"), size=wx.DefaultSize)
|
||||||
self.okButton.SetDefault()
|
self.okButton.SetDefault()
|
||||||
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _(u"C&lose"), size=wx.DefaultSize)
|
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _("C&lose"), size=wx.DefaultSize)
|
||||||
self.buttonsBox1 = wx.BoxSizer(wx.HORIZONTAL)
|
self.buttonsBox1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
self.buttonsBox1.Add(self.upload_image, 0, wx.ALL, 10)
|
self.buttonsBox1.Add(self.upload_image, 0, wx.ALL, 10)
|
||||||
self.buttonsBox1.Add(self.spellcheck, 0, wx.ALL, 10)
|
self.buttonsBox1.Add(self.spellcheck, 0, wx.ALL, 10)
|
||||||
@ -299,12 +299,12 @@ class reply(textLimited):
|
|||||||
|
|
||||||
class viewTweet(widgetUtils.BaseDialog):
|
class viewTweet(widgetUtils.BaseDialog):
|
||||||
def set_title(self, lenght):
|
def set_title(self, lenght):
|
||||||
self.SetTitle(_(u"Tweet - %i characters ") % (lenght,))
|
self.SetTitle(_("Tweet - %i characters ") % (lenght,))
|
||||||
|
|
||||||
def __init__(self, text, rt_count, favs_count,source, *args, **kwargs):
|
def __init__(self, text, rt_count, favs_count,source, *args, **kwargs):
|
||||||
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, _("Tweet"))
|
||||||
self.text = wx.TextCtrl(panel, -1, text, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
self.text = wx.TextCtrl(panel, -1, text, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
||||||
dc = wx.WindowDC(self.text)
|
dc = wx.WindowDC(self.text)
|
||||||
dc.SetFont(self.text.GetFont())
|
dc.SetFont(self.text.GetFont())
|
||||||
@ -316,7 +316,7 @@ class viewTweet(widgetUtils.BaseDialog):
|
|||||||
textBox.Add(self.text, 1, wx.EXPAND, 5)
|
textBox.Add(self.text, 1, wx.EXPAND, 5)
|
||||||
mainBox = wx.BoxSizer(wx.VERTICAL)
|
mainBox = wx.BoxSizer(wx.VERTICAL)
|
||||||
mainBox.Add(textBox, 0, wx.ALL, 5)
|
mainBox.Add(textBox, 0, wx.ALL, 5)
|
||||||
label2 = wx.StaticText(panel, -1, _(u"Image description"))
|
label2 = wx.StaticText(panel, -1, _("Image description"))
|
||||||
self.image_description = wx.TextCtrl(panel, -1, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
self.image_description = wx.TextCtrl(panel, -1, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
||||||
dc = wx.WindowDC(self.image_description)
|
dc = wx.WindowDC(self.image_description)
|
||||||
dc.SetFont(self.image_description.GetFont())
|
dc.SetFont(self.image_description.GetFont())
|
||||||
@ -327,17 +327,17 @@ class viewTweet(widgetUtils.BaseDialog):
|
|||||||
iBox.Add(label2, 0, wx.ALL, 5)
|
iBox.Add(label2, 0, wx.ALL, 5)
|
||||||
iBox.Add(self.image_description, 1, wx.EXPAND, 5)
|
iBox.Add(self.image_description, 1, wx.EXPAND, 5)
|
||||||
mainBox.Add(iBox, 0, wx.ALL, 5)
|
mainBox.Add(iBox, 0, wx.ALL, 5)
|
||||||
rtCountLabel = wx.StaticText(panel, -1, _(u"Retweets: "))
|
rtCountLabel = wx.StaticText(panel, -1, _("Retweets: "))
|
||||||
rtCount = wx.TextCtrl(panel, -1, rt_count, size=wx.DefaultSize, style=wx.TE_READONLY|wx.TE_MULTILINE)
|
rtCount = wx.TextCtrl(panel, -1, rt_count, size=wx.DefaultSize, style=wx.TE_READONLY|wx.TE_MULTILINE)
|
||||||
rtBox = wx.BoxSizer(wx.HORIZONTAL)
|
rtBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
rtBox.Add(rtCountLabel, 0, wx.ALL, 5)
|
rtBox.Add(rtCountLabel, 0, wx.ALL, 5)
|
||||||
rtBox.Add(rtCount, 0, wx.ALL, 5)
|
rtBox.Add(rtCount, 0, wx.ALL, 5)
|
||||||
favsCountLabel = wx.StaticText(panel, -1, _(u"Likes: "))
|
favsCountLabel = wx.StaticText(panel, -1, _("Likes: "))
|
||||||
favsCount = wx.TextCtrl(panel, -1, favs_count, size=wx.DefaultSize, style=wx.TE_READONLY|wx.TE_MULTILINE)
|
favsCount = wx.TextCtrl(panel, -1, favs_count, size=wx.DefaultSize, style=wx.TE_READONLY|wx.TE_MULTILINE)
|
||||||
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: "))
|
sourceLabel = wx.StaticText(panel, -1, _("Source: "))
|
||||||
sourceTweet = wx.TextCtrl(panel, -1, source, size=wx.DefaultSize, style=wx.TE_READONLY|wx.TE_MULTILINE)
|
sourceTweet = wx.TextCtrl(panel, -1, source, size=wx.DefaultSize, style=wx.TE_READONLY|wx.TE_MULTILINE)
|
||||||
sourceBox = wx.BoxSizer(wx.HORIZONTAL)
|
sourceBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
sourceBox.Add(sourceLabel, 0, wx.ALL, 5)
|
sourceBox.Add(sourceLabel, 0, wx.ALL, 5)
|
||||||
@ -348,10 +348,10 @@ class viewTweet(widgetUtils.BaseDialog):
|
|||||||
infoBox.Add(sourceBox, 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, _("Check &spelling..."), size=wx.DefaultSize)
|
self.spellcheck = wx.Button(panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
||||||
self.unshortenButton = wx.Button(panel, -1, _(u"&Expand URL"), size=wx.DefaultSize)
|
self.unshortenButton = wx.Button(panel, -1, _("&Expand URL"), size=wx.DefaultSize)
|
||||||
self.unshortenButton.Disable()
|
self.unshortenButton.Disable()
|
||||||
self.translateButton = wx.Button(panel, -1, _(u"&Translate..."), size=wx.DefaultSize)
|
self.translateButton = wx.Button(panel, -1, _("&Translate..."), size=wx.DefaultSize)
|
||||||
cancelButton = wx.Button(panel, wx.ID_CANCEL, _(u"C&lose"), size=wx.DefaultSize)
|
cancelButton = wx.Button(panel, wx.ID_CANCEL, _("C&lose"), size=wx.DefaultSize)
|
||||||
cancelButton.SetDefault()
|
cancelButton.SetDefault()
|
||||||
buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
|
buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
buttonsBox.Add(self.spellcheck, 0, wx.ALL, 5)
|
buttonsBox.Add(self.spellcheck, 0, wx.ALL, 5)
|
||||||
@ -395,9 +395,9 @@ class viewNonTweet(widgetUtils.BaseDialog):
|
|||||||
|
|
||||||
def __init__(self, text, *args, **kwargs):
|
def __init__(self, text, *args, **kwargs):
|
||||||
super(viewNonTweet, self).__init__(None, size=(850,850))
|
super(viewNonTweet, self).__init__(None, size=(850,850))
|
||||||
self.SetTitle(_(u"View"))
|
self.SetTitle(_("View"))
|
||||||
panel = wx.Panel(self)
|
panel = wx.Panel(self)
|
||||||
label = wx.StaticText(panel, -1, _(u"Item"))
|
label = wx.StaticText(panel, -1, _("Item"))
|
||||||
self.text = wx.TextCtrl(parent=panel, id=-1, value=text, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
self.text = wx.TextCtrl(parent=panel, id=-1, value=text, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(250, 180))
|
||||||
dc = wx.WindowDC(self.text)
|
dc = wx.WindowDC(self.text)
|
||||||
dc.SetFont(self.text.GetFont())
|
dc.SetFont(self.text.GetFont())
|
||||||
@ -410,10 +410,10 @@ class viewNonTweet(widgetUtils.BaseDialog):
|
|||||||
mainBox = wx.BoxSizer(wx.VERTICAL)
|
mainBox = wx.BoxSizer(wx.VERTICAL)
|
||||||
mainBox.Add(textBox, 0, wx.ALL, 5)
|
mainBox.Add(textBox, 0, wx.ALL, 5)
|
||||||
self.spellcheck = wx.Button(panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
self.spellcheck = wx.Button(panel, -1, _("Check &spelling..."), size=wx.DefaultSize)
|
||||||
self.unshortenButton = wx.Button(panel, -1, _(u"&Expand URL"), size=wx.DefaultSize)
|
self.unshortenButton = wx.Button(panel, -1, _("&Expand URL"), size=wx.DefaultSize)
|
||||||
self.unshortenButton.Disable()
|
self.unshortenButton.Disable()
|
||||||
self.translateButton = wx.Button(panel, -1, _(u"&Translate..."), size=wx.DefaultSize)
|
self.translateButton = wx.Button(panel, -1, _("&Translate..."), size=wx.DefaultSize)
|
||||||
cancelButton = wx.Button(panel, wx.ID_CANCEL, _(u"C&lose"), size=wx.DefaultSize)
|
cancelButton = wx.Button(panel, wx.ID_CANCEL, _("C&lose"), size=wx.DefaultSize)
|
||||||
cancelButton.SetDefault()
|
cancelButton.SetDefault()
|
||||||
buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
|
buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
buttonsBox.Add(self.spellcheck, 0, wx.ALL, 5)
|
buttonsBox.Add(self.spellcheck, 0, wx.ALL, 5)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user