mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-26 01:49:22 +00:00
Compare commits
80 Commits
snapshot9.
...
snapshot10
Author | SHA1 | Date | |
---|---|---|---|
70b5f25cf0 | |||
2b65b89afb | |||
44e8ed6456 | |||
792655e299 | |||
0f56d8cdd4 | |||
6c47dd2fa9 | |||
![]() |
49073bc151 | ||
![]() |
336acd9860 | ||
4daeeb7beb | |||
408ff50404 | |||
148c5176c6 | |||
bdb9de863f | |||
ce1f8b2cc3 | |||
5933323beb | |||
22b1b0a149 | |||
e71afeb10f | |||
98f026156d | |||
cbee57aa30 | |||
fd9e4dc05d | |||
6022cecad1 | |||
89e39e2168 | |||
a69bf99c1a | |||
d34ef81324 | |||
a3c050195a | |||
3623eafacd | |||
![]() |
2bd3f0a1d1 | ||
f1f828522e | |||
51e4898346 | |||
c4478198b6 | |||
f468924b85 | |||
158b48e4d5 | |||
756a58e443 | |||
85ce5b0791 | |||
![]() |
e534d1cd20 | ||
2d35304ef0 | |||
4f0e6d758b | |||
bd4aa89c2b | |||
b046360293 | |||
6971fb3999 | |||
7b840f29c4 | |||
71fed7300b | |||
57315c3b6e | |||
3d3abc90e1 | |||
de7882e4cf | |||
![]() |
10190d61c0 | ||
bb6fa7cb46 | |||
80cb70c9a6 | |||
77d51aa51a | |||
![]() |
ebb4e22d02 | ||
4344a0df0c | |||
34ad0c5e47 | |||
704ade560a | |||
a4892cf847 | |||
e59661775a | |||
53a9f04155 | |||
100f483a86 | |||
bad468560a | |||
eb0cf62a54 | |||
a016932ac7 | |||
1706414171 | |||
5f963aa66b | |||
25578e4fc6 | |||
faec92ce6c | |||
313e725ff2 | |||
3f82a51ef9 | |||
d26ab9b910 | |||
aa42e056c0 | |||
fa6592ed1a | |||
11b06accbb | |||
![]() |
915eb5802f | ||
![]() |
4e943c7bee | ||
![]() |
692d75562e | ||
4cce6d4318 | |||
e55e15466d | |||
370340de0b | |||
10bc483887 | |||
f66b2ccbad | |||
6460c20a97 | |||
9f2c240fc1 | |||
a4cbbfcb9f |
23
README.md
23
README.md
@@ -71,8 +71,11 @@ setuptools install a script, called easy_install. You can find it in the python
|
|||||||
* arrow
|
* arrow
|
||||||
* goslate
|
* goslate
|
||||||
* markdown
|
* markdown
|
||||||
|
* pocket
|
||||||
|
|
||||||
easy_install will automatically get the additional libraries that these packages need to work properly.
|
easy_install will automatically get the additional libraries that these packages need to work properly.
|
||||||
|
Run the following command to quickly install and upgrade all packages and their dependencies:
|
||||||
|
easy_install -Z --upgrade six configobj goslate markdown future pocket suds requests oauthlib requests-oauthlib pypubsub pygeocoder arrow python-dateutil futures
|
||||||
|
|
||||||
#### Other dependencies
|
#### Other dependencies
|
||||||
|
|
||||||
@@ -95,9 +98,16 @@ Now that you have installed all these packages, you can run TW Blue from source
|
|||||||
|
|
||||||
If necessary, change the first part of the command to reflect the location of your python executable. You can run TW Blue using python x86 and x64
|
If necessary, change the first part of the command to reflect the location of your python executable. You can run TW Blue using python x86 and x64
|
||||||
|
|
||||||
|
### Generating the documentation
|
||||||
|
|
||||||
|
To generate the documentation in html format, navigate to the doc folder inside this repo. After that, run this command:
|
||||||
|
python generator.py
|
||||||
|
The documentation will be generated, placing each language in a separate folder in the doc directory. Move these folders (for example de, en, es, fr, it, ...) to src/documentation, creating the directory if necesary.
|
||||||
|
Also, copy the license.txt located in the root of the repo to the documentation folder.
|
||||||
|
|
||||||
### Building a binary version
|
### Building a binary version
|
||||||
|
|
||||||
A binary version doesn't need python and the other dependencies to run, it's the same version that you will find on the TW Blue website if you download the zip files.
|
A binary version doesn't need python and the other dependencies to run, it's the same version that you will find on the TW Blue website if you download the zip files or the snapshot versions.
|
||||||
|
|
||||||
To build it, run the following command from the src folder:
|
To build it, run the following command from the src folder:
|
||||||
|
|
||||||
@@ -105,6 +115,17 @@ To build it, run the following command from the src folder:
|
|||||||
|
|
||||||
You will find the binaries in the dist directory.
|
You will find the binaries in the dist directory.
|
||||||
|
|
||||||
|
### Building an installer
|
||||||
|
|
||||||
|
If you want to install TWBlue in your computer, you must create the installer first. Follow these steps:
|
||||||
|
|
||||||
|
* Navigate to the src directory, and create a binary version for x86: C:\python27\python setup.py py2exe
|
||||||
|
* Move the dist directory to the scripts folder in this repo, and rename it to twblue
|
||||||
|
* Repeat these steps with Python for x64: C:\python27x64\python setup.py py2exe
|
||||||
|
* Move the new dist directory to the scripts folder, and rename it to twblue64
|
||||||
|
* Go to the scripts folder, right click on the twblue.nsi file, and choose compyle unicode NSIS script
|
||||||
|
* This may take a while. After the process, you will find the installer in the scripts folder
|
||||||
|
|
||||||
### How to generate a translation template
|
### How to generate a translation template
|
||||||
|
|
||||||
Run the gen_pot.bat file, located in the tools directory. Your python installation must be in your path environment variable. The pot file will appear in the tools directory.
|
Run the gen_pot.bat file, located in the tools directory. Your python installation must be in your path environment variable. The pot file will appear in the tools directory.
|
||||||
|
@@ -34,3 +34,4 @@ Holly Scott-Gardner
|
|||||||
Anibal Hernández
|
Anibal Hernández
|
||||||
Sussan Leiva
|
Sussan Leiva
|
||||||
Brian Hartgen
|
Brian Hartgen
|
||||||
|
PEDRO REINA COLOBON
|
@@ -163,7 +163,7 @@ documentation.append(_(u"""* Lists Manager: This dialogue box allows you to mana
|
|||||||
documentation.append(_(u"""* Edit keystrokes: this opens a dialogue where you can see and edit the shortcuts used in the invisible interface."""))
|
documentation.append(_(u"""* Edit keystrokes: this opens a dialogue where you can see and edit the shortcuts used in the invisible interface."""))
|
||||||
documentation.append(_(u"""* Account settings: Opens a dialogue box which lets you customize settings for the current account."""))
|
documentation.append(_(u"""* Account settings: Opens a dialogue box which lets you customize settings for the current account."""))
|
||||||
documentation.append(_(u"""* Global settings: Opens a dialogue which lets you configure settings for the entire application."""))
|
documentation.append(_(u"""* Global settings: Opens a dialogue which lets you configure settings for the entire application."""))
|
||||||
documentation.append(_(u"""* Quit: asks whether you want to exit the program. If the answer is yes, it closes the application. If you do not want to be asked for confirmation before exiting, uncheck the checkbox from the global settings dialogue box."""))
|
documentation.append(_(u"""* Exit: asks whether you want to exit the program. If the answer is yes, it closes the application. If you do not want to be asked for confirmation before exiting, uncheck the checkbox from the global settings dialogue box."""))
|
||||||
documentation.append(_(u"""
|
documentation.append(_(u"""
|
||||||
"""))
|
"""))
|
||||||
documentation.append(_(u"""##### Tweet menu"""))
|
documentation.append(_(u"""##### Tweet menu"""))
|
||||||
@@ -405,19 +405,21 @@ documentation.append(_(u"""We would also like to thank the translators of TWBlue
|
|||||||
documentation.append(_(u"""
|
documentation.append(_(u"""
|
||||||
"""))
|
"""))
|
||||||
documentation.append(_(u"""* English: [Bryner Villalobos](https://twitter.com/Bry_StarkCR) and [Bill Dengler](https://twitter.com/codeofdusk)."""))
|
documentation.append(_(u"""* English: [Bryner Villalobos](https://twitter.com/Bry_StarkCR) and [Bill Dengler](https://twitter.com/codeofdusk)."""))
|
||||||
documentation.append(_(u"""* Arabic: Mohammed Al Shara."""))
|
documentation.append(_(u"""* Arabic: [Mohammed Al Shara](https://twitter.com/mohammed0204)."""))
|
||||||
documentation.append(_(u"""* Catalan: [Joan Rabat](https://twitter.com/joanrabat) and Juan Carlos Rivilla."""))
|
documentation.append(_(u"""* Catalan: [Joan Rabat](https://twitter.com/joanrabat) and Juan Carlos Rivilla."""))
|
||||||
documentation.append(_(u"""* Spanish: [Manuel Cortéz](https://twitter.com/manuelcortez00)."""))
|
documentation.append(_(u"""* Spanish: [Manuel Cortéz](https://twitter.com/manuelcortez00)."""))
|
||||||
documentation.append(_(u"""* Basque: [Sukil Etxenike](https://twitter.com/sukil2011)."""))
|
documentation.append(_(u"""* Basque: [Sukil Etxenike](https://twitter.com/sukil2011)."""))
|
||||||
documentation.append(_(u"""* Finnish: Jani Kinnunen."""))
|
documentation.append(_(u"""* Finnish: [Jani Kinnunen](https://twitter.com/jani_kinnunen)."""))
|
||||||
documentation.append(_(u"""* French: Rémi Ruiz."""))
|
documentation.append(_(u"""* French: [Rémi Ruiz](https://twitter.com/blindhelp38)."""))
|
||||||
documentation.append(_(u"""* Galician: [Alba Kinteiro](https://twitter.com/albasmileforeve)."""))
|
documentation.append(_(u"""* Galician: [Alba Kinteiro](https://twitter.com/albasmileforeve)."""))
|
||||||
documentation.append(_(u"""* German: Steffen Schultz."""))
|
documentation.append(_(u"""* German: [Steffen Schultz](https://twitter.com/schulle4u)."""))
|
||||||
|
documentation.append(_(u"""* Croatian: [Zvonimir Stanečić](https://twitter.com/zvonimirek222)."""))
|
||||||
documentation.append(_(u"""* Hungarian: Robert Osztolykan."""))
|
documentation.append(_(u"""* Hungarian: Robert Osztolykan."""))
|
||||||
|
documentation.append(_(u"""* Italian: [Christian Leo Mameli](https://twitter.com/llajta2012)."""))
|
||||||
documentation.append(_(u"""* Polish: Pawel Masarczyk."""))
|
documentation.append(_(u"""* Polish: Pawel Masarczyk."""))
|
||||||
documentation.append(_(u"""* Portuguese: Odenilton Júnior Santos."""))
|
documentation.append(_(u"""* Portuguese: Odenilton Júnior Santos."""))
|
||||||
documentation.append(_(u"""* Russian: Alexander Jaszyn."""))
|
documentation.append(_(u"""* Russian: [Александр Яшин](https://twitter.com/radovest)."""))
|
||||||
documentation.append(_(u"""* Turkish: Burak."""))
|
documentation.append(_(u"""* Turkish: [Burak Yüksek](https://twitter.com/burakyuksek)."""))
|
||||||
documentation.append(_(u"""
|
documentation.append(_(u"""
|
||||||
"""))
|
"""))
|
||||||
documentation.append(_(u"""Many thanks also to the people who worked on the documentation. Initially, [Manuel Cortez](https://twitter.com/manuelcortez00) did the documentation in Spanish, and translated to English by [Bryner Villalobos](https://twitter.com/Bry_StarkCR), [Robert Spangler](https://twitter.com/glasscity1837), [Sussan Rey](https://twitter.com/sussanrey17), [Anibal Hernandez](https://twitter.com/anibalmetal), and [Holly Scott-Gardner](https://twitter.com/holly1994). It was updated by [Sukil Etxenike](https://twitter.com/sukil2011), with some valuable corrections by [Brian Hartgen](https://twitter.com/brianhartgen) and [Bill Dengler](https://twitter.com/codeofdusk)."""))
|
documentation.append(_(u"""Many thanks also to the people who worked on the documentation. Initially, [Manuel Cortez](https://twitter.com/manuelcortez00) did the documentation in Spanish, and translated to English by [Bryner Villalobos](https://twitter.com/Bry_StarkCR), [Robert Spangler](https://twitter.com/glasscity1837), [Sussan Rey](https://twitter.com/sussanrey17), [Anibal Hernandez](https://twitter.com/anibalmetal), and [Holly Scott-Gardner](https://twitter.com/holly1994). It was updated by [Sukil Etxenike](https://twitter.com/sukil2011), with some valuable corrections by [Brian Hartgen](https://twitter.com/brianhartgen) and [Bill Dengler](https://twitter.com/codeofdusk)."""))
|
||||||
|
@@ -36,6 +36,7 @@ autoread_buffers = list(default=list(mentions, direct_messages, events))
|
|||||||
spelling_language = string(default="")
|
spelling_language = string(default="")
|
||||||
save_followers_in_autocompletion_db = boolean(default=False)
|
save_followers_in_autocompletion_db = boolean(default=False)
|
||||||
save_friends_in_autocompletion_db = boolean(default=False)
|
save_friends_in_autocompletion_db = boolean(default=False)
|
||||||
|
twishort_enabled = boolean(default=False)
|
||||||
|
|
||||||
[services]
|
[services]
|
||||||
pocket_access_token = string(default="")
|
pocket_access_token = string(default="")
|
@@ -8,12 +8,13 @@ language = string(default="system")
|
|||||||
hide_gui = boolean(default=False)
|
hide_gui = boolean(default=False)
|
||||||
voice_enabled = boolean(default=False)
|
voice_enabled = boolean(default=False)
|
||||||
ask_at_exit = boolean(default=True)
|
ask_at_exit = boolean(default=True)
|
||||||
handle_longtweets = boolean(default=False)
|
handle_longtweets = boolean(default=True)
|
||||||
use_invisible_keyboard_shorcuts = boolean(default=True)
|
use_invisible_keyboard_shorcuts = boolean(default=True)
|
||||||
play_ready_sound = boolean(default=True)
|
play_ready_sound = boolean(default=True)
|
||||||
speak_ready_msg = boolean(default=True)
|
speak_ready_msg = boolean(default=True)
|
||||||
log_level = string(default="error")
|
log_level = string(default="error")
|
||||||
load_keymap = string(default="default.keymap")
|
load_keymap = string(default="default.keymap")
|
||||||
|
donation_dialog_displayed = boolean(default=False)
|
||||||
|
|
||||||
[proxy]
|
[proxy]
|
||||||
server = string(default="")
|
server = string(default="")
|
||||||
|
@@ -5,12 +5,12 @@ if snapshot == False:
|
|||||||
version = "0.80"
|
version = "0.80"
|
||||||
update_url = 'http://twblue.es/updates/twblue_ngen.json'
|
update_url = 'http://twblue.es/updates/twblue_ngen.json'
|
||||||
else:
|
else:
|
||||||
version = "9.9"
|
version = "10.92"
|
||||||
update_url = 'http://twblue.es/updates/snapshots_ngen.json'
|
update_url = 'http://twblue.es/updates/snapshots_ngen.json'
|
||||||
author = u"Manuel Cortéz, Bill Dengler"
|
author = u"Manuel Cortéz, Bill Dengler"
|
||||||
authorEmail = "manuel@manuelcortez.net"
|
authorEmail = "manuel@manuelcortez.net"
|
||||||
copyright = u"Copyright (C) 2015, Technow S.L. \nCopyright (C) 2015, Bill Dengler\nCopyright (C) 2013-2015, Manuel cortéz."
|
copyright = u"Copyright (C) 2015, Technow S.L. \nCopyright (C) 2015, Bill Dengler\nCopyright (C) 2013-2015, Manuel cortéz."
|
||||||
description = unicode(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 = unicode(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"Bryner Villalobos, Bill Dengler (English)", u"Mohammed Al Shara (Arabic)", u"Joan Rabat, Juan Carlos Rivilla (Catalan)", u"Manuel cortéz (Spanish)", u"Sukil Etxenike Arizaleta (Basque)", u"Jani Kinnunen (finnish)", u"Rémy Ruiz (French)", u"Alba Quinteiro (Galician)", u"Steffen Schultz (German)", u"Robert Osztolykan (Hungarian)", u"Paweł Masarczyk (Polish)", u"Odenilton Júnior Santos (Portuguese)", u"Alexander Jaszyn (Russian)", u"Burak (Turkish)"]
|
translators = [u"Bryner Villalobos, Bill Dengler (English)", u"Mohammed Al Shara (Arabic)", u"Joan Rabat, Juan Carlos Rivilla (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"Robert Osztolykan (Hungarian)", u"Paweł Masarczyk (Polish)", u"Odenilton Júnior Santos (Portuguese)", u"Alexander Jaszyn (Russian)", u"Burak (Turkish)"]
|
||||||
url = u"http://twblue.es"
|
url = u"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"
|
@@ -16,4 +16,4 @@ def setup ():
|
|||||||
app = config_utils.load_config(paths.config_path(MAINFILE), paths.app_path(MAINSPEC))
|
app = config_utils.load_config(paths.config_path(MAINFILE), paths.app_path(MAINSPEC))
|
||||||
log.debug("Loading keymap...")
|
log.debug("Loading keymap...")
|
||||||
global keymap
|
global keymap
|
||||||
keymap = config_utils.load_config(paths.app_path("keymaps/"+app['app-settings']['load_keymap']), paths.app_path('keymaps/base.template'))
|
keymap = config_utils.load_config(paths.config_path("keymap.keymap"), paths.app_path("keymaps/"+app['app-settings']['load_keymap']))
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
import platform
|
import platform
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
import wx
|
import wx
|
||||||
from wxUI import buffers, dialogs, commonMessageDialogs
|
from wxUI import buffers, dialogs, commonMessageDialogs, menus
|
||||||
import user
|
import user
|
||||||
elif platform.system() == "Linux":
|
elif platform.system() == "Linux":
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
@@ -127,8 +127,9 @@ class bufferController(object):
|
|||||||
def post_tweet(self, *args, **kwargs):
|
def post_tweet(self, *args, **kwargs):
|
||||||
title = _(u"Tweet")
|
title = _(u"Tweet")
|
||||||
caption = _(u"Write the tweet here")
|
caption = _(u"Write the tweet here")
|
||||||
tweet = messages.tweet(self.session, title, caption, "")
|
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()
|
||||||
text = tweet.message.get_text()
|
text = tweet.message.get_text()
|
||||||
if len(text) > 140 and tweet.message.get("long_tweet") == True:
|
if len(text) > 140 and tweet.message.get("long_tweet") == True:
|
||||||
if tweet.image == None:
|
if tweet.image == None:
|
||||||
@@ -141,6 +142,13 @@ class bufferController(object):
|
|||||||
call_threaded(self.session.api_call, call_name="update_status_with_media", status=text, media=tweet.image)
|
call_threaded(self.session.api_call, call_name="update_status_with_media", status=text, media=tweet.image)
|
||||||
if hasattr(tweet.message, "destroy"): tweet.message.destroy()
|
if hasattr(tweet.message, "destroy"): tweet.message.destroy()
|
||||||
|
|
||||||
|
def save_positions(self):
|
||||||
|
try:
|
||||||
|
self.session.db[self.name+"_pos"]=self.buffer.list.get_selected()
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class accountPanel(bufferController):
|
class accountPanel(bufferController):
|
||||||
def __init__(self, parent, name, account, account_id):
|
def __init__(self, parent, name, account, account_id):
|
||||||
super(accountPanel, self).__init__(parent, None, name)
|
super(accountPanel, self).__init__(parent, None, name)
|
||||||
@@ -223,7 +231,8 @@ class baseBufferController(bufferController):
|
|||||||
return self.get_message()
|
return self.get_message()
|
||||||
|
|
||||||
def get_message(self):
|
def get_message(self):
|
||||||
return " ".join(self.compose_function(self.get_right_tweet(), self.session.db, self.session.settings["general"]["relative_times"]))
|
tweet = self.get_right_tweet()
|
||||||
|
return " ".join(self.compose_function(tweet, self.session.db, self.session.settings["general"]["relative_times"]))
|
||||||
|
|
||||||
def get_full_tweet(self):
|
def get_full_tweet(self):
|
||||||
tweet = self.get_right_tweet()
|
tweet = self.get_right_tweet()
|
||||||
@@ -234,6 +243,10 @@ class baseBufferController(bufferController):
|
|||||||
uri = tweet["long_uri"]
|
uri = tweet["long_uri"]
|
||||||
try:
|
try:
|
||||||
tweet = self.session.twitter.twitter.show_status(id=tweet_id)
|
tweet = self.session.twitter.twitter.show_status(id=tweet_id)
|
||||||
|
urls = utils.find_urls_in_text(tweet["text"])
|
||||||
|
for url in range(0, len(urls)):
|
||||||
|
try: tweet["text"] = tweet["text"].replace(urls[url], tweet["entities"]["urls"][url]["expanded_url"])
|
||||||
|
except IndexError: pass
|
||||||
except TwythonError as e:
|
except TwythonError as e:
|
||||||
utils.twitter_error(e)
|
utils.twitter_error(e)
|
||||||
return
|
return
|
||||||
@@ -245,6 +258,10 @@ class baseBufferController(bufferController):
|
|||||||
id = tweets.get_id(l)
|
id = tweets.get_id(l)
|
||||||
try:
|
try:
|
||||||
tweet = self.session.twitter.twitter.show_status(id=id)
|
tweet = self.session.twitter.twitter.show_status(id=id)
|
||||||
|
urls = utils.find_urls_in_text(tweet["text"])
|
||||||
|
for url in range(0, len(urls)):
|
||||||
|
try: tweet["text"] = tweet["text"].replace(urls[url], tweet["entities"]["urls"][url]["expanded_url"])
|
||||||
|
except IndexError: pass
|
||||||
except TwythonError as e:
|
except TwythonError as e:
|
||||||
utils.twitter_error(e)
|
utils.twitter_error(e)
|
||||||
return
|
return
|
||||||
@@ -344,8 +361,8 @@ class baseBufferController(bufferController):
|
|||||||
if self.name in self.session.settings["other_buffers"]["autoread_buffers"] and self.name not in self.session.settings["other_buffers"]["muted_buffers"] and self.session.settings["sound"]["session_mute"] == False:
|
if self.name in self.session.settings["other_buffers"]["autoread_buffers"] and self.name not in self.session.settings["other_buffers"]["muted_buffers"] and self.session.settings["sound"]["session_mute"] == False:
|
||||||
output.speak(" ".join(tweet[:2]))
|
output.speak(" ".join(tweet[:2]))
|
||||||
#Improve performance on Windows
|
#Improve performance on Windows
|
||||||
if platform.system() == "Windows":
|
# if platform.system() == "Windows":
|
||||||
call_threaded(utils.is_audio,item)
|
# call_threaded(utils.is_audio,item)
|
||||||
|
|
||||||
def bind_events(self):
|
def bind_events(self):
|
||||||
log.debug("Binding events...")
|
log.debug("Binding events...")
|
||||||
@@ -356,6 +373,61 @@ class baseBufferController(bufferController):
|
|||||||
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.retweet, self.buffer.retweet)
|
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.retweet, self.buffer.retweet)
|
||||||
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.direct_message, self.buffer.dm)
|
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.direct_message, self.buffer.dm)
|
||||||
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.reply, self.buffer.reply)
|
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.reply, self.buffer.reply)
|
||||||
|
# Replace for the correct way in other platforms.
|
||||||
|
widgetUtils.connect_event(self.buffer.list.list, wx.EVT_LIST_ITEM_RIGHT_CLICK, self.show_menu)
|
||||||
|
widgetUtils.connect_event(self.buffer.list.list, wx.EVT_LIST_KEY_DOWN, self.show_menu_by_key)
|
||||||
|
|
||||||
|
def show_menu(self, ev, pos=0, *args, **kwargs):
|
||||||
|
if self.buffer.list.get_count() == 0: return
|
||||||
|
if self.name == "sent_tweets" or self.name == "sent_direct_messages":
|
||||||
|
menu = menus.sentPanelMenu()
|
||||||
|
elif self.name == "direct_messages":
|
||||||
|
menu = menus.dmPanelMenu()
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.direct_message, menuitem=menu.reply)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.user_actions, menuitem=menu.userActions)
|
||||||
|
else:
|
||||||
|
menu = menus.basePanelMenu()
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.reply, menuitem=menu.reply)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.user_actions, menuitem=menu.userActions)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.retweet, menuitem=menu.retweet)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.fav, menuitem=menu.fav)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.unfav, menuitem=menu.unfav)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.url_, menuitem=menu.openUrl)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.audio, menuitem=menu.play)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.view, menuitem=menu.view)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.copy, menuitem=menu.copy)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.destroy_status, menuitem=menu.remove)
|
||||||
|
if pos != 0:
|
||||||
|
self.buffer.PopupMenu(menu, pos)
|
||||||
|
else:
|
||||||
|
self.buffer.PopupMenu(menu, ev.GetPosition())
|
||||||
|
|
||||||
|
def view(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="view_item")
|
||||||
|
|
||||||
|
def copy(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="copy_to_clipboard")
|
||||||
|
|
||||||
|
def user_actions(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="follow")
|
||||||
|
|
||||||
|
def fav(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="add_to_favourites")
|
||||||
|
|
||||||
|
def unfav(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="remove_from_favourites")
|
||||||
|
|
||||||
|
def delete_item_(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="delete_item")
|
||||||
|
|
||||||
|
def url_(self, *args, **kwargs):
|
||||||
|
self.url()
|
||||||
|
|
||||||
|
def show_menu_by_key(self, ev):
|
||||||
|
if self.buffer.list.get_count() == 0:
|
||||||
|
return
|
||||||
|
if ev.GetKeyCode() == wx.WXK_WINDOWS_MENU:
|
||||||
|
self.show_menu(widgetUtils.MENU, pos=self.buffer.list.list.GetPosition())
|
||||||
|
|
||||||
def get_tweet(self):
|
def get_tweet(self):
|
||||||
if self.session.db[self.name][self.buffer.list.get_selected()].has_key("retweeted_status"):
|
if self.session.db[self.name][self.buffer.list.get_selected()].has_key("retweeted_status"):
|
||||||
@@ -374,8 +446,9 @@ class baseBufferController(bufferController):
|
|||||||
screen_name = tweet["user"]["screen_name"]
|
screen_name = tweet["user"]["screen_name"]
|
||||||
id = tweet["id"]
|
id = tweet["id"]
|
||||||
users = utils.get_all_mentioned(tweet, self.session.db)
|
users = utils.get_all_mentioned(tweet, self.session.db)
|
||||||
message = messages.reply(self.session, _(u"Reply"), _(u"Reply to %s") % (screen_name,), "@%s " % (screen_name,), users)
|
message = messages.reply(self.session, _(u"Reply"), _(u"Reply to %s") % (screen_name,), "@%s " % (screen_name,), twishort_enabled=self.session.settings["mysc"]["twishort_enabled"], users=users)
|
||||||
if message.message.get_response() == widgetUtils.OK:
|
if message.message.get_response() == widgetUtils.OK:
|
||||||
|
self.session.settings["mysc"]["twishort_enabled"] = message.message.long_tweet.GetValue()
|
||||||
text = message.message.get_text()
|
text = message.message.get_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:
|
||||||
@@ -421,7 +494,7 @@ class baseBufferController(bufferController):
|
|||||||
self._retweet_with_comment(tweet, id)
|
self._retweet_with_comment(tweet, id)
|
||||||
|
|
||||||
def _retweet_with_comment(self, tweet, id, comment=''):
|
def _retweet_with_comment(self, tweet, id, comment=''):
|
||||||
retweet = messages.tweet(self.session, _(u"Retweet"), _(u"Add your comment to the tweet"), u"“@%s: %s ”" % (tweet["user"]["screen_name"], tweet["text"]), max=116-len("@%s " % (tweet["user"]["screen_name"],)), messageType="retweet")
|
retweet = messages.tweet(self.session, _(u"Retweet"), _(u"Add your comment to the tweet"), u"“@%s: %s ”" % (tweet["user"]["screen_name"], tweet["text"]), 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:
|
||||||
@@ -455,10 +528,9 @@ class baseBufferController(bufferController):
|
|||||||
self.session.sound.play("audio.ogg")
|
self.session.sound.play("audio.ogg")
|
||||||
if utils.is_geocoded(tweet):
|
if utils.is_geocoded(tweet):
|
||||||
self.session.sound.play("geo.ogg")
|
self.session.sound.play("geo.ogg")
|
||||||
self.session.db[str(self.name+"_pos")]=self.buffer.list.get_selected()
|
|
||||||
|
|
||||||
@_tweets_exist
|
# @_tweets_exist
|
||||||
def audio(self,url=''):
|
def audio(self, url='', *args, **kwargs):
|
||||||
if hasattr(sound.URLPlayer,'stream'):
|
if hasattr(sound.URLPlayer,'stream'):
|
||||||
return sound.URLPlayer.stop_audio(delete=True)
|
return sound.URLPlayer.stop_audio(delete=True)
|
||||||
tweet = self.get_tweet()
|
tweet = self.get_tweet()
|
||||||
@@ -478,8 +550,8 @@ class baseBufferController(bufferController):
|
|||||||
except:
|
except:
|
||||||
log.error("Exception while executing audio method.")
|
log.error("Exception while executing audio method.")
|
||||||
|
|
||||||
@_tweets_exist
|
# @_tweets_exist
|
||||||
def url(self,url='',announce=True):
|
def url(self, url='', announce=True, *args, **kwargs):
|
||||||
if url == '':
|
if url == '':
|
||||||
tweet = self.get_tweet()
|
tweet = self.get_tweet()
|
||||||
urls = utils.find_urls(tweet)
|
urls = utils.find_urls(tweet)
|
||||||
@@ -533,6 +605,26 @@ class baseBufferController(bufferController):
|
|||||||
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()
|
||||||
|
|
||||||
|
def get_quoted_tweet(self, tweet):
|
||||||
|
# try:
|
||||||
|
quoted_tweet = self.session.twitter.twitter.show_status(id=tweet["id"])
|
||||||
|
urls = utils.find_urls_in_text(quoted_tweet["text"])
|
||||||
|
for url in range(0, len(urls)):
|
||||||
|
try: quoted_tweet["text"] = quoted_tweet["text"].replace(urls[url], quoted_tweet["entities"]["urls"][url]["expanded_url"])
|
||||||
|
except IndexError: pass
|
||||||
|
# except TwythonError as e:
|
||||||
|
# utils.twitter_error(e)
|
||||||
|
# return
|
||||||
|
l = tweets.is_long(quoted_tweet)
|
||||||
|
id = tweets.get_id(l)
|
||||||
|
# try:
|
||||||
|
original_tweet = self.session.twitter.twitter.show_status(id=id)
|
||||||
|
urls = utils.find_urls_in_text(original_tweet["text"])
|
||||||
|
for url in range(0, len(urls)):
|
||||||
|
try: original_tweet["text"] = original_tweet["text"].replace(urls[url], original_tweet["entities"]["urls"][url]["expanded_url"])
|
||||||
|
except IndexError: pass
|
||||||
|
return compose.compose_quoted_tweet(quoted_tweet, original_tweet, self.session.db, self.session.settings["general"]["relative_times"])
|
||||||
|
|
||||||
class listBufferController(baseBufferController):
|
class listBufferController(baseBufferController):
|
||||||
def __init__(self, parent, function, name, sessionObject, account, sound=None, bufferType=None, list_id=None, *args, **kwargs):
|
def __init__(self, parent, function, name, sessionObject, account, sound=None, bufferType=None, list_id=None, *args, **kwargs):
|
||||||
super(listBufferController, self).__init__(parent, function, name, sessionObject, account, sound=None, bufferType=None, *args, **kwargs)
|
super(listBufferController, self).__init__(parent, function, name, sessionObject, account, sound=None, bufferType=None, *args, **kwargs)
|
||||||
@@ -597,6 +689,23 @@ class eventsBufferController(bufferController):
|
|||||||
if dlg == widgetUtils.YES:
|
if dlg == widgetUtils.YES:
|
||||||
self.buffer.list.clear()
|
self.buffer.list.clear()
|
||||||
|
|
||||||
|
def show_menu(self, ev, pos=0, *args, **kwargs):
|
||||||
|
if self.buffer.list.get_count() == 0: return
|
||||||
|
menu = menus.eventsPanelMenu()
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.view, menuitem=menu.view)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.copy, menuitem=menu.copy)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.destroy_status, menuitem=menu.remove)
|
||||||
|
if pos != 0:
|
||||||
|
self.buffer.PopupMenu(menu, pos)
|
||||||
|
else:
|
||||||
|
self.buffer.PopupMenu(menu, ev.GetPosition())
|
||||||
|
|
||||||
|
def view(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="view_item")
|
||||||
|
|
||||||
|
def copy(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="copy_to_clipboard")
|
||||||
|
|
||||||
class peopleBufferController(baseBufferController):
|
class peopleBufferController(baseBufferController):
|
||||||
def __init__(self, parent, function, name, sessionObject, account, bufferType=None, *args, **kwargs):
|
def __init__(self, parent, function, name, sessionObject, account, bufferType=None, *args, **kwargs):
|
||||||
super(peopleBufferController, self).__init__(parent, function, name, sessionObject, account, bufferType="peoplePanel")
|
super(peopleBufferController, self).__init__(parent, function, name, sessionObject, account, bufferType="peoplePanel")
|
||||||
@@ -707,6 +816,22 @@ class peopleBufferController(baseBufferController):
|
|||||||
def interact(self):
|
def interact(self):
|
||||||
user.profileController(self.session, user=self.get_right_tweet()["screen_name"])
|
user.profileController(self.session, user=self.get_right_tweet()["screen_name"])
|
||||||
|
|
||||||
|
def show_menu(self, ev, pos=0, *args, **kwargs):
|
||||||
|
menu = menus.peoplePanelMenu()
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.direct_message, menuitem=menu.reply)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.user_actions, menuitem=menu.userActions)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.details, menuitem=menu.details)
|
||||||
|
# widgetUtils.connect_event(menu, widgetUtils.MENU, self.lists, menuitem=menu.lists)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.view, menuitem=menu.view)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.copy, menuitem=menu.copy)
|
||||||
|
if pos != 0:
|
||||||
|
self.buffer.PopupMenu(menu, pos)
|
||||||
|
else:
|
||||||
|
self.buffer.PopupMenu(menu, ev.GetPosition())
|
||||||
|
|
||||||
|
def details(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="user_details")
|
||||||
|
|
||||||
class searchBufferController(baseBufferController):
|
class searchBufferController(baseBufferController):
|
||||||
def start_stream(self):
|
def start_stream(self):
|
||||||
log.debug("Starting stream for %s buffer, %s account and %s type" % (self.name, self.account, self.type))
|
log.debug("Starting stream for %s buffer, %s account and %s type" % (self.name, self.account, self.type))
|
||||||
@@ -783,6 +908,7 @@ class trendsBufferController(bufferController):
|
|||||||
self.buffer.name = name
|
self.buffer.name = name
|
||||||
self.compose_function = self.compose_function_
|
self.compose_function = self.compose_function_
|
||||||
self.get_formatted_message = self.get_message
|
self.get_formatted_message = self.get_message
|
||||||
|
self.reply = self.search_topic
|
||||||
|
|
||||||
def start_stream(self):
|
def start_stream(self):
|
||||||
try:
|
try:
|
||||||
@@ -809,10 +935,11 @@ class trendsBufferController(bufferController):
|
|||||||
def bind_events(self):
|
def bind_events(self):
|
||||||
log.debug("Binding events...")
|
log.debug("Binding events...")
|
||||||
self.buffer.list.list.Bind(wx.EVT_CHAR_HOOK, self.get_event)
|
self.buffer.list.list.Bind(wx.EVT_CHAR_HOOK, self.get_event)
|
||||||
# widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.post_tweet, self.buffer.tweet)
|
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.tweet_about_this_trend, self.buffer.tweetTrendBtn)
|
||||||
# widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.retweet, self.buffer.retweet)
|
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.post_tweet, self.buffer.tweet)
|
||||||
# widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.direct_message, self.buffer.dm)
|
widgetUtils.connect_event(self.buffer.list.list, wx.EVT_LIST_ITEM_RIGHT_CLICK, self.show_menu)
|
||||||
# widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.reply, self.buffer.reply)
|
widgetUtils.connect_event(self.buffer.list.list, wx.EVT_LIST_KEY_DOWN, self.show_menu_by_key)
|
||||||
|
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.search_topic, self.buffer.search_topic)
|
||||||
|
|
||||||
def get_message(self):
|
def get_message(self):
|
||||||
return self.compose_function(self.trends[self.buffer.list.get_selected()])[0]
|
return self.compose_function(self.trends[self.buffer.list.get_selected()])[0]
|
||||||
@@ -827,8 +954,52 @@ class trendsBufferController(bufferController):
|
|||||||
elif dlg == widgetUtils.NO:
|
elif dlg == widgetUtils.NO:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def interact(self, *args, **kwargs):
|
def search_topic(self, *args, **kwargs):
|
||||||
self.searchfunction(value=self.get_message())
|
topic = self.trends[self.buffer.list.get_selected()]["name"]
|
||||||
|
pub.sendMessage("search", term=topic)
|
||||||
|
|
||||||
|
def show_menu(self, ev, pos=0, *args, **kwargs):
|
||||||
|
menu = menus.trendsPanelMenu()
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.search_topic, menuitem=menu.search_topic)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.tweet_about_this_trend, menuitem=menu.tweetThisTrend)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.view, menuitem=menu.view)
|
||||||
|
widgetUtils.connect_event(menu, widgetUtils.MENU, self.copy, menuitem=menu.copy)
|
||||||
|
if pos != 0:
|
||||||
|
self.buffer.PopupMenu(menu, pos)
|
||||||
|
else:
|
||||||
|
self.buffer.PopupMenu(menu, ev.GetPosition())
|
||||||
|
|
||||||
|
def view(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="view_item")
|
||||||
|
|
||||||
|
def copy(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("execute-action", action="copy_to_clipboard")
|
||||||
|
|
||||||
|
def tweet_about_this_trend(self, *args, **kwargs):
|
||||||
|
if self.buffer.list.get_count() == 0: return
|
||||||
|
title = _(u"Tweet")
|
||||||
|
caption = _(u"Write the tweet here")
|
||||||
|
tweet = messages.tweet(self.session, title, caption, self.get_message()+ " ", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"])
|
||||||
|
tweet.message.set_cursor_at_end()
|
||||||
|
if tweet.message.get_response() == widgetUtils.OK:
|
||||||
|
self.session.settings["mysc"]["twishort_enabled"] = tweet.message.long_tweet.GetValue()
|
||||||
|
text = tweet.message.get_text()
|
||||||
|
if len(text) > 140 and tweet.message.get("long_tweet") == True:
|
||||||
|
if tweet.image == None:
|
||||||
|
text = twishort.create_tweet(self.session.settings["twitter"]["user_key"], self.session.settings["twitter"]["user_secret"], text)
|
||||||
|
else:
|
||||||
|
text = twishort.create_tweet(self.session.settings["twitter"]["user_key"], self.session.settings["twitter"]["user_secret"], text, 1)
|
||||||
|
if tweet.image == None:
|
||||||
|
call_threaded(self.session.api_call, call_name="update_status", status=text)
|
||||||
|
else:
|
||||||
|
call_threaded(self.session.api_call, call_name="update_status_with_media", status=text, media=tweet.image)
|
||||||
|
if hasattr(tweet.message, "destroy"): tweet.message.destroy()
|
||||||
|
|
||||||
|
def show_menu_by_key(self, ev):
|
||||||
|
if self.buffer.list.get_count() == 0:
|
||||||
|
return
|
||||||
|
if ev.GetKeyCode() == wx.WXK_WINDOWS_MENU:
|
||||||
|
self.show_menu(widgetUtils.MENU, pos=self.buffer.list.list.GetPosition())
|
||||||
|
|
||||||
class conversationBufferController(searchBufferController):
|
class conversationBufferController(searchBufferController):
|
||||||
|
|
||||||
|
@@ -15,19 +15,30 @@ class listsController(object):
|
|||||||
self.dialog.populate_list(self.get_all_lists())
|
self.dialog.populate_list(self.get_all_lists())
|
||||||
widgetUtils.connect_event(self.dialog.createBtn, widgetUtils.BUTTON_PRESSED, self.create_list)
|
widgetUtils.connect_event(self.dialog.createBtn, widgetUtils.BUTTON_PRESSED, self.create_list)
|
||||||
widgetUtils.connect_event(self.dialog.editBtn, widgetUtils.BUTTON_PRESSED, self.edit_list)
|
widgetUtils.connect_event(self.dialog.editBtn, widgetUtils.BUTTON_PRESSED, self.edit_list)
|
||||||
|
widgetUtils.connect_event(self.dialog.deleteBtn, widgetUtils.BUTTON_PRESSED, self.remove_list)
|
||||||
widgetUtils.connect_event(self.dialog.view, widgetUtils.BUTTON_PRESSED, self.open_list_as_buffer)
|
widgetUtils.connect_event(self.dialog.view, widgetUtils.BUTTON_PRESSED, self.open_list_as_buffer)
|
||||||
|
widgetUtils.connect_event(self.dialog.deleteBtn, widgetUtils.BUTTON_PRESSED, self.remove_list)
|
||||||
|
else:
|
||||||
|
self.dialog = lists.userListViewer(user)
|
||||||
|
self.dialog.populate_list(self.get_user_lists(user))
|
||||||
|
widgetUtils.connect_event(self.dialog.createBtn, widgetUtils.BUTTON_PRESSED, self.subscribe)
|
||||||
|
widgetUtils.connect_event(self.dialog.deleteBtn, widgetUtils.BUTTON_PRESSED, self.unsubscribe)
|
||||||
self.dialog.get_response()
|
self.dialog.get_response()
|
||||||
|
|
||||||
def get_all_lists(self):
|
def get_all_lists(self):
|
||||||
return [compose.compose_list(item) for item in self.session.db["lists"]]
|
return [compose.compose_list(item) for item in self.session.db["lists"]]
|
||||||
|
|
||||||
|
def get_user_lists(self, user):
|
||||||
|
self.lists = self.session.twitter.twitter.show_lists(reverse=True, screen_name=user)
|
||||||
|
return [compose.compose_list(item) for item in self.lists]
|
||||||
|
|
||||||
def create_list(self, *args, **kwargs):
|
def create_list(self, *args, **kwargs):
|
||||||
dialog = lists.createListDialog()
|
dialog = lists.createListDialog()
|
||||||
if dialog.get_response() == widgetUtils.OK:
|
if dialog.get_response() == widgetUtils.OK:
|
||||||
name = dialog.get("name")
|
name = dialog.get("name")
|
||||||
description = dialog.get("description")
|
description = dialog.get("description")
|
||||||
p = dialog.get("public")
|
p = dialog.get("public")
|
||||||
if public == True:
|
if p == True:
|
||||||
mode = "public"
|
mode = "public"
|
||||||
else:
|
else:
|
||||||
mode = "private"
|
mode = "private"
|
||||||
@@ -73,4 +84,23 @@ class listsController(object):
|
|||||||
def open_list_as_buffer(self, *args, **kwargs):
|
def open_list_as_buffer(self, *args, **kwargs):
|
||||||
if self.dialog.lista.get_count() == 0: return
|
if self.dialog.lista.get_count() == 0: return
|
||||||
list = self.session.db["lists"][self.dialog.get_item()]
|
list = self.session.db["lists"][self.dialog.get_item()]
|
||||||
pub.sendMessage("create-new-buffer", buffer="list", account=self.session.db["user_name"], create=list["slug"])
|
pub.sendMessage("create-new-buffer", buffer="list", account=self.session.db["user_name"], create=list["name"])
|
||||||
|
|
||||||
|
def subscribe(self, *args, **kwargs):
|
||||||
|
if self.dialog.lista.get_count() == 0: return
|
||||||
|
list_id = self.lists[self.dialog.get_item()]["id"]
|
||||||
|
try:
|
||||||
|
list = self.session.twitter.twitter.subscribe_to_list(list_id=list_id)
|
||||||
|
item = utils.find_item(list["id"], self.session.db["lists"])
|
||||||
|
self.session.db["lists"].append(list)
|
||||||
|
except TwythonError as e:
|
||||||
|
output.speak("error %s: %s" % (e.status_code, e.msg))
|
||||||
|
|
||||||
|
def unsubscribe(self, *args, **kwargs):
|
||||||
|
if self.dialog.lista.get_count() == 0: return
|
||||||
|
list_id = self.lists[self.dialog.get_item()]["id"]
|
||||||
|
try:
|
||||||
|
list = self.session.twitter.twitter.unsubscribe_from_list(list_id=list_id)
|
||||||
|
self.session.db["lists"].remove(list)
|
||||||
|
except TwythonError as e:
|
||||||
|
output.speak("error %s: %s" % (e.status_code, e.msg))
|
||||||
|
@@ -90,12 +90,14 @@ class Controller(object):
|
|||||||
""" Gets the last valid buffer for an account.
|
""" Gets the last valid buffer for an account.
|
||||||
account str: A twitter username.
|
account str: A twitter username.
|
||||||
The last valid buffer is the last buffer that contains a session object assigned."""
|
The last valid buffer is the last buffer that contains a session object assigned."""
|
||||||
|
# results = self.get_buffers_for_account(account)
|
||||||
results = self.get_buffers_for_account(account)
|
results = self.get_buffers_for_account(account)
|
||||||
return self.view.search(results[-1].name, results[-1].account)
|
return self.view.search(results[-1].name, results[-1].account)
|
||||||
|
|
||||||
def get_buffers_for_account(self, account):
|
def get_buffers_for_account(self, account):
|
||||||
results = []
|
results = []
|
||||||
[results.append(i) for i in self.buffers if i.account == account and i.invisible == True]
|
buffers = self.view.get_buffers()
|
||||||
|
[results.append(self.search_buffer(i.name, i.account)) for i in buffers if i.account == account and (i.type != "account")]
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def bind_stream_events(self):
|
def bind_stream_events(self):
|
||||||
@@ -126,7 +128,8 @@ class Controller(object):
|
|||||||
pub.subscribe(self.manage_stream_errors, "stream-error")
|
pub.subscribe(self.manage_stream_errors, "stream-error")
|
||||||
pub.subscribe(self.create_new_buffer, "create-new-buffer")
|
pub.subscribe(self.create_new_buffer, "create-new-buffer")
|
||||||
pub.subscribe(self.restart_streams, "restart-streams")
|
pub.subscribe(self.restart_streams, "restart-streams")
|
||||||
|
pub.subscribe(self.execute_action, "execute-action")
|
||||||
|
pub.subscribe(self.search_topic, "search")
|
||||||
if system == "Windows":
|
if system == "Windows":
|
||||||
pub.subscribe(self.invisible_shorcuts_changed, "invisible-shorcuts-changed")
|
pub.subscribe(self.invisible_shorcuts_changed, "invisible-shorcuts-changed")
|
||||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.show_hide, menuitem=self.view.show_hide)
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.show_hide, menuitem=self.view.show_hide)
|
||||||
@@ -154,7 +157,9 @@ class Controller(object):
|
|||||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.delete, self.view.delete)
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.delete, self.view.delete)
|
||||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.follow, menuitem=self.view.follow)
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.follow, menuitem=self.view.follow)
|
||||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.send_dm, self.view.dm)
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.send_dm, self.view.dm)
|
||||||
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.view_user_lists, menuitem=self.view.viewLists)
|
||||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.get_more_items, menuitem=self.view.load_previous_items)
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.get_more_items, menuitem=self.view.load_previous_items)
|
||||||
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.view_user_lists, menuitem=self.view.viewLists)
|
||||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.clear_buffer, menuitem=self.view.clear)
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.clear_buffer, menuitem=self.view.clear)
|
||||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.remove_buffer, self.view.deleteTl)
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.remove_buffer, self.view.deleteTl)
|
||||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.check_for_updates, self.view.check_for_updates)
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.check_for_updates, self.view.check_for_updates)
|
||||||
@@ -172,6 +177,8 @@ class Controller(object):
|
|||||||
widgetUtils.connect_event(self.view.nb, widgetUtils.NOTEBOOK_PAGE_CHANGED, self.buffer_changed)
|
widgetUtils.connect_event(self.view.nb, widgetUtils.NOTEBOOK_PAGE_CHANGED, self.buffer_changed)
|
||||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.report_error, self.view.reportError)
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.report_error, self.view.reportError)
|
||||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.view_documentation, self.view.doc)
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.view_documentation, self.view.doc)
|
||||||
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.add_to_list, self.view.addToList)
|
||||||
|
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.remove_from_list, self.view.removeFromList)
|
||||||
|
|
||||||
def set_systray_icon(self):
|
def set_systray_icon(self):
|
||||||
self.systrayIcon = sysTrayIcon.SysTrayIcon()
|
self.systrayIcon = sysTrayIcon.SysTrayIcon()
|
||||||
@@ -233,7 +240,6 @@ class Controller(object):
|
|||||||
self.create_ignored_session_buffer(session_.sessions[i])
|
self.create_ignored_session_buffer(session_.sessions[i])
|
||||||
continue
|
continue
|
||||||
self.create_buffers(session_.sessions[i])
|
self.create_buffers(session_.sessions[i])
|
||||||
self.set_buffer_positions(session_.sessions[i])
|
|
||||||
|
|
||||||
# Connection checker executed each minute.
|
# Connection checker executed each minute.
|
||||||
self.checker_function = RepeatingTimer(60, self.check_connection)
|
self.checker_function = RepeatingTimer(60, self.check_connection)
|
||||||
@@ -244,6 +250,7 @@ class Controller(object):
|
|||||||
for i in session_.sessions:
|
for i in session_.sessions:
|
||||||
if session_.sessions[i].is_logged == False: continue
|
if session_.sessions[i].is_logged == False: continue
|
||||||
self.start_buffers(session_.sessions[i])
|
self.start_buffers(session_.sessions[i])
|
||||||
|
self.set_buffer_positions(session_.sessions[i])
|
||||||
if config.app["app-settings"]["play_ready_sound"] == True:
|
if config.app["app-settings"]["play_ready_sound"] == True:
|
||||||
session_.sessions[session_.sessions.keys()[0]].sound.play("ready.ogg")
|
session_.sessions[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:
|
||||||
@@ -261,6 +268,7 @@ class Controller(object):
|
|||||||
for i in session_.sessions:
|
for i in session_.sessions:
|
||||||
if session_.sessions[i].session_id == session_id: session = session_.sessions[i]
|
if session_.sessions[i].session_id == session_id: session = session_.sessions[i]
|
||||||
session.login()
|
session.login()
|
||||||
|
session.db = dict()
|
||||||
self.create_buffers(session, False)
|
self.create_buffers(session, False)
|
||||||
self.start_buffers(session)
|
self.start_buffers(session)
|
||||||
|
|
||||||
@@ -284,11 +292,11 @@ class Controller(object):
|
|||||||
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=_(u"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", sound="dm_received.ogg")
|
dm = buffersController.baseBufferController(self.view.nb, "get_direct_messages", "direct_messages", session, session.db["user_name"], bufferType="dmPanel", 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=_(u"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")
|
sent_dm = buffersController.baseBufferController(self.view.nb, "get_sent_messages", "sent_direct_messages", session, session.db["user_name"], bufferType="dmPanel", 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=_(u"Sent direct messages"), pos=self.view.search(session.db["user_name"], session.db["user_name"]))
|
||||||
elif i == 'sent_tweets':
|
elif i == 'sent_tweets':
|
||||||
@@ -358,40 +366,27 @@ class Controller(object):
|
|||||||
buffer.start_stream()
|
buffer.start_stream()
|
||||||
buffer.searchfunction = self.search
|
buffer.searchfunction = self.search
|
||||||
self.buffers.append(buffer)
|
self.buffers.append(buffer)
|
||||||
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"]))
|
|
||||||
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"]))
|
||||||
|
|
||||||
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."
|
||||||
for i in self.buffers:
|
for i in self.buffers:
|
||||||
if str(i.name+"_pos") in session.db and hasattr(i.buffer,'list'):
|
if i.account == session.db["user_name"] and session.db.has_key(i.name+"_pos") and hasattr(i.buffer,'list'):
|
||||||
i.buffer.list.select_item(session.db[str(i.name+"_pos")])
|
i.buffer.list.select_item(session.db[str(i.name+"_pos")])
|
||||||
|
|
||||||
def logout_account(self, session_id):
|
def logout_account(self, session_id):
|
||||||
for i in session_.sessions:
|
for i in session_.sessions:
|
||||||
if session_.sessions[i].session_id == session_id: session = session_.sessions[i]
|
if session_.sessions[i].session_id == session_id: session = session_.sessions[i]
|
||||||
user = session.db["user_name"]
|
user = session.db["user_name"]
|
||||||
self.destroy_buffer("home_timeline", user)
|
delete_buffers = []
|
||||||
self.destroy_buffer("mentions", user)
|
for i in self.buffers:
|
||||||
self.destroy_buffer("direct_messages", user)
|
if i.account == user and i.name != user:
|
||||||
self.destroy_buffer("sent_direct_messages", user)
|
delete_buffers.append(i.name)
|
||||||
self.destroy_buffer("sent_tweets", user)
|
for i in delete_buffers:
|
||||||
self.destroy_buffer("favourites", user)
|
self.destroy_buffer(i, user)
|
||||||
self.destroy_buffer("followers", user)
|
session.db = None
|
||||||
self.destroy_buffer("friends", user)
|
|
||||||
self.destroy_buffer("blocked", user)
|
|
||||||
self.destroy_buffer("muted", user)
|
|
||||||
self.destroy_buffer("events", user)
|
|
||||||
self.destroy_buffer("timelines", user)
|
|
||||||
for i in session.settings["other_buffers"]["timelines"]:
|
|
||||||
self.destroy_buffer("%s-timeline" % (i,), user)
|
|
||||||
self.destroy_buffer("favs_timelines", user)
|
|
||||||
self.destroy_buffer("searches", user)
|
|
||||||
for i in session.settings["other_buffers"]["tweet_searches"]:
|
|
||||||
self.destroy_buffer("%s-searchterm" % (i,), user)
|
|
||||||
for i in session.settings["other_buffers"]["trending_topic_buffers"]:
|
|
||||||
self.destroy_buffer("%s_tt" % (i,), user)
|
|
||||||
|
|
||||||
def destroy_buffer(self, buffer_name, account):
|
def destroy_buffer(self, buffer_name, account):
|
||||||
buffer = self.search_buffer(buffer_name, account)
|
buffer = self.search_buffer(buffer_name, account)
|
||||||
@@ -402,7 +397,10 @@ class Controller(object):
|
|||||||
self.buffers.remove(buffer)
|
self.buffers.remove(buffer)
|
||||||
del buffer
|
del buffer
|
||||||
|
|
||||||
def search(self, value="", *args, **kwargs):
|
def search_topic(self, term):
|
||||||
|
self.search(value=term)
|
||||||
|
|
||||||
|
def search(self, event=None, value="", *args, **kwargs):
|
||||||
""" Searches words or users in twitter. This creates a new buffer containing the search results."""
|
""" Searches words or users in twitter. This creates a new buffer containing the search results."""
|
||||||
log.debug("Creating a new search...")
|
log.debug("Creating a new search...")
|
||||||
dlg = dialogs.search.searchDialog(value)
|
dlg = dialogs.search.searchDialog(value)
|
||||||
@@ -476,8 +474,20 @@ class Controller(object):
|
|||||||
buffer = self.get_best_buffer()
|
buffer = self.get_best_buffer()
|
||||||
SoundsTutorial.soundsTutorial(buffer.session)
|
SoundsTutorial.soundsTutorial(buffer.session)
|
||||||
|
|
||||||
def view_user_lists(self, users):
|
def view_user_lists(self, *args, **kwargs):
|
||||||
pass
|
buff = self.get_best_buffer()
|
||||||
|
if not hasattr(buff, "get_right_tweet"): return
|
||||||
|
tweet = buff.get_right_tweet()
|
||||||
|
if buff.type != "people":
|
||||||
|
users = utils.get_all_users(tweet, buff.session.db)
|
||||||
|
else:
|
||||||
|
users = [tweet["screen_name"]]
|
||||||
|
dlg = dialogs.utils.selectUserDialog(_(u"Select the user"), users)
|
||||||
|
if dlg.get_response() == widgetUtils.OK:
|
||||||
|
user = dlg.get_user()
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
l = listsController.listsController(buff.session, user=user)
|
||||||
|
|
||||||
def add_to_list(self, *args, **kwargs):
|
def add_to_list(self, *args, **kwargs):
|
||||||
buff = self.get_best_buffer()
|
buff = self.get_best_buffer()
|
||||||
@@ -506,8 +516,32 @@ class Controller(object):
|
|||||||
except TwythonError as e:
|
except TwythonError as e:
|
||||||
output.speak("error %s: %s" % (e.error_code, e.msg))
|
output.speak("error %s: %s" % (e.error_code, e.msg))
|
||||||
|
|
||||||
def remove_from_list(self, user):
|
def remove_from_list(self, *args, **kwargs):
|
||||||
pass
|
buff = self.get_best_buffer()
|
||||||
|
if not hasattr(buff, "get_right_tweet"): return
|
||||||
|
tweet = buff.get_right_tweet()
|
||||||
|
if buff.type != "people":
|
||||||
|
users = utils.get_all_users(tweet, buff.session.db)
|
||||||
|
else:
|
||||||
|
users = [tweet["screen_name"]]
|
||||||
|
dlg = dialogs.utils.selectUserDialog(_(u"Select the user"), users)
|
||||||
|
if dlg.get_response() == widgetUtils.OK:
|
||||||
|
user = dlg.get_user()
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
dlg = dialogs.lists.removeUserListDialog()
|
||||||
|
dlg.populate_list([compose.compose_list(item) for item in buff.session.db["lists"]])
|
||||||
|
if dlg.get_response() == widgetUtils.OK:
|
||||||
|
try:
|
||||||
|
list = buff.session.twitter.twitter.delete_list_member(list_id=buff.session.db["lists"][dlg.get_item()]["id"], screen_name=user)
|
||||||
|
older_list = utils.find_item(buff.session.db["lists"][dlg.get_item()]["id"], buff.session.db["lists"])
|
||||||
|
listBuffer = self.search_buffer("%s-list" % (buff.session.db["lists"][dlg.get_item()]["name"].lower()), buff.session.db["user_name"])
|
||||||
|
if listBuffer != None: listBuffer.get_user_ids()
|
||||||
|
buff.session.db["lists"].pop(older_list)
|
||||||
|
buff.session.db["lists"].append(list)
|
||||||
|
if listBuffer != None: pub.sendMessage("restart-streams", streams=["timelinesStream"], session=buff.session)
|
||||||
|
except TwythonError as e:
|
||||||
|
output.speak("error %s: %s" % (e.error_code, e.msg))
|
||||||
|
|
||||||
def list_manager(self, *args, **kwargs):
|
def list_manager(self, *args, **kwargs):
|
||||||
s = self.get_best_buffer().session
|
s = self.get_best_buffer().session
|
||||||
@@ -559,6 +593,7 @@ class Controller(object):
|
|||||||
self.exit_()
|
self.exit_()
|
||||||
|
|
||||||
def exit_(self, *args, **kwargs):
|
def exit_(self, *args, **kwargs):
|
||||||
|
for i in self.buffers: i.save_positions()
|
||||||
log.debug("Exiting...")
|
log.debug("Exiting...")
|
||||||
log.debug("Saving global configuration...")
|
log.debug("Saving global configuration...")
|
||||||
config.app.write()
|
config.app.write()
|
||||||
@@ -696,6 +731,9 @@ class Controller(object):
|
|||||||
msg = messages.viewTweet(tweet, tweetsList)
|
msg = messages.viewTweet(tweet, tweetsList)
|
||||||
elif buffer.type == "account" or buffer.type == "empty":
|
elif buffer.type == "account" or buffer.type == "empty":
|
||||||
return
|
return
|
||||||
|
elif buffer.name == "sent_tweets":
|
||||||
|
tweet, tweetsList = buffer.get_full_tweet()
|
||||||
|
msg = messages.viewTweet(tweet, tweetsList)
|
||||||
else:
|
else:
|
||||||
non_tweet = buffer.get_formatted_message()
|
non_tweet = buffer.get_formatted_message()
|
||||||
msg = messages.viewTweet(non_tweet, [], False)
|
msg = messages.viewTweet(non_tweet, [], False)
|
||||||
@@ -713,8 +751,7 @@ class Controller(object):
|
|||||||
users = [tweet["screen_name"]]
|
users = [tweet["screen_name"]]
|
||||||
dlg = dialogs.userSelection.selectUserDialog(users=users, default=default)
|
dlg = dialogs.userSelection.selectUserDialog(users=users, default=default)
|
||||||
if dlg.get_response() == widgetUtils.OK:
|
if dlg.get_response() == widgetUtils.OK:
|
||||||
buffer = self.get_best_buffer()
|
usr = utils.if_user_exists(buff.session.twitter.twitter, dlg.get_user())
|
||||||
usr = utils.if_user_exists(buffer.session.twitter.twitter, dlg.get_user())
|
|
||||||
if usr != None:
|
if usr != None:
|
||||||
if usr["protected"] == True:
|
if usr["protected"] == True:
|
||||||
if usr["following"] == False:
|
if usr["following"] == False:
|
||||||
@@ -723,32 +760,38 @@ class Controller(object):
|
|||||||
answer = commonMessageDialogs.protected_user()
|
answer = commonMessageDialogs.protected_user()
|
||||||
if answer == widgetUtils.NO: return
|
if answer == widgetUtils.NO: return
|
||||||
if dlg.get_action() == "tweets":
|
if dlg.get_action() == "tweets":
|
||||||
if dlg.get_user() in buffer.session.settings["other_buffers"]["timelines"]:
|
if usr["statuses_count"] == 0:
|
||||||
|
commonMessageDialogs.no_tweets()
|
||||||
|
return
|
||||||
|
if dlg.get_user() in buff.session.settings["other_buffers"]["timelines"]:
|
||||||
commonMessageDialogs.timeline_exist()
|
commonMessageDialogs.timeline_exist()
|
||||||
return
|
return
|
||||||
tl = buffersController.baseBufferController(self.view.nb, "get_user_timeline", "%s-timeline" % (dlg.get_user(),), buffer.session, buffer.session.db["user_name"], bufferType=None, screen_name=dlg.get_user())
|
tl = buffersController.baseBufferController(self.view.nb, "get_user_timeline", "%s-timeline" % (dlg.get_user(),), buff.session, buff.session.db["user_name"], bufferType=None, screen_name=dlg.get_user())
|
||||||
tl.start_stream()
|
tl.start_stream()
|
||||||
pos=self.view.search("timelines", buffer.session.db["user_name"])
|
pos=self.view.search("timelines", buff.session.db["user_name"])
|
||||||
self.insert_buffer(tl, pos)
|
self.insert_buffer(tl, pos+1)
|
||||||
# self.buffers.insert(pos+1, tl)
|
# self.buffers.insert(pos+1, tl)
|
||||||
self.view.insert_buffer(tl.buffer, name=_(u"Timeline for {}").format(dlg.get_user()), pos=pos)
|
self.view.insert_buffer(tl.buffer, name=_(u"Timeline for {}").format(dlg.get_user()), pos=pos)
|
||||||
buffer.session.settings["other_buffers"]["timelines"].append(dlg.get_user())
|
buff.session.settings["other_buffers"]["timelines"].append(dlg.get_user())
|
||||||
pub.sendMessage("restart-streams", streams=["timelinesStream"], session=buffer.session)
|
pub.sendMessage("restart-streams", streams=["timelinesStream"], session=buff.session)
|
||||||
buffer.session.sound.play("create_timeline.ogg")
|
buff.session.sound.play("create_timeline.ogg")
|
||||||
else:
|
else:
|
||||||
|
if usr["favourites_count"] == 0:
|
||||||
|
commonMessageDialogs.no_favs()
|
||||||
|
return
|
||||||
if dlg.get_user() in buffer.session.settings["other_buffers"]["favourites_timelines"]:
|
if dlg.get_user() in buffer.session.settings["other_buffers"]["favourites_timelines"]:
|
||||||
commonMessageDialogs.timeline_exist()
|
commonMessageDialogs.timeline_exist()
|
||||||
return
|
return
|
||||||
tl = buffersController.baseBufferController(self.view.nb, "get_favorites", "%s-favorite" % (dlg.get_user(),), buffer.session, buffer.session.db["user_name"], bufferType=None, screen_name=dlg.get_user())
|
tl = buffersController.baseBufferController(self.view.nb, "get_favorites", "%s-favorite" % (dlg.get_user(),), buff.session, buff.session.db["user_name"], bufferType=None, screen_name=dlg.get_user())
|
||||||
pos=self.view.search("favs_timelines", buffer.session.db["user_name"])
|
pos=self.view.search("favs_timelines", buff.session.db["user_name"])
|
||||||
self.insert_buffer(tl, pos)
|
self.insert_buffer(tl, pos+1)
|
||||||
# self.buffers.insert(pos+1, tl)
|
# self.buffers.insert(pos+1, tl)
|
||||||
self.view.insert_buffer(buffer=tl.buffer, name=_(u"Favourites timeline for {}").format(dlg.get_user()), pos=pos)
|
self.view.insert_buffer(buffer=tl.buffer, name=_(u"Favourites timeline for {}").format(dlg.get_user()), pos=pos)
|
||||||
tl.start_stream()
|
tl.start_stream()
|
||||||
tl.timer = RepeatingTimer(300, tl.start_stream)
|
tl.timer = RepeatingTimer(300, tl.start_stream)
|
||||||
tl.timer.start()
|
tl.timer.start()
|
||||||
buffer.session.settings["other_buffers"]["favourites_timelines"].append(dlg.get_user())
|
buff.session.settings["other_buffers"]["favourites_timelines"].append(dlg.get_user())
|
||||||
buffer.session.sound.play("create_timeline.ogg")
|
buff.session.sound.play("create_timeline.ogg")
|
||||||
else:
|
else:
|
||||||
commonMessageDialogs.user_not_exist()
|
commonMessageDialogs.user_not_exist()
|
||||||
|
|
||||||
@@ -920,13 +963,11 @@ class Controller(object):
|
|||||||
|
|
||||||
def left(self, *args, **kwargs):
|
def left(self, *args, **kwargs):
|
||||||
buff = self.view.get_current_buffer_pos()
|
buff = self.view.get_current_buffer_pos()
|
||||||
print buff
|
|
||||||
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(_(u"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:
|
||||||
print "This is the last buffer"
|
|
||||||
self.view.change_buffer(self.get_last_buffer(buffer.account))
|
self.view.change_buffer(self.get_last_buffer(buffer.account))
|
||||||
else:
|
else:
|
||||||
self.view.change_buffer(buff-1)
|
self.view.change_buffer(buff-1)
|
||||||
@@ -1199,9 +1240,23 @@ class Controller(object):
|
|||||||
log.debug("Starting the streaming endpoint")
|
log.debug("Starting the streaming endpoint")
|
||||||
session.start_streaming()
|
session.start_streaming()
|
||||||
|
|
||||||
|
def set_positions(self):
|
||||||
|
for i in session_.sessions:
|
||||||
|
self.set_buffer_positions(i)
|
||||||
|
|
||||||
def manage_stream_errors(self, session):
|
def manage_stream_errors(self, session):
|
||||||
log.error("An error ocurred with the stream for the %s session. It will be destroyed" % (session,))
|
log.error(" Restarting %s session streams. It will be destroyed" % (session,))
|
||||||
s = session_.sessions[session]
|
s = session_.sessions[session]
|
||||||
|
try:
|
||||||
|
if hasattr(s, "main_stream"): del s.main_stream
|
||||||
|
del s.timelinesStream
|
||||||
|
s.counter = 0
|
||||||
|
s.reconnection_function_active = False
|
||||||
|
except AttributeError:
|
||||||
|
log.error("Error deleting some thing")
|
||||||
|
for i in self.buffers:
|
||||||
|
if i.invisible == True and i.session.session_id == s.session_id and i.type != "people":
|
||||||
|
i.start_stream()
|
||||||
s.listen_stream_error()
|
s.listen_stream_error()
|
||||||
|
|
||||||
def check_connection(self):
|
def check_connection(self):
|
||||||
@@ -1249,7 +1304,8 @@ class Controller(object):
|
|||||||
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)
|
||||||
self.buffers.append(tl)
|
pos=self.view.search("lists", buff.session.db["user_name"])
|
||||||
|
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=_(u"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)
|
||||||
@@ -1334,28 +1390,18 @@ class Controller(object):
|
|||||||
os.chdir("../../")
|
os.chdir("../../")
|
||||||
|
|
||||||
def insert_buffer(self, buffer, position):
|
def insert_buffer(self, buffer, position):
|
||||||
# print ref_buf.name, ref_buf.account
|
self.buffers.insert(position, buffer)
|
||||||
# if ref_buf.account != buffer.account or ref_buf.type == "account" or type(ref_buf) == buffers.emptyPanel:
|
|
||||||
buffers = self.get_buffers_for_account(buffer.account)
|
def copy_to_clipboard(self, *args, **kwargs):
|
||||||
# ref_buf = self.buffers[position+1]
|
output.copy(self.get_current_buffer().get_message())
|
||||||
empty = True
|
output.speak(_(u"Copied"))
|
||||||
for i in buffers[position+1:]:
|
|
||||||
if i.type == "account" or i.invisible == False:
|
def repeat_item(self, *args, **kwargs):
|
||||||
empty = True
|
output.speak(self.get_current_buffer().get_message())
|
||||||
else:
|
|
||||||
empty = False
|
def execute_action(self, action):
|
||||||
if empty == True:
|
if hasattr(self, action):
|
||||||
self.buffers.append(buffer)
|
getattr(self, action)()
|
||||||
print "account"
|
|
||||||
else:
|
|
||||||
self.buffers.insert(position+1, buffer)
|
|
||||||
for i in self.buffers:
|
|
||||||
print i.name, i.account
|
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
config.app.write()
|
config.app.write()
|
||||||
|
|
||||||
def change_buffer(self, bufferPosition):
|
|
||||||
buff = self.buffers[bufferPosition]
|
|
||||||
newPos = self.view.search(buff.name, buff.account)
|
|
||||||
self.view.change_buffer(newPos)
|
|
@@ -25,6 +25,7 @@ class basicTweet(object):
|
|||||||
widgetUtils.connect_event(self.message.spellcheck, widgetUtils.BUTTON_PRESSED, self.spellcheck)
|
widgetUtils.connect_event(self.message.spellcheck, widgetUtils.BUTTON_PRESSED, self.spellcheck)
|
||||||
widgetUtils.connect_event(self.message.attach, widgetUtils.BUTTON_PRESSED, self.attach)
|
widgetUtils.connect_event(self.message.attach, widgetUtils.BUTTON_PRESSED, self.attach)
|
||||||
# if system == "Windows":
|
# if system == "Windows":
|
||||||
|
# if messageType != "dm":
|
||||||
widgetUtils.connect_event(self.message.text, widgetUtils.ENTERED_TEXT, self.text_processor)
|
widgetUtils.connect_event(self.message.text, widgetUtils.ENTERED_TEXT, self.text_processor)
|
||||||
self.text_processor()
|
self.text_processor()
|
||||||
widgetUtils.connect_event(self.message.shortenButton, widgetUtils.BUTTON_PRESSED, self.shorten)
|
widgetUtils.connect_event(self.message.shortenButton, widgetUtils.BUTTON_PRESSED, self.shorten)
|
||||||
@@ -97,6 +98,7 @@ class basicTweet(object):
|
|||||||
checker = SpellChecker.spellchecker.spellChecker(text, "")
|
checker = SpellChecker.spellchecker.spellChecker(text, "")
|
||||||
if hasattr(checker, "fixed_text"):
|
if hasattr(checker, "fixed_text"):
|
||||||
self.message.set_text(checker.fixed_text)
|
self.message.set_text(checker.fixed_text)
|
||||||
|
self.message.text_focus()
|
||||||
|
|
||||||
def attach(self, *args, **kwargs):
|
def attach(self, *args, **kwargs):
|
||||||
def completed_callback():
|
def completed_callback():
|
||||||
@@ -109,13 +111,17 @@ class basicTweet(object):
|
|||||||
output.speak(_(u"Unable to upload the audio"))
|
output.speak(_(u"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()
|
||||||
|
|
||||||
class tweet(basicTweet):
|
class tweet(basicTweet):
|
||||||
def __init__(self, session, title, caption, text, messageType="tweet", max=140):
|
def __init__(self, session, title, caption, text, twishort_enabled, messageType="tweet", max=140):
|
||||||
super(tweet, self).__init__(session, title, caption, text, messageType, max)
|
super(tweet, self).__init__(session, title, caption, text, messageType, max)
|
||||||
self.image = None
|
self.image = None
|
||||||
widgetUtils.connect_event(self.message.upload_image, widgetUtils.BUTTON_PRESSED, self.upload_image)
|
widgetUtils.connect_event(self.message.upload_image, widgetUtils.BUTTON_PRESSED, self.upload_image)
|
||||||
widgetUtils.connect_event(self.message.autocompletionButton, widgetUtils.BUTTON_PRESSED, self.autocomplete_users)
|
widgetUtils.connect_event(self.message.autocompletionButton, widgetUtils.BUTTON_PRESSED, self.autocomplete_users)
|
||||||
|
if twishort_enabled == False:
|
||||||
|
try: self.message.long_tweet.SetValue(False)
|
||||||
|
except AttributeError: pass
|
||||||
|
|
||||||
def upload_image(self, *args, **kwargs):
|
def upload_image(self, *args, **kwargs):
|
||||||
if self.message.get("upload_image") == _(u"Discard image"):
|
if self.message.get("upload_image") == _(u"Discard image"):
|
||||||
@@ -127,14 +133,15 @@ class tweet(basicTweet):
|
|||||||
self.image = self.message.get_image()
|
self.image = self.message.get_image()
|
||||||
if self.image != None:
|
if self.image != None:
|
||||||
self.message.set("upload_image", _(u"Discard image"))
|
self.message.set("upload_image", _(u"Discard image"))
|
||||||
|
self.message.text_focus()
|
||||||
|
|
||||||
def autocomplete_users(self, *args, **kwargs):
|
def autocomplete_users(self, *args, **kwargs):
|
||||||
c = autocompletionUsers.completion.autocompletionUsers(self.message, self.session.session_id)
|
c = autocompletionUsers.completion.autocompletionUsers(self.message, self.session.session_id)
|
||||||
c.show_menu()
|
c.show_menu()
|
||||||
|
|
||||||
class reply(tweet):
|
class reply(tweet):
|
||||||
def __init__(self, session, title, caption, text, users=None):
|
def __init__(self, session, title, caption, text, twishort_enabled, users=None):
|
||||||
super(reply, self).__init__(session, title, caption, text, messageType="reply")
|
super(reply, self).__init__(session, title, caption, text, twishort_enabled, messageType="reply")
|
||||||
self.users = users
|
self.users = users
|
||||||
if self.users != None and len(self.users) > 1:
|
if self.users != None and len(self.users) > 1:
|
||||||
widgetUtils.connect_event(self.message.mentionAll, widgetUtils.BUTTON_PRESSED, self.mention_all)
|
widgetUtils.connect_event(self.message.mentionAll, widgetUtils.BUTTON_PRESSED, self.mention_all)
|
||||||
@@ -148,7 +155,7 @@ class reply(tweet):
|
|||||||
|
|
||||||
class dm(basicTweet):
|
class dm(basicTweet):
|
||||||
def __init__(self, session, title, caption, text):
|
def __init__(self, session, title, caption, text):
|
||||||
super(dm, self).__init__(session, title, caption, text, messageType="dm")
|
super(dm, self).__init__(session, title, caption, text, messageType="dm", max=10000)
|
||||||
widgetUtils.connect_event(self.message.autocompletionButton, widgetUtils.BUTTON_PRESSED, self.autocomplete_users)
|
widgetUtils.connect_event(self.message.autocompletionButton, widgetUtils.BUTTON_PRESSED, self.autocomplete_users)
|
||||||
|
|
||||||
def autocomplete_users(self, *args, **kwargs):
|
def autocomplete_users(self, *args, **kwargs):
|
||||||
|
@@ -34,7 +34,7 @@ class globalSettingsController(object):
|
|||||||
if ".keymap" not in i:
|
if ".keymap" not in i:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
res[config_utils.load_config(paths.app_path('keymaps/'+i))['info']['name']]=i
|
res[i[:-7]] =i
|
||||||
except:
|
except:
|
||||||
log.exception("Exception while loading keymap " + i)
|
log.exception("Exception while loading keymap " + i)
|
||||||
return res
|
return res
|
||||||
@@ -79,6 +79,8 @@ class globalSettingsController(object):
|
|||||||
self.needs_restart = True
|
self.needs_restart = True
|
||||||
if self.kmnames[self.dialog.general.km.GetSelection()] != config.app["app-settings"]["load_keymap"]:
|
if self.kmnames[self.dialog.general.km.GetSelection()] != config.app["app-settings"]["load_keymap"]:
|
||||||
config.app["app-settings"]["load_keymap"] =self.kmnames[self.dialog.general.km.GetSelection()]
|
config.app["app-settings"]["load_keymap"] =self.kmnames[self.dialog.general.km.GetSelection()]
|
||||||
|
kmFile = open(paths.config_path("keymap.keymap"), "w")
|
||||||
|
kmFile.close()
|
||||||
self.needs_restart = True
|
self.needs_restart = True
|
||||||
|
|
||||||
if config.app["app-settings"]["use_invisible_keyboard_shorcuts"] != self.dialog.get_value("general", "use_invisible_shorcuts"):
|
if config.app["app-settings"]["use_invisible_keyboard_shorcuts"] != self.dialog.get_value("general", "use_invisible_shorcuts"):
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from wxUI.dialogs import userActions
|
|
||||||
from pubsub import pub
|
|
||||||
import re
|
import re
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
import output
|
import output
|
||||||
|
from wxUI.dialogs import userActions
|
||||||
|
from pubsub import pub
|
||||||
from twython import TwythonError
|
from twython import TwythonError
|
||||||
|
from extra import autocompletionUsers
|
||||||
|
|
||||||
class userActionsController(object):
|
class userActionsController(object):
|
||||||
def __init__(self, buffer, users=[], default="follow"):
|
def __init__(self, buffer, users=[], default="follow"):
|
||||||
@@ -12,9 +13,14 @@ class userActionsController(object):
|
|||||||
self.buffer = buffer
|
self.buffer = buffer
|
||||||
self.session = buffer.session
|
self.session = buffer.session
|
||||||
self.dialog = userActions.UserActionsDialog(users, default)
|
self.dialog = userActions.UserActionsDialog(users, default)
|
||||||
|
widgetUtils.connect_event(self.dialog.autocompletion, widgetUtils.BUTTON_PRESSED, self.autocomplete_users)
|
||||||
if self.dialog.get_response() == widgetUtils.OK:
|
if self.dialog.get_response() == widgetUtils.OK:
|
||||||
self.process_action()
|
self.process_action()
|
||||||
|
|
||||||
|
def autocomplete_users(self, *args, **kwargs):
|
||||||
|
c = autocompletionUsers.completion.autocompletionUsers(self.dialog, self.session.session_id)
|
||||||
|
c.show_menu("dm")
|
||||||
|
|
||||||
def process_action(self):
|
def process_action(self):
|
||||||
action = self.dialog.get_action()
|
action = self.dialog.get_action()
|
||||||
user = self.dialog.get_user()
|
user = self.dialog.get_user()
|
||||||
|
@@ -74,10 +74,10 @@ class audioUploader(object):
|
|||||||
def on_pause(self, *args, **kwargs):
|
def on_pause(self, *args, **kwargs):
|
||||||
if self.dialog.get("pause") == _(u"Pause"):
|
if self.dialog.get("pause") == _(u"Pause"):
|
||||||
self.recording.pause()
|
self.recording.pause()
|
||||||
self.dialog.set("pause", _(u"Resume"))
|
self.dialog.set("pause", _(u"&Resume"))
|
||||||
elif self.dialog.get("pause") == _(u"Resume"):
|
elif self.dialog.get("pause") == _(u"Resume"):
|
||||||
self.recording.play()
|
self.recording.play()
|
||||||
self.dialog.set("pause", _(U"Pause"))
|
self.dialog.set("pause", _(U"&Pause"))
|
||||||
|
|
||||||
def on_record(self, *args, **kwargs):
|
def on_record(self, *args, **kwargs):
|
||||||
if self.recording != None:
|
if self.recording != None:
|
||||||
@@ -92,7 +92,7 @@ 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", _(u"&Stop"))
|
||||||
output.speak(_(u"Recording"))
|
output.speak(_(u"Recording"))
|
||||||
|
|
||||||
def stop_recording(self):
|
def stop_recording(self):
|
||||||
@@ -100,11 +100,11 @@ class audioUploader(object):
|
|||||||
self.recording.free()
|
self.recording.free()
|
||||||
output.speak(_(u"Stopped"))
|
output.speak(_(u"Stopped"))
|
||||||
self.recorded = True
|
self.recorded = True
|
||||||
self.dialog.set("record", _(u"Record"))
|
self.dialog.set("record", _(u"&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", _(u"&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")
|
||||||
@@ -137,11 +137,11 @@ class audioUploader(object):
|
|||||||
# try:
|
# try:
|
||||||
self.playing = sound_lib.stream.FileStream(file=unicode(self.file), flags=sound_lib.stream.BASS_UNICODE)
|
self.playing = sound_lib.stream.FileStream(file=unicode(self.file), flags=sound_lib.stream.BASS_UNICODE)
|
||||||
self.playing.play()
|
self.playing.play()
|
||||||
self.dialog.set("play", _(u"Stop"))
|
self.dialog.set("play", _(u"&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", _(u"&Play"))
|
||||||
self.playing.free()
|
self.playing.free()
|
||||||
self.playing = None
|
self.playing = None
|
||||||
except:
|
except:
|
||||||
@@ -151,7 +151,7 @@ class audioUploader(object):
|
|||||||
output.speak(_(u"Stopped"))
|
output.speak(_(u"Stopped"))
|
||||||
self.playing.stop()
|
self.playing.stop()
|
||||||
self.playing.free()
|
self.playing.free()
|
||||||
self.dialog.set("play", _(u"Play"))
|
self.dialog.set("play", _(u"&Play"))
|
||||||
self.playing = None
|
self.playing = None
|
||||||
|
|
||||||
def postprocess(self):
|
def postprocess(self):
|
||||||
|
@@ -31,14 +31,14 @@ class audioDialog(widgetUtils.BaseDialog):
|
|||||||
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, _(u"&Play"))
|
||||||
self.play.Disable()
|
self.play.Disable()
|
||||||
self.pause = wx.Button(panel, -1, _(u"Pause"))
|
self.pause = wx.Button(panel, -1, _(u"&Pause"))
|
||||||
self.pause.Disable()
|
self.pause.Disable()
|
||||||
self.record = wx.Button(panel, -1, _(u"Record"))
|
self.record = wx.Button(panel, -1, _(u"&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, _(u"&Add an existing file"))
|
||||||
self.discard = wx.Button(panel, -1, _(u"Discard"))
|
self.discard = wx.Button(panel, -1, _(u"&Discard"))
|
||||||
self.discard.Disable()
|
self.discard.Disable()
|
||||||
label = wx.StaticText(panel, -1, _(u"Upload to"))
|
label = wx.StaticText(panel, -1, _(u"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)
|
||||||
@@ -47,7 +47,7 @@ class audioDialog(widgetUtils.BaseDialog):
|
|||||||
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, _(u"Attach"))
|
||||||
self.attach.Disable()
|
self.attach.Disable()
|
||||||
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Cancel"))
|
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"&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)
|
||||||
|
@@ -11,9 +11,17 @@ def fix():
|
|||||||
locales.BasqueLocale = BasqueLocale
|
locales.BasqueLocale = BasqueLocale
|
||||||
locales.TurkishLocale.names[-1] = "tr_tr"
|
locales.TurkishLocale.names[-1] = "tr_tr"
|
||||||
locales.ArabicLocale.names[-1] = "ar_eg"
|
locales.ArabicLocale.names[-1] = "ar_eg"
|
||||||
|
# insert a modified function so if there is no language available in arrow, returns English locale.
|
||||||
|
locales.get_locale = get_locale
|
||||||
# We need to reassign the locales list for updating the list with our new contents.
|
# We need to reassign the locales list for updating the list with our new contents.
|
||||||
locales._locales = locales._map_locales()
|
locales._locales = locales._map_locales()
|
||||||
|
|
||||||
|
def get_locale(name):
|
||||||
|
locale_cls = locales._locales.get(name.lower())
|
||||||
|
if locale_cls is None:
|
||||||
|
return locales.EnglishLocale()
|
||||||
|
return locale_cls()
|
||||||
|
|
||||||
class CatalaLocale(Locale):
|
class CatalaLocale(Locale):
|
||||||
names = ['ca', 'ca_ca']
|
names = ['ca', 'ca_ca']
|
||||||
past = 'Fa {0}'
|
past = 'Fa {0}'
|
||||||
@@ -67,11 +75,13 @@ class GalicianLocale(Locale):
|
|||||||
class BasqueLocale(Locale):
|
class BasqueLocale(Locale):
|
||||||
names = ['eu', 'eu_eu']
|
names = ['eu', 'eu_eu']
|
||||||
past = 'duela {0}'
|
past = 'duela {0}'
|
||||||
future = '{0}' # I don't know what's the right phrase in Basque for the future.
|
future = '{0} igarota'
|
||||||
|
|
||||||
timeframes = {
|
timeframes = {
|
||||||
'now': 'Orain',
|
'now': 'Orain',
|
||||||
'seconds': 'segundu',
|
# 'second': 'segundu bat',
|
||||||
|
'seconds': 'segundu batzuk', # without specifying a number.
|
||||||
|
#'seconds': '{0} segundu', # specifying a number
|
||||||
'minute': 'minutu bat',
|
'minute': 'minutu bat',
|
||||||
'minutes': '{0} minutu',
|
'minutes': '{0} minutu',
|
||||||
'hour': 'ordu bat',
|
'hour': 'ordu bat',
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import win32com.client
|
import win32com.client
|
||||||
|
|
||||||
|
|
||||||
def fix():
|
def fix():
|
||||||
if win32com.client.gencache.is_readonly == True:
|
if win32com.client.gencache.is_readonly == True:
|
||||||
win32com.client.gencache.is_readonly = False
|
win32com.client.gencache.is_readonly = False
|
||||||
|
30
src/keymaps/Chicken Nugget.keymap
Normal file
30
src/keymaps/Chicken Nugget.keymap
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
[info]
|
||||||
|
name = string(default="Chicken Nugget")
|
||||||
|
desc = string(default="Remaps TWBlue shortcuts to their equivalents in Christopher Toth's Chicken Nugget Twitter client.")
|
||||||
|
author = string(default="Bill Dengler <codeofdusk@gmail.com>")
|
||||||
|
|
||||||
|
[keymap]
|
||||||
|
up = string(default="control+win+up")
|
||||||
|
down = string(default="control+win+down")
|
||||||
|
left = string(default="control+win+left")
|
||||||
|
right = string(default="control+win+right")
|
||||||
|
open_conversation = string(default="control+win+c")
|
||||||
|
show_hide = string(default="control+win+w")
|
||||||
|
post_tweet = string(default="control+win+t")
|
||||||
|
post_reply = string(default="control+win+r")
|
||||||
|
post_retweet = string(default="control+win+shift+t")
|
||||||
|
send_dm = string(default="control+win+d")
|
||||||
|
user_details = string(default="control+win+shift+u")
|
||||||
|
exit = string(default="control+win+q")
|
||||||
|
open_timeline = string(default="control+win+u")
|
||||||
|
remove_buffer = string(default="control+win+backspace")
|
||||||
|
audio = string(default="control+win+return")
|
||||||
|
url = string(default="control+win+b")
|
||||||
|
go_home = string(default="control+win+home")
|
||||||
|
go_end = string(default="control+win+end")
|
||||||
|
delete = string(default="control+win+delete")
|
||||||
|
clear_buffer = string(default="control+win+shift+delete")
|
||||||
|
repeat_item = string(default="control+win+space")
|
||||||
|
copy_to_clipboard = string(default="control+win+shift+c")
|
||||||
|
search = string(default="control+win+/")
|
||||||
|
find = string(default="control+win+shift+/")
|
@@ -1,30 +0,0 @@
|
|||||||
[info]
|
|
||||||
name = Chicken Nugget
|
|
||||||
desc = Remaps TWBlue shortcuts to their equivalents in Christopher Toth's Chicken Nugget Twitter client.
|
|
||||||
author = Bill Dengler <codeofdusk@gmail.com>
|
|
||||||
|
|
||||||
[keymap]
|
|
||||||
up = control+win+up
|
|
||||||
down = control+win+down
|
|
||||||
left = control+win+left
|
|
||||||
right = control+win+right
|
|
||||||
open_conversation = control+win+c
|
|
||||||
show_hide = control+win+w
|
|
||||||
post_tweet = control+win+t
|
|
||||||
post_reply = control+win+r
|
|
||||||
post_retweet = control+win+shift+t
|
|
||||||
send_dm = control+win+d
|
|
||||||
user_details = control+win+shift+u
|
|
||||||
exit = control+win+q
|
|
||||||
open_timeline = control+win+u
|
|
||||||
remove_buffer = control+win+backspace
|
|
||||||
audio = control+win+return
|
|
||||||
secondary_interact = control+win+b
|
|
||||||
go_home = control+win+home
|
|
||||||
go_end = control+win+end
|
|
||||||
delete = control+win+delete
|
|
||||||
clear_buffer = control+win+shift+delete
|
|
||||||
repeat_item = control+win+space
|
|
||||||
copy_to_clipboard = control+win+shift+c
|
|
||||||
search = control+win+/
|
|
||||||
find = control+win+shift+/
|
|
@@ -1,48 +1,49 @@
|
|||||||
[info]
|
[info]
|
||||||
name = Qwitter
|
name = string(default="Qwitter")
|
||||||
desc = A keymap which emulates Qwitter as closely as possible.
|
desc = string(default="A keymap which emulates Qwitter as closely as possible.")
|
||||||
author = Bill Dengler <codeofdusk@gmail.com>
|
author = string(default="Bill Dengler <codeofdusk@gmail.com>")
|
||||||
|
|
||||||
[keymap]
|
[keymap]
|
||||||
up = control+win+up
|
up = string(default="control+win+up")
|
||||||
down = control+win+down
|
down = string(default="control+win+down")
|
||||||
left = control+win+left
|
left = string(default="control+win+left")
|
||||||
right = control+win+right
|
right = string(default="control+win+right")
|
||||||
next_account = control+win+shift+right
|
next_account = string(default="control+win+shift+right")
|
||||||
previous_account = control+win+shift+left
|
previous_account = string(default="control+win+shift+left")
|
||||||
show_hide = control+win+w
|
show_hide = string(default="control+win+w")
|
||||||
post_tweet = control+win+n
|
post_tweet = string(default="control+win+n")
|
||||||
post_reply = control+win+r
|
post_reply = string(default="control+win+r")
|
||||||
post_retweet = control+win+shift+r
|
post_retweet = string(default="control+win+shift+r")
|
||||||
send_dm = control+win+d
|
send_dm = string(default="control+win+d")
|
||||||
add_to_favourites = alt+win+f
|
add_to_favourites = string(default="alt+win+f")
|
||||||
remove_from_favourites = alt+shift+win+f
|
remove_from_favourites = string(default="alt+shift+win+f")
|
||||||
follow = control+win+l
|
follow = string(default="control+win+l")
|
||||||
user_details = control+win+shift+;
|
user_details = string(default="control+win+shift+;")
|
||||||
view_item = control+win+v
|
view_item = string(default="control+win+v")
|
||||||
exit = control+win+f4
|
exit = string(default="control+win+f4")
|
||||||
open_timeline = control+win+i
|
open_timeline = string(default="control+win+i")
|
||||||
remove_buffer = "control+win+'"
|
remove_buffer = '''string(default="control+win+'")'''
|
||||||
audio = control+win+return
|
url = string(default="control+win+return")
|
||||||
volume_up = control+win+alt+up
|
audio = string(default="control+win+shift+return")
|
||||||
volume_down = control+win+alt+down
|
volume_up = string(default="control+win+alt+up")
|
||||||
go_home = control+win+home
|
volume_down = string(default="control+win+alt+down")
|
||||||
go_end = control+win+end
|
go_home = string(default="control+win+home")
|
||||||
go_page_up = control+win+pageup
|
go_end = string(default="control+win+end")
|
||||||
go_page_down = control+win+pagedown
|
go_page_up = string(default="control+win+pageup")
|
||||||
update_profile = control+win+shift+p
|
go_page_down = string(default="control+win+pagedown")
|
||||||
delete = control+win+delete
|
update_profile = string(default="control+win+shift+p")
|
||||||
clear_buffer = control+win+shift+delete
|
delete = string(default="control+win+delete")
|
||||||
repeat_item = control+win+space
|
clear_buffer = string(default="control+win+shift+delete")
|
||||||
copy_to_clipboard = control+win+shift+c
|
repeat_item = string(default="control+win+space")
|
||||||
add_to_list = control+win+alt+l
|
copy_to_clipboard = string(default="control+win+shift+c")
|
||||||
remove_from_list = control+win+alt+shift+l
|
add_to_list = string(default="control+win+alt+l")
|
||||||
toggle_buffer_mute = control+win+alt+m
|
remove_from_list = string(default="control+win+alt+shift+l")
|
||||||
toggle_session_mute = control+win+m
|
toggle_buffer_mute = string(default="control+win+alt+m")
|
||||||
search = control+win+/
|
toggle_session_mute = string(default="control+win+m")
|
||||||
find = control+win+shift+/
|
search = string(default="control+win+/")
|
||||||
edit_keystrokes = control+win+k
|
find = string(default="control+win+shift+/")
|
||||||
view_user_lists = win+alt+shift+l
|
edit_keystrokes = string(default="control+win+k")
|
||||||
reverse_geocode = control+win+g
|
view_user_lists = string(default="win+alt+shift+l")
|
||||||
view_reverse_geocode = control+win+shift+g
|
reverse_geocode = string(default="control+win+g")
|
||||||
get_trending_topics = control+win+shift+t
|
view_reverse_geocode = string(default="control+win+shift+g")
|
||||||
|
get_trending_topics = string(default="control+win+shift+t")
|
||||||
|
@@ -1,52 +0,0 @@
|
|||||||
[info]
|
|
||||||
name = Windows 10 (experimental)
|
|
||||||
desc = A keymap with remapped modifiers for Windows 10 compatibility.
|
|
||||||
author = Bill Dengler <codeofdusk@gmail.com>
|
|
||||||
|
|
||||||
[keymap]
|
|
||||||
up = alt+win+up
|
|
||||||
down = alt+win+down
|
|
||||||
left = alt+win+left
|
|
||||||
right = alt+win+right
|
|
||||||
next_account = alt+win+shift+right
|
|
||||||
previous_account = alt+win+shift+left
|
|
||||||
open_conversation = alt+win+c
|
|
||||||
show_hide = alt+win+w
|
|
||||||
post_tweet = alt+win+n
|
|
||||||
post_reply = alt+win+r
|
|
||||||
post_retweet = alt+win+shift+r
|
|
||||||
send_dm = alt+win+d
|
|
||||||
add_to_favourites = alt+win+f
|
|
||||||
remove_from_favourites = alt+shift+win+f
|
|
||||||
follow = alt+win+s
|
|
||||||
user_details = alt+win+shift+n
|
|
||||||
view_item = alt+win+v
|
|
||||||
exit = alt+win+f4
|
|
||||||
open_timeline = alt+win+i
|
|
||||||
remove_buffer = alt+win+shift+i
|
|
||||||
audio = alt+win+return
|
|
||||||
secondary_interact = alt+shift+win+return
|
|
||||||
|
|
||||||
volume_up = alt+win+shift+up
|
|
||||||
go_home = alt+win+home
|
|
||||||
volume_down = alt+win+shift+down
|
|
||||||
go_end = alt+win+end
|
|
||||||
go_page_up = alt+win+pageup
|
|
||||||
go_page_down = alt+win+pagedown
|
|
||||||
update_profile = alt+win+p
|
|
||||||
delete = alt+win+delete
|
|
||||||
clear_buffer = alt+win+shift+delete
|
|
||||||
repeat_item = alt+win+space
|
|
||||||
copy_to_clipboard = alt+win+shift+c
|
|
||||||
add_to_list = alt+win+a
|
|
||||||
remove_from_list = alt+win+shift+a
|
|
||||||
toggle_buffer_mute = alt+win+shift+m
|
|
||||||
toggle_session_mute = alt+win+m
|
|
||||||
toggle_autoread = alt+win+e
|
|
||||||
search = alt+win+-
|
|
||||||
edit_keystrokes = alt+win+k
|
|
||||||
view_user_lists = alt+win+l
|
|
||||||
get_more_items = alt+win+pageup
|
|
||||||
reverse_geocode = alt+win+g
|
|
||||||
view_reverse_geocode = alt+win+shift+g
|
|
||||||
get_trending_topics = alt+win+t
|
|
51
src/keymaps/Windows 10.keymap
Normal file
51
src/keymaps/Windows 10.keymap
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
[info]
|
||||||
|
name = string(default="Windows 10")
|
||||||
|
desc = string(default="A keymap with remapped modifiers for Windows 10 compatibility.")
|
||||||
|
author = string(default="Bill Dengler <codeofdusk@gmail.com>")
|
||||||
|
|
||||||
|
[keymap]
|
||||||
|
up = string(default="alt+win+up")
|
||||||
|
down = string(default="alt+win+down")
|
||||||
|
left = string(default="alt+win+left")
|
||||||
|
right = string(default="alt+win+right")
|
||||||
|
next_account = string(default="alt+win+shift+right")
|
||||||
|
previous_account = string(default="alt+win+shift+left")
|
||||||
|
open_conversation = string(default="alt+win+c")
|
||||||
|
show_hide = string(default="alt+win+w")
|
||||||
|
post_tweet = string(default="alt+win+n")
|
||||||
|
post_reply = string(default="control+win+r")
|
||||||
|
post_retweet = string(default="alt+win+shift+r")
|
||||||
|
send_dm = string(default="alt+win+d")
|
||||||
|
add_to_favourites = string(default="alt+win+f")
|
||||||
|
remove_from_favourites = string(default="alt+shift+win+f")
|
||||||
|
follow = string(default="alt+win+s")
|
||||||
|
user_details = string(default="alt+win+shift+n")
|
||||||
|
view_item = string(default="alt+win+v")
|
||||||
|
exit = string(default="alt+win+f4")
|
||||||
|
open_timeline = string(default="alt+win+i")
|
||||||
|
remove_buffer = string(default="alt+win+shift+i")
|
||||||
|
url = string(default="alt+win+return")
|
||||||
|
audio = string(default="alt+shift+win+return")
|
||||||
|
volume_up = string(default="alt+win+shift+up")
|
||||||
|
go_home = string(default="alt+win+home")
|
||||||
|
volume_down = string(default="alt+win+shift+down")
|
||||||
|
go_end = string(default="alt+win+end")
|
||||||
|
go_page_up = string(default="alt+win+pageup")
|
||||||
|
go_page_down = string(default="alt+win+pagedown")
|
||||||
|
update_profile = string(default="alt+win+p")
|
||||||
|
delete = string(default="alt+win+delete")
|
||||||
|
clear_buffer = string(default="alt+win+shift+delete")
|
||||||
|
repeat_item = string(default="alt+win+space")
|
||||||
|
copy_to_clipboard = string(default="alt+win+shift+c")
|
||||||
|
add_to_list = string(default="alt+win+a")
|
||||||
|
remove_from_list = string(default="alt+win+shift+a")
|
||||||
|
toggle_buffer_mute = string(default="alt+win+shift+m")
|
||||||
|
toggle_session_mute = string(default="alt+win+m")
|
||||||
|
toggle_autoread = string(default="alt+win+e")
|
||||||
|
search = string(default="alt+win+-")
|
||||||
|
edit_keystrokes = string(default="alt+win+k")
|
||||||
|
view_user_lists = string(default="alt+win+l")
|
||||||
|
get_more_items = string(default="alt+win+pageup")
|
||||||
|
reverse_geocode = string(default="alt+win+g")
|
||||||
|
view_reverse_geocode = string(default="alt+win+shift+g")
|
||||||
|
get_trending_topics = string(default="alt+win+t")
|
@@ -1,54 +1,52 @@
|
|||||||
[info]
|
[info]
|
||||||
name = Default
|
name = string(default="Default")
|
||||||
desc = TWBlue's default keymap.
|
desc = string(default="TWBlue's default keymap.")
|
||||||
author = Bill Dengler <codeofdusk@gmail.com>
|
author = string(default="Bill Dengler <codeofdusk@gmail.com>")
|
||||||
|
|
||||||
[keymap]
|
[keymap]
|
||||||
up = control+win+up
|
up = string(default="control+win+up")
|
||||||
down = control+win+down
|
down = string(default="control+win+down")
|
||||||
left = control+win+left
|
left = string(default="control+win+left")
|
||||||
right = control+win+right
|
right = string(default="control+win+right")
|
||||||
next_account = control+win+shift+right
|
next_account = string(default="control+win+shift+right")
|
||||||
previous_account = control+win+shift+left
|
previous_account = string(default="control+win+shift+left")
|
||||||
open_conversation = control+win+c
|
open_conversation = string(default="control+win+c")
|
||||||
show_hide = control+win+m
|
show_hide = string(default="control+win+m")
|
||||||
post_tweet = control+win+n
|
post_tweet = string(default="control+win+n")
|
||||||
post_reply = control+win+r
|
post_reply = string(default="control+win+r")
|
||||||
post_retweet = control+win+shift+r
|
post_retweet = string(default="control+win+shift+r")
|
||||||
send_dm = control+win+d
|
send_dm = string(default="control+win+d")
|
||||||
add_to_favourites = alt+win+f
|
add_to_favourites = string(default="alt+win+f")
|
||||||
remove_from_favourites = alt+shift+win+f
|
remove_from_favourites = string(default="alt+shift+win+f")
|
||||||
follow = control+win+s
|
follow = string(default="control+win+s")
|
||||||
user_details = control+win+alt+n
|
user_details = string(default="control+win+alt+n")
|
||||||
view_item = control+win+v
|
view_item = string(default="control+win+v")
|
||||||
exit = control+win+f4
|
exit = string(default="control+win+f4")
|
||||||
open_timeline = control+win+i
|
open_timeline = string(default="control+win+i")
|
||||||
remove_buffer = control+win+shift+i
|
remove_buffer = string(default="control+win+shift+i")
|
||||||
audio = control+alt+win+return
|
audio = string(default="control+alt+win+return")
|
||||||
url = control+win+return
|
url = string(default="control+win+return")
|
||||||
volume_up = control+win+alt+up
|
volume_up = string(default="control+win+alt+up")
|
||||||
volume_down = control+win+alt+down
|
volume_down = string(default="control+win+alt+down")
|
||||||
go_home = control+win+home
|
go_home = string(default="control+win+home")
|
||||||
go_end = control+win+end
|
go_end = string(default="control+win+end")
|
||||||
go_page_up = control+win+pageup
|
go_page_up = string(default="control+win+pageup")
|
||||||
go_page_down = control+win+pagedown
|
go_page_down = string(default="control+win+pagedown")
|
||||||
update_profile = alt+win+p
|
update_profile = string(default="alt+win+p")
|
||||||
delete = control+win+delete
|
delete = string(default="control+win+delete")
|
||||||
clear_buffer = control+win+shift+delete
|
clear_buffer = string(default="control+win+shift+delete")
|
||||||
repeat_item = control+win+space
|
repeat_item = string(default="control+win+space")
|
||||||
copy_to_clipboard = control+win+c
|
copy_to_clipboard = string(default="control+win+shift+c")
|
||||||
add_to_list = control+win+a
|
add_to_list = string(default="control+win+a")
|
||||||
remove_from_list = control+win+shift+a
|
remove_from_list = string(default="control+win+shift+a")
|
||||||
toggle_buffer_mute = control+win+shift+m
|
toggle_buffer_mute = string(default="control+win+shift+m")
|
||||||
toggle_session_mute = alt+win+m
|
toggle_session_mute = string(default="alt+win+m")
|
||||||
toggle_autoread = control+win+e
|
toggle_autoread = string(default="control+win+e")
|
||||||
search = control+win+-
|
search = string(default="control+win+-")
|
||||||
edit_keystrokes = control+win+k
|
edit_keystrokes = string(default="control+win+k")
|
||||||
view_user_lists = control+win+l
|
view_user_lists = string(default="control+win+l")
|
||||||
get_more_items = alt+win+pageup
|
get_more_items = string(default="alt+win+pageup")
|
||||||
reverse_geocode = control+win+g
|
reverse_geocode = string(default="control+win+g")
|
||||||
view_reverse_geocode = control+win+shift+g
|
view_reverse_geocode = string(default="control+win+shift+g")
|
||||||
get_trending_topics = control+win+t
|
get_trending_topics = string(default="control+win+t")
|
||||||
find = control+win+{
|
find = string(default="control+win+{")
|
||||||
secondary_interact = control+win+alt+return
|
|
||||||
interact = control+win+return
|
|
||||||
|
@@ -3,6 +3,7 @@ import widgetUtils
|
|||||||
import config
|
import config
|
||||||
import wx_ui
|
import wx_ui
|
||||||
import constants
|
import constants
|
||||||
|
from pubsub import pub
|
||||||
|
|
||||||
class KeystrokeEditor(object):
|
class KeystrokeEditor(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -14,6 +15,7 @@ class KeystrokeEditor(object):
|
|||||||
self.hold_map = self.map.copy()
|
self.hold_map = self.map.copy()
|
||||||
self.dialog.put_keystrokes(constants.actions, self.map)
|
self.dialog.put_keystrokes(constants.actions, self.map)
|
||||||
widgetUtils.connect_event(self.dialog.edit, widgetUtils.BUTTON_PRESSED, self.edit_keystroke)
|
widgetUtils.connect_event(self.dialog.edit, widgetUtils.BUTTON_PRESSED, self.edit_keystroke)
|
||||||
|
widgetUtils.connect_event(self.dialog.execute, widgetUtils.BUTTON_PRESSED, self.execute_action)
|
||||||
self.dialog.get_response()
|
self.dialog.get_response()
|
||||||
|
|
||||||
def edit_keystroke(self, *args, **kwargs):
|
def edit_keystroke(self, *args, **kwargs):
|
||||||
@@ -52,3 +54,7 @@ class KeystrokeEditor(object):
|
|||||||
wx_ui.no_key()
|
wx_ui.no_key()
|
||||||
return
|
return
|
||||||
return "+".join(keys)
|
return "+".join(keys)
|
||||||
|
|
||||||
|
def execute_action(self, *args, **kwargs):
|
||||||
|
action = self.dialog.actions[self.dialog.get_action()]
|
||||||
|
pub.sendMessage("execute-action", action=action)
|
@@ -13,18 +13,20 @@ class keystrokeEditorDialog(baseDialog.BaseWXDialog):
|
|||||||
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, _(u"Action"), _(u"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)
|
firstSizer.Add(keysText, 0, wx.ALL, 5)
|
||||||
firstSizer.Add(self.keys.list)
|
firstSizer.Add(self.keys.list, 0, wx.ALL, 5)
|
||||||
self.edit = wx.Button(panel, -1, _(u"Edit"))
|
self.edit = wx.Button(panel, -1, _(u"Edit"))
|
||||||
self.edit.SetDefault()
|
self.edit.SetDefault()
|
||||||
|
self.execute = wx.Button(panel, -1, _(u"Execute action"))
|
||||||
close = wx.Button(panel, wx.ID_CANCEL, _(u"Close"))
|
close = wx.Button(panel, wx.ID_CANCEL, _(u"Close"))
|
||||||
secondSizer = wx.BoxSizer(wx.HORIZONTAL)
|
secondSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
secondSizer.Add(self.edit)
|
secondSizer.Add(self.edit, 0, wx.ALL, 5)
|
||||||
secondSizer.Add(close)
|
secondSizer.Add(self.execute, 0, wx.ALL, 5)
|
||||||
sizer.Add(firstSizer)
|
secondSizer.Add(close, 0, wx.ALL, 5)
|
||||||
sizer.Add(secondSizer)
|
sizer.Add(firstSizer, 0, wx.ALL, 5)
|
||||||
panel.SetSizerAndFit(sizer)
|
sizer.Add(secondSizer, 0, wx.ALL, 5)
|
||||||
|
panel.SetSizer(sizer)
|
||||||
|
self.SetClientSize(sizer.CalcMin())
|
||||||
|
|
||||||
def put_keystrokes(self, actions, keystrokes):
|
def put_keystrokes(self, actions, keystrokes):
|
||||||
for i in keystrokes:
|
for i in keystrokes:
|
||||||
|
@@ -69,6 +69,7 @@ def getLanguageDescription(language):
|
|||||||
"ar":pgettext("languageName","Arabic"),
|
"ar":pgettext("languageName","Arabic"),
|
||||||
"ne":pgettext("languageName","Nepali"),
|
"ne":pgettext("languageName","Nepali"),
|
||||||
"sr":pgettext("languageName","Serbian (Latin)"),
|
"sr":pgettext("languageName","Serbian (Latin)"),
|
||||||
|
"ja":pgettext("languageName","Japanese"),
|
||||||
}.get(language,None)
|
}.get(language,None)
|
||||||
return desc
|
return desc
|
||||||
|
|
||||||
@@ -195,10 +196,13 @@ def langToWindowsLocale(lang):
|
|||||||
"gl": "glc",
|
"gl": "glc",
|
||||||
"eu": "euq",
|
"eu": "euq",
|
||||||
"hu": "hun",
|
"hu": "hun",
|
||||||
|
"hr": "hrv",
|
||||||
"it": "ita",
|
"it": "ita",
|
||||||
|
"ja": "jpn",
|
||||||
"pl": "plk",
|
"pl": "plk",
|
||||||
"pt": "ptb",
|
"pt": "ptb",
|
||||||
"ru": "rus",
|
"ru": "rus",
|
||||||
"tr": "trk"
|
"tr": "trk",
|
||||||
|
"sr": "eng",
|
||||||
}
|
}
|
||||||
return languages[lang]
|
return languages[lang]
|
||||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
src/locales/RS/LC_MESSAGES/twblue.mo
Normal file
BIN
src/locales/RS/LC_MESSAGES/twblue.mo
Normal file
Binary file not shown.
2823
src/locales/RS/LC_MESSAGES/twblue.po
Normal file
2823
src/locales/RS/LC_MESSAGES/twblue.po
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
src/locales/ja/lc_messages/twblue.mo
Normal file
BIN
src/locales/ja/lc_messages/twblue.mo
Normal file
Binary file not shown.
2828
src/locales/ja/lc_messages/twblue.po
Normal file
2828
src/locales/ja/lc_messages/twblue.po
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
src/locales/sr/LC_MESSAGES/twblue.mo
Normal file
BIN
src/locales/sr/LC_MESSAGES/twblue.mo
Normal file
Binary file not shown.
2821
src/locales/sr/LC_MESSAGES/twblue.po
Normal file
2821
src/locales/sr/LC_MESSAGES/twblue.po
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -16,6 +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 twitter import utils
|
||||||
|
|
||||||
def get_id(url):
|
def get_id(url):
|
||||||
return url.split("/")[-1]
|
return url.split("/")[-1]
|
||||||
@@ -26,3 +27,9 @@ def is_long(tweet):
|
|||||||
if "twitter.com" in tweet["entities"]["urls"][url]["expanded_url"]:
|
if "twitter.com" in tweet["entities"]["urls"][url]["expanded_url"]:
|
||||||
long = get_id(tweet["entities"]["urls"][url]["expanded_url"])
|
long = get_id(tweet["entities"]["urls"][url]["expanded_url"])
|
||||||
return long
|
return long
|
||||||
|
|
||||||
|
def clear_url(tweet):
|
||||||
|
urls = utils.find_urls_in_text(tweet["text"])
|
||||||
|
try: tweet["message"] = tweet["message"].replace(urls[-1], "")
|
||||||
|
except IndexError: pass
|
||||||
|
return tweet
|
10
src/main.py
10
src/main.py
@@ -25,6 +25,8 @@ from mysc.thread_utils import call_threaded
|
|||||||
import fixes
|
import fixes
|
||||||
#extra variables to control the temporal stdout and stderr, while the final files are opened. We understand that some errors could happen while all outputs are closed, so let's try to avoid it.
|
#extra variables to control the temporal stdout and stderr, while the final files are opened. We understand that some errors could happen while all outputs are closed, so let's try to avoid it.
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
|
import webbrowser
|
||||||
|
from wxUI import commonMessageDialogs
|
||||||
if system == "Windows":
|
if system == "Windows":
|
||||||
from logger import logger
|
from logger import logger
|
||||||
from update import updater
|
from update import updater
|
||||||
@@ -63,6 +65,8 @@ def setup():
|
|||||||
from sessionmanager import sessionManager
|
from sessionmanager import sessionManager
|
||||||
app = widgetUtils.mainLoopObject()
|
app = widgetUtils.mainLoopObject()
|
||||||
if system == "Windows":
|
if system == "Windows":
|
||||||
|
if config.app["app-settings"]["donation_dialog_displayed"] == False:
|
||||||
|
donation()
|
||||||
updater.do_update()
|
updater.do_update()
|
||||||
sm = sessionManager.sessionManagerController()
|
sm = sessionManager.sessionManagerController()
|
||||||
sm.fill_list()
|
sm.fill_list()
|
||||||
@@ -82,4 +86,10 @@ def setup():
|
|||||||
GLib.idle_add(r.start)
|
GLib.idle_add(r.start)
|
||||||
app.run()
|
app.run()
|
||||||
|
|
||||||
|
def donation():
|
||||||
|
dlg = commonMessageDialogs.donation()
|
||||||
|
if dlg == widgetUtils.YES:
|
||||||
|
webbrowser.open_new_tab("http://twblue.es/?q=donate")
|
||||||
|
config.app["app-settings"]["donation_dialog_displayed"] = True
|
||||||
|
|
||||||
setup()
|
setup()
|
||||||
|
@@ -27,7 +27,9 @@ def stream_threaded(func, *args, **kwargs):
|
|||||||
try:
|
try:
|
||||||
func(**k)
|
func(**k)
|
||||||
except:
|
except:
|
||||||
pub.sendMessage("streamError", session=a[0])
|
log.error("Error in stream with args: %r" % (a,))
|
||||||
|
pub.sendMessage("stream-error", session=a[0])
|
||||||
|
|
||||||
thread = threading.Thread(target=new_func, args=args, kwargs=kwargs)
|
thread = threading.Thread(target=new_func, args=args, kwargs=kwargs)
|
||||||
thread.daemon = True
|
thread.daemon = True
|
||||||
thread.start()
|
thread.start()
|
||||||
|
@@ -24,7 +24,7 @@ def setup ():
|
|||||||
except:
|
except:
|
||||||
return logging.exception("Output: Error during initialization.")
|
return logging.exception("Output: Error during initialization.")
|
||||||
|
|
||||||
def Copy(text):
|
def copy(text):
|
||||||
import win32clipboard
|
import win32clipboard
|
||||||
#Copies text to the clipboard.
|
#Copies text to the clipboard.
|
||||||
win32clipboard.OpenClipboard()
|
win32clipboard.OpenClipboard()
|
||||||
|
@@ -9,7 +9,7 @@ import output
|
|||||||
import time
|
import time
|
||||||
import sound
|
import sound
|
||||||
import logging
|
import logging
|
||||||
from twitter import utils
|
from twitter import utils, compose
|
||||||
from twython import TwythonError, TwythonRateLimitError, TwythonAuthError
|
from twython import TwythonError, TwythonRateLimitError, TwythonAuthError
|
||||||
import config_utils
|
import config_utils
|
||||||
import shelve
|
import shelve
|
||||||
@@ -18,6 +18,7 @@ import os
|
|||||||
from mysc.thread_utils import stream_threaded
|
from mysc.thread_utils import stream_threaded
|
||||||
from pubsub import pub
|
from pubsub import pub
|
||||||
log = logging.getLogger("sessionmanager.session")
|
log = logging.getLogger("sessionmanager.session")
|
||||||
|
from long_tweets import tweets
|
||||||
|
|
||||||
sessions = {}
|
sessions = {}
|
||||||
|
|
||||||
@@ -60,7 +61,9 @@ class Session(object):
|
|||||||
if self.db.has_key(name) == False:
|
if self.db.has_key(name) == False:
|
||||||
self.db[name] = []
|
self.db[name] = []
|
||||||
for i in data:
|
for i in data:
|
||||||
if utils.find_item(i["id"], self.db[name]) == None:
|
if utils.find_item(i["id"], self.db[name]) == None and utils.is_allowed(i, self.settings["twitter"]["ignored_clients"]) == True:
|
||||||
|
try: i = self.check_quoted_status(i)
|
||||||
|
except: pass
|
||||||
if self.settings["general"]["reverse_timelines"] == False: self.db[name].append(i)
|
if self.settings["general"]["reverse_timelines"] == False: self.db[name].append(i)
|
||||||
else: self.db[name].insert(0, i)
|
else: self.db[name].insert(0, i)
|
||||||
num = num+1
|
num = num+1
|
||||||
@@ -119,7 +122,8 @@ class Session(object):
|
|||||||
# self.settings = None
|
# self.settings = None
|
||||||
|
|
||||||
def init_sound(self):
|
def init_sound(self):
|
||||||
self.sound = sound.soundSystem(self.settings["sound"])
|
try: self.sound = sound.soundSystem(self.settings["sound"])
|
||||||
|
except: pass
|
||||||
|
|
||||||
@_require_configuration
|
@_require_configuration
|
||||||
def login(self, verify_credentials=True):
|
def login(self, verify_credentials=True):
|
||||||
@@ -344,6 +348,7 @@ class Session(object):
|
|||||||
self.logged = False
|
self.logged = False
|
||||||
self.twitter = twitter.twitter.twitter()
|
self.twitter = twitter.twitter.twitter()
|
||||||
self.login(False)
|
self.login(False)
|
||||||
|
pub.sendMessage("streamError", session=self.session_id)
|
||||||
if self.reconnection_function_active == True: return
|
if self.reconnection_function_active == True: return
|
||||||
self.reconnection_function_active = True
|
self.reconnection_function_active = True
|
||||||
if not hasattr(self, "main_stream"):
|
if not hasattr(self, "main_stream"):
|
||||||
@@ -381,10 +386,11 @@ class Session(object):
|
|||||||
if type(key) != str and type(key) != unicode:
|
if type(key) != str and type(key) != unicode:
|
||||||
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.
|
||||||
if type(value) == list and self.settings["general"]["persist_size"] != -1 and len(value) > self.settings["general"]["persist_size"]:
|
if type(value) == list and self.settings["general"]["persist_size"] != -1 and len(value) > self.settings["general"]["persist_size"]:
|
||||||
shelf[str(key)]=value[self.settings["general"]["persist_size"]:]
|
shelf[str(key.encode("utf-8"))]=value[self.settings["general"]["persist_size"]:]
|
||||||
else:
|
else:
|
||||||
shelf[str(key)]=value
|
shelf[str(key.encode("utf-8"))]=value
|
||||||
shelf.close()
|
shelf.close()
|
||||||
except:
|
except:
|
||||||
output.speak("An exception occurred while shelving the " + application.name + " database. It will be deleted and rebuilt automatically. If this error persists, send the error log to the " + application.name + " developers.",True)
|
output.speak("An exception occurred while shelving the " + application.name + " database. It will be deleted and rebuilt automatically. If this error persists, send the error log to the " + application.name + " developers.",True)
|
||||||
@@ -401,7 +407,7 @@ class Session(object):
|
|||||||
try:
|
try:
|
||||||
shelf=shelve.open(paths.config_path(shelfname),'c')
|
shelf=shelve.open(paths.config_path(shelfname),'c')
|
||||||
for key,value in shelf.items():
|
for key,value in shelf.items():
|
||||||
self.db[unicode(key)]=value
|
self.db[key]=value
|
||||||
shelf.close()
|
shelf.close()
|
||||||
except:
|
except:
|
||||||
output.speak("An exception occurred while deshelving the " + application.name + " database. It will be deleted and rebuilt automatically. If this error persists, send the error log to the " + application.name + " developers.",True)
|
output.speak("An exception occurred while deshelving the " + application.name + " database. It will be deleted and rebuilt automatically. If this error persists, send the error log to the " + application.name + " developers.",True)
|
||||||
@@ -410,3 +416,28 @@ class Session(object):
|
|||||||
os.remove(shelfname)
|
os.remove(shelfname)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def check_quoted_status(self, tweet):
|
||||||
|
status = tweets.is_long(tweet)
|
||||||
|
if status != False:
|
||||||
|
tweet["quoted"] = 1
|
||||||
|
tweet = self.get_quoted_tweet(tweet)
|
||||||
|
return tweet
|
||||||
|
|
||||||
|
|
||||||
|
def get_quoted_tweet(self, tweet):
|
||||||
|
quoted_tweet = self.twitter.twitter.show_status(id=tweet["id"])
|
||||||
|
urls = utils.find_urls_in_text(quoted_tweet["text"])
|
||||||
|
for url in range(0, len(urls)):
|
||||||
|
try: quoted_tweet["text"] = quoted_tweet["text"].replace(urls[url], quoted_tweet["entities"]["urls"][url]["expanded_url"])
|
||||||
|
except IndexError: pass
|
||||||
|
l = tweets.is_long(quoted_tweet)
|
||||||
|
id = tweets.get_id(l)
|
||||||
|
try: original_tweet = self.twitter.twitter.show_status(id=id)
|
||||||
|
except: return quoted_tweet
|
||||||
|
urls = utils.find_urls_in_text(original_tweet["text"])
|
||||||
|
for url in range(0, len(urls)):
|
||||||
|
try: original_tweet["text"] = original_tweet["text"].replace(urls[url], original_tweet["entities"]["urls"][url]["expanded_url"])
|
||||||
|
except IndexError: pass
|
||||||
|
return compose.compose_quoted_tweet(quoted_tweet, original_tweet)
|
||||||
|
|
||||||
|
23
src/setup.py
23
src/setup.py
@@ -25,6 +25,7 @@ import gettext
|
|||||||
import application
|
import application
|
||||||
import platform
|
import platform
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
import wx
|
||||||
|
|
||||||
def get_architecture_files():
|
def get_architecture_files():
|
||||||
if platform.architecture()[0][:2] == "32":
|
if platform.architecture()[0][:2] == "32":
|
||||||
@@ -48,7 +49,7 @@ def get_data():
|
|||||||
("accessible_output2/lib", glob("accessible_output2/lib/*.dll")),
|
("accessible_output2/lib", glob("accessible_output2/lib/*.dll")),
|
||||||
("keys/lib", glob("keys/lib/*.dll")),
|
("keys/lib", glob("keys/lib/*.dll")),
|
||||||
("keymaps", glob("keymaps/*.keymap")),
|
("keymaps", glob("keymaps/*.keymap")),
|
||||||
]+get_sounds()+get_locales()+get_documentation()+sound_lib.find_datafiles()+accessible_output2.find_datafiles()+enchant.utils.win32_data_files()+get_architecture_files()
|
]+get_sounds()+get_locales()+get_documentation()+sound_lib.find_datafiles()+accessible_output2.find_datafiles()+enchant.utils.win32_data_files()+get_architecture_files()+wx_files()
|
||||||
|
|
||||||
def get_documentation ():
|
def get_documentation ():
|
||||||
answer = []
|
answer = []
|
||||||
@@ -79,6 +80,24 @@ def get_locales():
|
|||||||
answer.append(new)
|
answer.append(new)
|
||||||
return answer
|
return answer
|
||||||
|
|
||||||
|
def wx_files():
|
||||||
|
wxDir=wx.__path__[0]
|
||||||
|
localeMoFiles=set()
|
||||||
|
for f in glob("locales/*/LC_MESSAGES"):
|
||||||
|
g=f.replace("locales", "locale")
|
||||||
|
wxMoFile=os.path.join(wxDir,g,"wxstd.mo")
|
||||||
|
if os.path.isfile(wxMoFile):
|
||||||
|
localeMoFiles.add((f,(wxMoFile,)))
|
||||||
|
lang=os.path.split(os.path.split(f)[0])[1]
|
||||||
|
if '_' in lang:
|
||||||
|
lang=lang.split('_')[0]
|
||||||
|
f=os.path.join('locale',lang,'lc_messages')
|
||||||
|
g=f.replace("locale", "locales")
|
||||||
|
wxMoFile=os.path.join(wxDir,f,"wxstd.mo")
|
||||||
|
if os.path.isfile(wxMoFile):
|
||||||
|
localeMoFiles.add((g,(wxMoFile,)))
|
||||||
|
return list(localeMoFiles)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
setup(
|
setup(
|
||||||
name = application.name,
|
name = application.name,
|
||||||
@@ -92,7 +111,7 @@ options = {
|
|||||||
'py2exe': {
|
'py2exe': {
|
||||||
'optimize':2,
|
'optimize':2,
|
||||||
'packages': ["pubsub", "pubsub.core", "pubsub.core.kwargs", "dbhash"],
|
'packages': ["pubsub", "pubsub.core", "pubsub.core.kwargs", "dbhash"],
|
||||||
'dll_excludes': ["MPR.dll", "api-ms-win-core-apiquery-l1-1-0.dll", "api-ms-win-core-console-l1-1-0.dll", "api-ms-win-core-delayload-l1-1-1.dll", "api-ms-win-core-errorhandling-l1-1-1.dll", "api-ms-win-core-file-l1-2-0.dll", "api-ms-win-core-handle-l1-1-0.dll", "api-ms-win-core-heap-obsolete-l1-1-0.dll", "api-ms-win-core-libraryloader-l1-1-1.dll", "api-ms-win-core-localization-l1-2-0.dll", "api-ms-win-core-processenvironment-l1-2-0.dll", "api-ms-win-core-processthreads-l1-1-1.dll", "api-ms-win-core-profile-l1-1-0.dll", "api-ms-win-core-registry-l1-1-0.dll", "api-ms-win-core-synch-l1-2-0.dll", "api-ms-win-core-sysinfo-l1-2-0.dll", "api-ms-win-security-base-l1-2-0.dll", "api-ms-win-core-heap-l1-2-0.dll", "api-ms-win-core-interlocked-l1-2-0.dll", "api-ms-win-core-localization-obsolete-l1-1-0.dll", "api-ms-win-core-string-l1-1-0.dll", "api-ms-win-core-string-obsolete-l1-1-0.dll", "WLDAP32.dll", "MSVCP90.dll"],
|
'dll_excludes': ["MPR.dll", "api-ms-win-core-apiquery-l1-1-0.dll", "api-ms-win-core-console-l1-1-0.dll", "api-ms-win-core-delayload-l1-1-1.dll", "api-ms-win-core-errorhandling-l1-1-1.dll", "api-ms-win-core-file-l1-2-0.dll", "api-ms-win-core-handle-l1-1-0.dll", "api-ms-win-core-heap-obsolete-l1-1-0.dll", "api-ms-win-core-libraryloader-l1-1-1.dll", "api-ms-win-core-localization-l1-2-0.dll", "api-ms-win-core-processenvironment-l1-2-0.dll", "api-ms-win-core-processthreads-l1-1-1.dll", "api-ms-win-core-profile-l1-1-0.dll", "api-ms-win-core-registry-l1-1-0.dll", "api-ms-win-core-synch-l1-2-0.dll", "api-ms-win-core-sysinfo-l1-2-0.dll", "api-ms-win-security-base-l1-2-0.dll", "api-ms-win-core-heap-l1-2-0.dll", "api-ms-win-core-interlocked-l1-2-0.dll", "api-ms-win-core-localization-obsolete-l1-1-0.dll", "api-ms-win-core-string-l1-1-0.dll", "api-ms-win-core-string-obsolete-l1-1-0.dll", "WLDAP32.dll", "MSVCP90.dll", "CRYPT32.dll", "mfc90.dll"],
|
||||||
'skip_archive': True
|
'skip_archive': True
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
19
src/sound.py
19
src/sound.py
@@ -129,24 +129,7 @@ class URLStream(object):
|
|||||||
self.stream.volume = float(volume)
|
self.stream.volume = float(volume)
|
||||||
self.stream.play()
|
self.stream.play()
|
||||||
log.debug("played")
|
log.debug("played")
|
||||||
call_threaded(self.delete_when_done)
|
# call_threaded(self.delete_when_done)
|
||||||
|
|
||||||
def is_playable(self, url,play=False,volume=1.0):
|
|
||||||
try:
|
|
||||||
log.debug("Checking URL playability...")
|
|
||||||
self.prepare(url)
|
|
||||||
if self.prepared == True:
|
|
||||||
stream=sound_lib.stream.URLStream(url=self.url)
|
|
||||||
if play:
|
|
||||||
return self.play(stream=stream,volume=volume,announce=False)
|
|
||||||
return True
|
|
||||||
except:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def delete_when_done(self):
|
|
||||||
while hasattr(self,'stream') and self.stream.is_playing:
|
|
||||||
pass
|
|
||||||
del self.stream
|
|
||||||
|
|
||||||
def stop_audio(self,delete=False):
|
def stop_audio(self,delete=False):
|
||||||
if hasattr(self, "stream"):
|
if hasattr(self, "stream"):
|
||||||
|
@@ -21,15 +21,24 @@ class timelinesStreamer(TwythonStreamer):
|
|||||||
self.lists = self.session.lists
|
self.lists = self.session.lists
|
||||||
|
|
||||||
def on_error(self, status_code, data):
|
def on_error(self, status_code, data):
|
||||||
log.debug("%s: %s" % (status_code, data))
|
log.error("error in stream: %s: %s" % (status_code, data))
|
||||||
|
# pub.sendMessage("stream-error", session=self.session.session_id)
|
||||||
|
|
||||||
def on_timeout(self, *args, **kwargs):
|
def on_timeout(self, *args, **kwargs):
|
||||||
log.debug("Twitter timeout Error")
|
log.error("Twitter timeout Error")
|
||||||
pub.sendMessage("stream-error")
|
# pub.sendMessage("stream-error", session=self.session.session_id)
|
||||||
|
|
||||||
def check_tls(self, data):
|
def check_tls(self, data):
|
||||||
for i in self.session.settings["other_buffers"]["timelines"]:
|
for i in self.session.settings["other_buffers"]["timelines"]:
|
||||||
if data["user"]["screen_name"] == i:
|
if data["user"]["screen_name"] == i:
|
||||||
|
if utils.find_item(data["id"], self.session.db["%s-timeline" % (i,)]) != None:
|
||||||
|
log.error("duplicated tweet. Ignoring it...")
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
data_ = self.session.check_quoted_status(data)
|
||||||
|
data = data_
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s-timeline" % (i,)].append(data)
|
if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s-timeline" % (i,)].append(data)
|
||||||
else: self.session.db["%s-timeline" % (i,)].insert(0, data)
|
else: self.session.db["%s-timeline" % (i,)].insert(0, data)
|
||||||
pub.sendMessage("item-in-timeline", data= data, user= self.session.db["user_name"], who= i)
|
pub.sendMessage("item-in-timeline", data= data, user= self.session.db["user_name"], who= i)
|
||||||
@@ -38,6 +47,7 @@ class timelinesStreamer(TwythonStreamer):
|
|||||||
i.users.index(data["user"]["id"])
|
i.users.index(data["user"]["id"])
|
||||||
usr = data["in_reply_to_user_id"]
|
usr = data["in_reply_to_user_id"]
|
||||||
if (usr != None and usr in self.friends) or data.has_key("retweeted_status"):
|
if (usr != None and usr in self.friends) or data.has_key("retweeted_status"):
|
||||||
|
data = self.session.check_quoted_status(data)
|
||||||
if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s" % (i.name,)].append(data)
|
if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s" % (i.name,)].append(data)
|
||||||
else: self.session.db["%s" % (i,)].insert(0, data)
|
else: self.session.db["%s" % (i,)].insert(0, data)
|
||||||
pub.sendMessage("item-in-list", data= data, user= self.session.db["user_name"], where= i.name)
|
pub.sendMessage("item-in-list", data= data, user= self.session.db["user_name"], where= i.name)
|
||||||
|
@@ -22,22 +22,32 @@ class streamer(TwythonStreamer):
|
|||||||
# self.blocked_users = []
|
# self.blocked_users = []
|
||||||
|
|
||||||
def on_timeout(self, *args, **kwargs):
|
def on_timeout(self, *args, **kwargs):
|
||||||
log.debug("Twitter timeout Error")
|
log.error("Twitter timeout Error")
|
||||||
pub.sendMessage("stream-error")
|
# pub.sendMessage("stream-error", session=self.session.session_id)
|
||||||
|
|
||||||
def on_error(self, status_code, data):
|
def on_error(self, status_code, data):
|
||||||
log.debug("Error %s: %s" % (status_code, data))
|
log.error("Error %s: %s" % (status_code, data))
|
||||||
|
# pub.sendMessage("stream-error", session=self.session.session_id)
|
||||||
|
|
||||||
def get_user(self):
|
def get_user(self):
|
||||||
return self.session.db["user_name"]
|
return self.session.db["user_name"]
|
||||||
|
|
||||||
def put_data(self, place, data):
|
def put_data(self, place, data):
|
||||||
if self.session.db.has_key(place):
|
if self.session.db.has_key(place):
|
||||||
|
if utils.find_item(data["id"], self.session.db[place]) != None:
|
||||||
|
log.error("duplicated tweet. Ignoring it...")
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
data_ = self.session.check_quoted_status(data)
|
||||||
|
data = data_
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if self.session.settings["general"]["reverse_timelines"] == False:
|
if self.session.settings["general"]["reverse_timelines"] == False:
|
||||||
self.session.db[place].append(data)
|
self.session.db[place].append(data)
|
||||||
else:
|
else:
|
||||||
self.session.db[place].insert(0, data)
|
self.session.db[place].insert(0, data)
|
||||||
utils.is_audio(data)
|
utils.is_audio(data)
|
||||||
|
|
||||||
def block_user(self, data):
|
def block_user(self, data):
|
||||||
id = data["target"]["id"]
|
id = data["target"]["id"]
|
||||||
if id in self.friends:
|
if id in self.friends:
|
||||||
|
@@ -10,7 +10,7 @@ import languageHandler
|
|||||||
import arrow
|
import arrow
|
||||||
import logging
|
import logging
|
||||||
import config
|
import config
|
||||||
from long_tweets import twishort
|
from long_tweets import twishort, tweets
|
||||||
log = logging.getLogger("compose")
|
log = logging.getLogger("compose")
|
||||||
|
|
||||||
def StripChars(s):
|
def StripChars(s):
|
||||||
@@ -60,11 +60,33 @@ def compose_tweet(tweet, db, relative_times):
|
|||||||
try:
|
try:
|
||||||
oldtext=text
|
oldtext=text
|
||||||
text=twishort.get_full_text(tweet['long_uri'])
|
text=twishort.get_full_text(tweet['long_uri'])
|
||||||
|
try: text = "rt @%s: %s" % (tweet["retweeted_status"]["user"]["screen_name"], StripChars(text))
|
||||||
|
except KeyError: pass
|
||||||
except:
|
except:
|
||||||
text=oldtext
|
text=oldtext
|
||||||
|
if tweet.has_key("message"):
|
||||||
|
text = tweet["message"]
|
||||||
|
return [user+", ", text, ts+", ", source]
|
||||||
|
|
||||||
tweet["text"] = text
|
tweet["text"] = text
|
||||||
return [user+", ", tweet["text"], ts+", ", source]
|
return [user+", ", tweet["text"], ts+", ", source]
|
||||||
|
|
||||||
|
def compose_quoted_tweet(quoted_tweet, original_tweet):
|
||||||
|
""" It receives a tweet and returns a list with the user, text for the tweet or message, date and the client where user is."""
|
||||||
|
text = StripChars(quoted_tweet["text"])
|
||||||
|
quoting_user = quoted_tweet["user"]["name"]
|
||||||
|
source = re.sub(r"(?s)<.*?>", "", quoted_tweet["source"])
|
||||||
|
try: text = "rt @%s: %s" % (quoted_tweet["retweeted_status"]["user"]["screen_name"], StripChars(quoted_tweet["retweeted_status"]["text"]))
|
||||||
|
except KeyError: text = "%s" % (StripChars(quoted_tweet["text"]))
|
||||||
|
if text[-1] in chars: text=text+"."
|
||||||
|
original_user = original_tweet["user"]["screen_name"]
|
||||||
|
original_text = StripChars(original_tweet["text"])
|
||||||
|
try: original_text = "rt @%s: %s" % (original_tweet["retweeted_status"]["user"]["screen_name"], StripChars(original_tweet["retweeted_status"]["text"]))
|
||||||
|
except KeyError: original_text = "%s" % (StripChars(original_tweet["text"]))
|
||||||
|
quoted_tweet["message"] = _(u"{0}. Quoted tweet from @{1}: {2}").format( quoted_tweet["text"], original_user, original_text)
|
||||||
|
quoted_tweet = tweets.clear_url(quoted_tweet)
|
||||||
|
return quoted_tweet
|
||||||
|
|
||||||
def compose_followers_list(tweet, db, relative_times=True):
|
def compose_followers_list(tweet, db, relative_times=True):
|
||||||
if system == "Windows":
|
if system == "Windows":
|
||||||
original_date = arrow.get(tweet["created_at"], "ddd MMM D H:m:s Z YYYY", locale="en")
|
original_date = arrow.get(tweet["created_at"], "ddd MMM D H:m:s Z YYYY", locale="en")
|
||||||
|
@@ -28,7 +28,7 @@ class twitter(object):
|
|||||||
|
|
||||||
def authorise(self, settings):
|
def authorise(self, settings):
|
||||||
authorisationHandler.logged = False
|
authorisationHandler.logged = False
|
||||||
port = random.randint(30000, 66000)
|
port = random.randint(30000, 65535)
|
||||||
httpd = BaseHTTPServer.HTTPServer(('127.0.0.1', port), authorisationHandler.handler)
|
httpd = BaseHTTPServer.HTTPServer(('127.0.0.1', port), authorisationHandler.handler)
|
||||||
if config.app["proxy"]["server"] != "" and config.app["proxy"]["port"] != "":
|
if config.app["proxy"]["server"] != "" and config.app["proxy"]["port"] != "":
|
||||||
args = {"proxies": {"http": "http://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"]),
|
args = {"proxies": {"http": "http://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"]),
|
||||||
@@ -53,5 +53,3 @@ class twitter(object):
|
|||||||
settings["twitter"]["user_secret"] = user_secret
|
settings["twitter"]["user_secret"] = user_secret
|
||||||
settings.write()
|
settings.write()
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
log.error(certs.where())
|
|
@@ -32,7 +32,7 @@ def find_item(id, listItem):
|
|||||||
|
|
||||||
def find_list(name, lists):
|
def find_list(name, lists):
|
||||||
for i in range(0, len(lists)):
|
for i in range(0, len(lists)):
|
||||||
if lists[i]["slug"] == name: return lists[i]["id"]
|
if lists[i]["name"] == name: return lists[i]["id"]
|
||||||
|
|
||||||
def find_previous_reply(id, listItem):
|
def find_previous_reply(id, listItem):
|
||||||
for i in range(0, len(listItem)):
|
for i in range(0, len(listItem)):
|
||||||
|
@@ -7,6 +7,9 @@ import os
|
|||||||
import platform
|
import platform
|
||||||
import requests
|
import requests
|
||||||
import tempfile
|
import tempfile
|
||||||
|
from wxUI import commonMessageDialogs
|
||||||
|
import widgetUtils
|
||||||
|
import webbrowser
|
||||||
try:
|
try:
|
||||||
import czipfile as zipfile
|
import czipfile as zipfile
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@@ -20,13 +23,14 @@ def perform_update(endpoint, current_version, app_name='', password=None, update
|
|||||||
if not available_update:
|
if not available_update:
|
||||||
logger.debug("No update available")
|
logger.debug("No update available")
|
||||||
return False
|
return False
|
||||||
available_version = available_update['current_version']
|
available_version = float(available_update['current_version'])
|
||||||
if not str(available_version) > str(current_version) or platform.system()+platform.architecture()[0][:2] not in available_update['downloads']:
|
if not float(available_version) > float(current_version) or platform.system()+platform.architecture()[0][:2] not in available_update['downloads']:
|
||||||
logger.debug("No update for this architecture")
|
logger.debug("No update for this architecture")
|
||||||
return False
|
return False
|
||||||
available_description = available_update.get('description', None)
|
available_description = available_update.get('description', None)
|
||||||
update_url = available_update ['downloads'][platform.system()+platform.architecture()[0][:2]]
|
update_url = available_update ['downloads'][platform.system()+platform.architecture()[0][:2]]
|
||||||
logger.info("A new update is available. Version %s" % available_version)
|
logger.info("A new update is available. Version %s" % available_version)
|
||||||
|
donation()
|
||||||
if callable(update_available_callback) and not update_available_callback(version=available_version, description=available_description): #update_available_callback should return a falsy value to stop the process
|
if callable(update_available_callback) and not update_available_callback(version=available_version, description=available_description): #update_available_callback should return a falsy value to stop the process
|
||||||
logger.info("User canceled update.")
|
logger.info("User canceled update.")
|
||||||
return
|
return
|
||||||
@@ -114,3 +118,8 @@ def call_callback(callback, *args, **kwargs):
|
|||||||
callback(*args, **kwargs)
|
callback(*args, **kwargs)
|
||||||
# except:
|
# except:
|
||||||
# logger.exception("Failed calling callback %r with args %r and kwargs %r" % (callback, args, kwargs))
|
# logger.exception("Failed calling callback %r with args %r and kwargs %r" % (callback, args, kwargs))
|
||||||
|
|
||||||
|
def donation():
|
||||||
|
dlg = commonMessageDialogs.donation()
|
||||||
|
if dlg == widgetUtils.YES:
|
||||||
|
webbrowser.open_new_tab("http://twblue.es/?q=donate")
|
@@ -1,4 +1,7 @@
|
|||||||
import wx
|
import wx
|
||||||
|
import paths
|
||||||
|
import languageHandler
|
||||||
|
import sys
|
||||||
|
|
||||||
toolkit = "wx"
|
toolkit = "wx"
|
||||||
|
|
||||||
@@ -108,6 +111,15 @@ class mainLoopObject(wx.App):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.app = wx.App()
|
self.app = wx.App()
|
||||||
|
self.lc = wx.Locale()
|
||||||
|
lang=languageHandler.getLanguage()
|
||||||
|
wxLang=self.lc.FindLanguageInfo(lang)
|
||||||
|
if not wxLang and '_' in lang:
|
||||||
|
wxLang=self.lc.FindLanguageInfo(lang.split('_')[0])
|
||||||
|
if hasattr(sys,'frozen'):
|
||||||
|
self.lc.AddCatalogLookupPathPrefix(paths.app_path("locales"))
|
||||||
|
if wxLang:
|
||||||
|
self.lc.Init(wxLang.Language)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.app.MainLoop()
|
self.app.MainLoop()
|
||||||
|
@@ -16,9 +16,11 @@ class trendsPanel(wx.Panel):
|
|||||||
self.create_list()
|
self.create_list()
|
||||||
self.tweet = wx.Button(self, -1, _(u"Tweet"))
|
self.tweet = wx.Button(self, -1, _(u"Tweet"))
|
||||||
self.tweetTrendBtn = wx.Button(self, -1, _(u"Tweet about this trend"))
|
self.tweetTrendBtn = wx.Button(self, -1, _(u"Tweet about this trend"))
|
||||||
|
self.search_topic = wx.Button(self, -1, _(u"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)
|
||||||
|
btnSizer.Add(self.search_topic, 0, wx.ALL, 5)
|
||||||
self.sizer.Add(btnSizer, 0, wx.ALL, 5)
|
self.sizer.Add(btnSizer, 0, wx.ALL, 5)
|
||||||
self.sizer.Add(self.list.list, 0, wx.ALL, 5)
|
self.sizer.Add(self.list.list, 0, wx.ALL, 5)
|
||||||
self.SetSizer(self.sizer)
|
self.SetSizer(self.sizer)
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import wx
|
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, _(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()
|
||||||
|
|
||||||
@@ -8,7 +9,7 @@ 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, _(u"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 message? It will be deleted from Twitter as well."), _(u"Delete"), wx.ICON_QUESTION|wx.YES_NO).ShowModal()
|
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()
|
||||||
|
|
||||||
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, _(u"Do you really want to close {0}?").format(application.name,), _(u"Exit"), wx.YES_NO|wx.ICON_QUESTION)
|
||||||
@@ -18,10 +19,10 @@ 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, _(u" {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 on the autocomplete results anymore."), _(u"Confirm"), wx.YES_NO|wx.ICON_QUESTION).ShowModal()
|
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()
|
||||||
|
|
||||||
def get_ignored_client():
|
def get_ignored_client():
|
||||||
entry = wx.TextEntryDialog(None, _(u"Enter the name of the client here"), _(u"Add a new ignored client"))
|
entry = wx.TextEntryDialog(None, _(u"Enter the name of the client : "), _(u"Add client"))
|
||||||
if entry.ShowModal() == wx.ID_OK:
|
if entry.ShowModal() == wx.ID_OK:
|
||||||
return entry.GetValue()
|
return entry.GetValue()
|
||||||
return None
|
return None
|
||||||
@@ -31,19 +32,29 @@ def clear_list():
|
|||||||
return dlg.ShowModal()
|
return dlg.ShowModal()
|
||||||
|
|
||||||
def remove_buffer():
|
def remove_buffer():
|
||||||
return wx.MessageDialog(None, _(u"Do you really want to delete this timeline?"), _(u"Attention"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal()
|
return wx.MessageDialog(None, _(u"Do you really want to destroy this buffer?"), _(u"Attention"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal()
|
||||||
|
|
||||||
def user_not_exist():
|
def user_not_exist():
|
||||||
return wx.MessageDialog(None, _(u"The user does not exist"), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _(u"That user does not exist"), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def timeline_exist():
|
def timeline_exist():
|
||||||
return wx.MessageDialog(None, _(u"There's currently a timeline for this user. You are not able to open another"), _(u"Existing timeline"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _(u"A timeline for this user already exists. You can't open another"), _(u"Existing timeline"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
def no_tweets():
|
def no_tweets():
|
||||||
return wx.MessageDialog(None, _(u"This user has no tweets. You can't open a timeline for this user"), _(u"Error!"), wx.ICON_ERROR).ShowModal()
|
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()
|
||||||
|
|
||||||
def protected_user():
|
def protected_user():
|
||||||
return wx.MessageDialog(None, _(u"This is a protected Twitter user. It means you can not 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, _(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()
|
||||||
|
|
||||||
def no_following():
|
def no_following():
|
||||||
return wx.MessageDialog(None, _(u"This is a protected user account, you need follow to this user for viewing your tweets or favourites."), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
return wx.MessageDialog(None, _(u"This is a protected user account, you need to follow this user to view their tweets or favorites."), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
||||||
|
|
||||||
|
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)
|
||||||
|
return dlg.ShowModal()
|
||||||
|
|
||||||
|
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()
|
||||||
|
|
||||||
|
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()
|
||||||
|
@@ -123,6 +123,7 @@ class removeUserListDialog(listViewer):
|
|||||||
self.SetTitle(_(u"Select a list to remove the user"))
|
self.SetTitle(_(u"Select a list to remove the user"))
|
||||||
self.createBtn.SetLabel(_(u"Remove"))
|
self.createBtn.SetLabel(_(u"Remove"))
|
||||||
self.createBtn.SetDefault()
|
self.createBtn.SetDefault()
|
||||||
|
self.createBtn.SetId(wx.ID_OK)
|
||||||
self.editBtn.Disable()
|
self.editBtn.Disable()
|
||||||
self.view.Disable()
|
self.view.Disable()
|
||||||
# self.subscriptors.Disable()
|
# self.subscriptors.Disable()
|
||||||
|
@@ -5,7 +5,6 @@ import widgetUtils
|
|||||||
class textLimited(widgetUtils.BaseDialog):
|
class textLimited(widgetUtils.BaseDialog):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(textLimited, self).__init__(parent=None, *args, **kwargs)
|
super(textLimited, self).__init__(parent=None, *args, **kwargs)
|
||||||
self.shift=False
|
|
||||||
def createTextArea(self, message="", text=""):
|
def createTextArea(self, message="", text=""):
|
||||||
self.panel = wx.Panel(self)
|
self.panel = wx.Panel(self)
|
||||||
self.label = wx.StaticText(self.panel, -1, message)
|
self.label = wx.StaticText(self.panel, -1, message)
|
||||||
@@ -16,8 +15,7 @@ class textLimited(widgetUtils.BaseDialog):
|
|||||||
# dc.SetFont(font)
|
# dc.SetFont(font)
|
||||||
# x, y = dc.GetTextExtent("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
|
# x, y = dc.GetTextExtent("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
|
||||||
# self.text.SetSize((x, y))
|
# self.text.SetSize((x, y))
|
||||||
self.Bind(wx.EVT_TEXT_ENTER, self.on_enter)
|
self.Bind(wx.EVT_CHAR_HOOK, self.handle_keys, self.text)
|
||||||
self.Bind(wx.EVT_CHAR_HOOK, self.handle_keys)
|
|
||||||
self.text.SetFocus()
|
self.text.SetFocus()
|
||||||
self.textBox = wx.BoxSizer(wx.HORIZONTAL)
|
self.textBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
self.textBox.Add(self.label, 0, wx.ALL, 5)
|
self.textBox.Add(self.label, 0, wx.ALL, 5)
|
||||||
@@ -46,14 +44,11 @@ class textLimited(widgetUtils.BaseDialog):
|
|||||||
def onSelect(self, ev):
|
def onSelect(self, ev):
|
||||||
self.text.SelectAll()
|
self.text.SelectAll()
|
||||||
|
|
||||||
def on_enter(self,event):
|
|
||||||
if self.shift==False and hasattr(self,'okButton'):
|
|
||||||
return wx.PostEvent(self.okButton.GetEventHandler(),wx.PyCommandEvent(wx.EVT_BUTTON.typeId,wx.ID_OK))
|
|
||||||
else:
|
|
||||||
return self.text.WriteText('\n')
|
|
||||||
|
|
||||||
def handle_keys(self, event):
|
def handle_keys(self, event):
|
||||||
self.shift=event.ShiftDown()
|
shift=event.ShiftDown()
|
||||||
|
if event.GetKeyCode() == wx.WXK_RETURN and shift==False and hasattr(self,'okButton'):
|
||||||
|
wx.PostEvent(self.okButton.GetEventHandler(), wx.PyCommandEvent(wx.EVT_BUTTON.typeId,wx.ID_OK))
|
||||||
|
else:
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|
||||||
def set_cursor_at_end(self):
|
def set_cursor_at_end(self):
|
||||||
@@ -83,6 +78,7 @@ class tweet(textLimited):
|
|||||||
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, _(u"Translate..."), size=wx.DefaultSize)
|
||||||
|
self.translateButton.Enable(False)
|
||||||
self.autocompletionButton = wx.Button(self.panel, -1, _(u"&Autocomplete users"))
|
self.autocompletionButton = wx.Button(self.panel, -1, _(u"&Autocomplete users"))
|
||||||
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Send"), size=wx.DefaultSize)
|
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Send"), size=wx.DefaultSize)
|
||||||
self.okButton.SetDefault()
|
self.okButton.SetDefault()
|
||||||
@@ -143,6 +139,7 @@ class retweet(tweet):
|
|||||||
self.shortenButton.Disable()
|
self.shortenButton.Disable()
|
||||||
self.unshortenButton.Disable()
|
self.unshortenButton.Disable()
|
||||||
self.translateButton = wx.Button(self.panel, -1, _(u"Translate message"), size=wx.DefaultSize)
|
self.translateButton = wx.Button(self.panel, -1, _(u"Translate message"), size=wx.DefaultSize)
|
||||||
|
self.translateButton.Enable(False)
|
||||||
self.autocompletionButton = wx.Button(self.panel, -1, _(u"&Autocomplete users"))
|
self.autocompletionButton = wx.Button(self.panel, -1, _(u"&Autocomplete users"))
|
||||||
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Send"), size=wx.DefaultSize)
|
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Send"), size=wx.DefaultSize)
|
||||||
self.okButton.SetDefault()
|
self.okButton.SetDefault()
|
||||||
@@ -204,6 +201,7 @@ class dm(textLimited):
|
|||||||
self.shortenButton.Disable()
|
self.shortenButton.Disable()
|
||||||
self.unshortenButton.Disable()
|
self.unshortenButton.Disable()
|
||||||
self.translateButton = wx.Button(self.panel, -1, _(u"Translate message"), size=wx.DefaultSize)
|
self.translateButton = wx.Button(self.panel, -1, _(u"Translate message"), size=wx.DefaultSize)
|
||||||
|
self.translateButton.Enable(False)
|
||||||
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Send"), size=wx.DefaultSize)
|
self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Send"), size=wx.DefaultSize)
|
||||||
self.okButton.SetDefault()
|
self.okButton.SetDefault()
|
||||||
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _(u"Close"), size=wx.DefaultSize)
|
cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _(u"Close"), size=wx.DefaultSize)
|
||||||
@@ -221,6 +219,7 @@ class dm(textLimited):
|
|||||||
self.buttonsBox3.Add(cancelButton, 0, wx.ALL, 5)
|
self.buttonsBox3.Add(cancelButton, 0, wx.ALL, 5)
|
||||||
self.mainBox.Add(self.buttonsBox3, 0, wx.ALL, 5)
|
self.mainBox.Add(self.buttonsBox3, 0, wx.ALL, 5)
|
||||||
self.panel.SetSizer(self.mainBox)
|
self.panel.SetSizer(self.mainBox)
|
||||||
|
# self.SetClientSize(self.mainBox.CalcMin())
|
||||||
|
|
||||||
def __init__(self, title, message, users):
|
def __init__(self, title, message, users):
|
||||||
super(dm, self).__init__()
|
super(dm, self).__init__()
|
||||||
@@ -282,6 +281,7 @@ class viewTweet(widgetUtils.BaseDialog):
|
|||||||
self.unshortenButton = wx.Button(panel, -1, _(u"Expand URL"), size=wx.DefaultSize)
|
self.unshortenButton = wx.Button(panel, -1, _(u"Expand URL"), size=wx.DefaultSize)
|
||||||
self.unshortenButton.Disable()
|
self.unshortenButton.Disable()
|
||||||
self.translateButton = wx.Button(panel, -1, _(u"Translate message"), size=wx.DefaultSize)
|
self.translateButton = wx.Button(panel, -1, _(u"Translate message"), size=wx.DefaultSize)
|
||||||
|
self.translateButton.Enable(False)
|
||||||
cancelButton = wx.Button(panel, wx.ID_CANCEL, _(u"Close"), size=wx.DefaultSize)
|
cancelButton = wx.Button(panel, wx.ID_CANCEL, _(u"Close"), size=wx.DefaultSize)
|
||||||
cancelButton.SetDefault()
|
cancelButton.SetDefault()
|
||||||
buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
|
buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
@@ -337,6 +337,7 @@ class viewNonTweet(widgetUtils.BaseDialog):
|
|||||||
self.unshortenButton = wx.Button(panel, -1, _(u"Expand URL"), size=wx.DefaultSize)
|
self.unshortenButton = wx.Button(panel, -1, _(u"Expand URL"), size=wx.DefaultSize)
|
||||||
self.unshortenButton.Disable()
|
self.unshortenButton.Disable()
|
||||||
self.translateButton = wx.Button(panel, -1, _(u"Translate message"), size=wx.DefaultSize)
|
self.translateButton = wx.Button(panel, -1, _(u"Translate message"), size=wx.DefaultSize)
|
||||||
|
self.translateButton.Enable(False)
|
||||||
cancelButton = wx.Button(panel, wx.ID_CANCEL, _(u"Close"), size=wx.DefaultSize)
|
cancelButton = wx.Button(panel, wx.ID_CANCEL, _(u"Close"), size=wx.DefaultSize)
|
||||||
cancelButton.SetDefault()
|
cancelButton.SetDefault()
|
||||||
buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
|
buttonsBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
|
@@ -10,8 +10,10 @@ class UserActionsDialog(wx.Dialog):
|
|||||||
userLabel = wx.StaticText(panel, -1, _(u"User"))
|
userLabel = wx.StaticText(panel, -1, _(u"User"))
|
||||||
self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0])
|
self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0])
|
||||||
self.cb.SetFocus()
|
self.cb.SetFocus()
|
||||||
|
self.autocompletion = wx.Button(panel, -1, _(u"&Autocomplete users"))
|
||||||
userSizer.Add(userLabel, 0, wx.ALL, 5)
|
userSizer.Add(userLabel, 0, wx.ALL, 5)
|
||||||
userSizer.Add(self.cb, 0, wx.ALL, 5)
|
userSizer.Add(self.cb, 0, wx.ALL, 5)
|
||||||
|
userSizer.Add(self.autocompletion, 0, wx.ALL, 5)
|
||||||
actionSizer = wx.BoxSizer(wx.VERTICAL)
|
actionSizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
label2 = wx.StaticText(panel, -1, _(u"Action"))
|
label2 = wx.StaticText(panel, -1, _(u"Action"))
|
||||||
self.follow = wx.RadioButton(panel, -1, _(u"Follow"), style=wx.RB_GROUP)
|
self.follow = wx.RadioButton(panel, -1, _(u"Follow"), style=wx.RB_GROUP)
|
||||||
@@ -79,3 +81,9 @@ class UserActionsDialog(wx.Dialog):
|
|||||||
|
|
||||||
def get_user(self):
|
def get_user(self):
|
||||||
return self.cb.GetValue()
|
return self.cb.GetValue()
|
||||||
|
|
||||||
|
def get_position(self):
|
||||||
|
return self.cb.GetPosition()
|
||||||
|
|
||||||
|
def popup_menu(self, menu):
|
||||||
|
self.PopupMenu(menu, self.cb.GetPosition())
|
||||||
|
@@ -10,8 +10,10 @@ class selectUserDialog(wx.Dialog):
|
|||||||
userLabel = wx.StaticText(panel, -1, _(u"User"))
|
userLabel = wx.StaticText(panel, -1, _(u"User"))
|
||||||
self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0])
|
self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0])
|
||||||
self.cb.SetFocus()
|
self.cb.SetFocus()
|
||||||
|
self.autocompletion = wx.Button(panel, -1, _(u"&Autocomplete users"))
|
||||||
userSizer.Add(userLabel, 0, wx.ALL, 5)
|
userSizer.Add(userLabel, 0, wx.ALL, 5)
|
||||||
userSizer.Add(self.cb, 0, wx.ALL, 5)
|
userSizer.Add(self.cb, 0, wx.ALL, 5)
|
||||||
|
userSizer.Add(self.autocompletion, 0, wx.ALL, 5)
|
||||||
actionSizer = wx.BoxSizer(wx.VERTICAL)
|
actionSizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
label2 = wx.StaticText(panel, -1, _(u"Buffer type"))
|
label2 = wx.StaticText(panel, -1, _(u"Buffer type"))
|
||||||
self.tweets = wx.RadioButton(panel, -1, _(u"Tweets"), style=wx.RB_GROUP)
|
self.tweets = wx.RadioButton(panel, -1, _(u"Tweets"), style=wx.RB_GROUP)
|
||||||
@@ -49,3 +51,9 @@ class selectUserDialog(wx.Dialog):
|
|||||||
|
|
||||||
def get_user(self):
|
def get_user(self):
|
||||||
return self.cb.GetValue()
|
return self.cb.GetValue()
|
||||||
|
|
||||||
|
def get_position(self):
|
||||||
|
return self.cb.GetPosition()
|
||||||
|
|
||||||
|
def popup_menu(self, menu):
|
||||||
|
self.PopupMenu(menu, self.cb.GetPosition())
|
||||||
|
@@ -26,8 +26,10 @@ class selectUserDialog(baseDialog.BaseWXDialog):
|
|||||||
userSizer = wx.BoxSizer()
|
userSizer = wx.BoxSizer()
|
||||||
self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0], size=wx.DefaultSize)
|
self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0], size=wx.DefaultSize)
|
||||||
self.cb.SetFocus()
|
self.cb.SetFocus()
|
||||||
|
self.autocompletion = wx.Button(panel, -1, _(u"&Autocomplete users"))
|
||||||
userSizer.Add(wx.StaticText(panel, -1, _(u"User")), 0, wx.ALL, 5)
|
userSizer.Add(wx.StaticText(panel, -1, _(u"User")), 0, wx.ALL, 5)
|
||||||
userSizer.Add(self.cb)
|
userSizer.Add(self.cb, 0, wx.ALL, 5)
|
||||||
|
userSizer.Add(self.autocompletion, 0, wx.ALL, 5)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
ok = wx.Button(panel, wx.ID_OK, _(u"OK"))
|
ok = wx.Button(panel, wx.ID_OK, _(u"OK"))
|
||||||
ok.SetDefault()
|
ok.SetDefault()
|
||||||
|
97
src/wxUI/menus.py
Normal file
97
src/wxUI/menus.py
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import wx
|
||||||
|
|
||||||
|
class basePanelMenu(wx.Menu):
|
||||||
|
def __init__(self):
|
||||||
|
super(basePanelMenu, self).__init__()
|
||||||
|
self.retweet = wx.MenuItem(self, wx.NewId(), _(u"&Retweet"))
|
||||||
|
self.AppendItem(self.retweet)
|
||||||
|
self.reply = wx.MenuItem(self, wx.NewId(), _(u"Re&ply"))
|
||||||
|
self.AppendItem(self.reply)
|
||||||
|
self.fav = wx.MenuItem(self, wx.NewId(), _(u"Add to &favourites"))
|
||||||
|
self.AppendItem(self.fav)
|
||||||
|
self.unfav = wx.MenuItem(self, wx.NewId(), _(u"Remove from favo&urites"))
|
||||||
|
self.AppendItem(self.unfav)
|
||||||
|
self.openUrl = wx.MenuItem(self, wx.NewId(), _(u"&Open URL"))
|
||||||
|
self.AppendItem(self.openUrl)
|
||||||
|
self.play = wx.MenuItem(self, wx.NewId(), _(u"&Play audio"))
|
||||||
|
self.AppendItem(self.play)
|
||||||
|
self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show tweet"))
|
||||||
|
self.AppendItem(self.view)
|
||||||
|
self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard"))
|
||||||
|
self.AppendItem(self.copy)
|
||||||
|
self.remove = wx.MenuItem(self, wx.NewId(), _(u"&Delete"))
|
||||||
|
self.AppendItem(self.remove)
|
||||||
|
self.userActions = wx.MenuItem(self, wx.NewId(), _(u"&User actions..."))
|
||||||
|
self.AppendItem(self.userActions)
|
||||||
|
|
||||||
|
class dmPanelMenu(wx.Menu):
|
||||||
|
def __init__(self):
|
||||||
|
super(dmPanelMenu, self).__init__()
|
||||||
|
self.reply = wx.MenuItem(self, wx.NewId(), _(u"Re&ply"))
|
||||||
|
self.AppendItem(self.reply)
|
||||||
|
self.openUrl = wx.MenuItem(self, wx.NewId(), _(u"&Open URL"))
|
||||||
|
self.AppendItem(self.openUrl)
|
||||||
|
self.play = wx.MenuItem(self, wx.NewId(), _(u"&Play audio"))
|
||||||
|
self.AppendItem(self.play)
|
||||||
|
self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show direct message"))
|
||||||
|
self.AppendItem(self.view)
|
||||||
|
self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard"))
|
||||||
|
self.AppendItem(self.copy)
|
||||||
|
self.remove = wx.MenuItem(self, wx.NewId(), _(u"&Delete"))
|
||||||
|
self.AppendItem(self.remove)
|
||||||
|
self.userActions = wx.MenuItem(self, wx.NewId(), _(u"&User actions..."))
|
||||||
|
self.AppendItem(self.userActions)
|
||||||
|
|
||||||
|
class sentPanelMenu(wx.Menu):
|
||||||
|
def __init__(self):
|
||||||
|
super(sentPanelMenu, self).__init__()
|
||||||
|
self.openUrl = wx.MenuItem(self, wx.NewId(), _(u"&Open URL"))
|
||||||
|
self.AppendItem(self.openUrl)
|
||||||
|
self.play = wx.MenuItem(self, wx.NewId(), _(u"&Play audio"))
|
||||||
|
self.AppendItem(self.play)
|
||||||
|
self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show tweet"))
|
||||||
|
self.AppendItem(self.view)
|
||||||
|
self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard"))
|
||||||
|
self.AppendItem(self.copy)
|
||||||
|
self.remove = wx.MenuItem(self, wx.NewId(), _(u"&Delete"))
|
||||||
|
self.AppendItem(self.remove)
|
||||||
|
|
||||||
|
class eventsPanelMenu(wx.Menu):
|
||||||
|
def __init__(self):
|
||||||
|
super(eventsPanelMenu, self).__init__()
|
||||||
|
self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show event"))
|
||||||
|
self.AppendItem(self.view)
|
||||||
|
self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard"))
|
||||||
|
self.AppendItem(self.copy)
|
||||||
|
self.remove = wx.MenuItem(self, wx.NewId(), _(u"&Delete"))
|
||||||
|
self.AppendItem(self.remove)
|
||||||
|
|
||||||
|
class peoplePanelMenu(wx.Menu):
|
||||||
|
def __init__(self):
|
||||||
|
super(peoplePanelMenu, self).__init__()
|
||||||
|
self.reply = wx.MenuItem(self, wx.NewId(), _(u"Direct &message"))
|
||||||
|
self.AppendItem(self.reply)
|
||||||
|
self.lists = wx.MenuItem(self, wx.NewId(), _(u"&View lists"))
|
||||||
|
self.AppendItem(self.lists)
|
||||||
|
self.lists.Enable(False)
|
||||||
|
self.details = wx.MenuItem(self, wx.NewId(), _(u"Show user &profile"))
|
||||||
|
self.AppendItem(self.details)
|
||||||
|
self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show user"))
|
||||||
|
self.AppendItem(self.view)
|
||||||
|
self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard"))
|
||||||
|
self.AppendItem(self.copy)
|
||||||
|
self.userActions = wx.MenuItem(self, wx.NewId(), _(u"&User actions..."))
|
||||||
|
self.AppendItem(self.userActions)
|
||||||
|
|
||||||
|
class trendsPanelMenu(wx.Menu):
|
||||||
|
def __init__(self):
|
||||||
|
super(trendsPanelMenu, self).__init__()
|
||||||
|
self.search_topic = wx.MenuItem(self, wx.NewId(), _(u"Search topic"))
|
||||||
|
self.AppendItem(self.search_topic)
|
||||||
|
self.tweetThisTrend = wx.MenuItem(self, wx.NewId(), _(u"&Tweet about this trend"))
|
||||||
|
self.AppendItem(self.tweetThisTrend)
|
||||||
|
self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show item"))
|
||||||
|
self.AppendItem(self.view)
|
||||||
|
self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard"))
|
||||||
|
self.AppendItem(self.copy)
|
@@ -41,9 +41,7 @@ class mainFrame(wx.Frame):
|
|||||||
self.dm = user.Append(wx.NewId(), _(u"Direct me&ssage"))
|
self.dm = user.Append(wx.NewId(), _(u"Direct me&ssage"))
|
||||||
self.addToList = user.Append(wx.NewId(), _(u"&Add to list"))
|
self.addToList = user.Append(wx.NewId(), _(u"&Add to list"))
|
||||||
self.removeFromList = user.Append(wx.NewId(), _(u"R&emove from list"))
|
self.removeFromList = user.Append(wx.NewId(), _(u"R&emove from list"))
|
||||||
self.removeFromList.Enable(False)
|
|
||||||
self.viewLists = user.Append(wx.NewId(), _(u"&View lists"))
|
self.viewLists = user.Append(wx.NewId(), _(u"&View lists"))
|
||||||
self.viewLists.Enable(False)
|
|
||||||
self.details = user.Append(wx.NewId(), _(u"Show user &profile"))
|
self.details = user.Append(wx.NewId(), _(u"Show user &profile"))
|
||||||
self.favs = user.Append(wx.NewId(), _(u"V&iew favourites"))
|
self.favs = user.Append(wx.NewId(), _(u"V&iew favourites"))
|
||||||
|
|
||||||
@@ -126,6 +124,8 @@ class mainFrame(wx.Frame):
|
|||||||
self.SetClientSize(self.sizer.CalcMin())
|
self.SetClientSize(self.sizer.CalcMin())
|
||||||
# print self.GetSize()
|
# print self.GetSize()
|
||||||
|
|
||||||
|
def get_buffers(self):
|
||||||
|
return [self.nb.GetPage(i) for i in range(0, self.nb.GetPageCount())]
|
||||||
|
|
||||||
def search(self, name_, account):
|
def search(self, name_, account):
|
||||||
for i in range(0, self.nb.GetPageCount()):
|
for i in range(0, self.nb.GetPageCount()):
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2015-07-03 17:23+Hora de verano central (M<>xico)\n"
|
"POT-Creation-Date: 2015-09-29 09:37+Hora de verano central (M<>xico)\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@@ -51,7 +51,7 @@ msgstr ""
|
|||||||
#: ../doc\strings.py:378 ../doc\strings.py:381 ../doc\strings.py:384
|
#: ../doc\strings.py:378 ../doc\strings.py:381 ../doc\strings.py:384
|
||||||
#: ../doc\strings.py:387 ../doc\strings.py:390 ../doc\strings.py:393
|
#: ../doc\strings.py:387 ../doc\strings.py:390 ../doc\strings.py:393
|
||||||
#: ../doc\strings.py:396 ../doc\strings.py:399 ../doc\strings.py:402
|
#: ../doc\strings.py:396 ../doc\strings.py:399 ../doc\strings.py:402
|
||||||
#: ../doc\strings.py:405 ../doc\strings.py:421 ../doc\strings.py:424
|
#: ../doc\strings.py:405 ../doc\strings.py:423 ../doc\strings.py:426
|
||||||
msgid ""
|
msgid ""
|
||||||
"\n"
|
"\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -361,7 +361,7 @@ msgid "* Global settings: Opens a dialogue which lets you configure settings for
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:166
|
#: ../doc\strings.py:166
|
||||||
msgid "* Quit: asks whether you want to exit the program. If the answer is yes, it closes the application. If you do not want to be asked for confirmation before exiting, uncheck the checkbox from the global settings dialogue box."
|
msgid "* Exit: asks whether you want to exit the program. If the answer is yes, it closes the application. If you do not want to be asked for confirmation before exiting, uncheck the checkbox from the global settings dialogue box."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:169
|
#: ../doc\strings.py:169
|
||||||
@@ -973,7 +973,7 @@ msgid "* English: [Bryner Villalobos](https://twitter.com/Bry_StarkCR) and [Bill
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:408
|
#: ../doc\strings.py:408
|
||||||
msgid "* Arabic: Mohammed Al Shara."
|
msgid "* Arabic: [Mohammed Al Shara](https://twitter.com/mohammed0204)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:409
|
#: ../doc\strings.py:409
|
||||||
@@ -989,11 +989,11 @@ msgid "* Basque: [Sukil Etxenike](https://twitter.com/sukil2011)."
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:412
|
#: ../doc\strings.py:412
|
||||||
msgid "* Finnish: Jani Kinnunen."
|
msgid "* Finnish: [Jani Kinnunen](https://twitter.com/jani_kinnunen)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:413
|
#: ../doc\strings.py:413
|
||||||
msgid "* French: R\303\251mi Ruiz."
|
msgid "* French: [R\303\251mi Ruiz](https://twitter.com/blindhelp38)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:414
|
#: ../doc\strings.py:414
|
||||||
@@ -1001,38 +1001,46 @@ msgid "* Galician: [Alba Kinteiro](https://twitter.com/albasmileforeve)."
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:415
|
#: ../doc\strings.py:415
|
||||||
msgid "* German: Steffen Schultz."
|
msgid "* German: [Steffen Schultz](https://twitter.com/schulle4u)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:416
|
#: ../doc\strings.py:416
|
||||||
msgid "* Hungarian: Robert Osztolykan."
|
msgid "* Croatian: [Zvonimir Stane\304\215i\304\207](https://twitter.com/zvonimirek222)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:417
|
#: ../doc\strings.py:417
|
||||||
msgid "* Polish: Pawel Masarczyk."
|
msgid "* Hungarian: Robert Osztolykan."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:418
|
#: ../doc\strings.py:418
|
||||||
msgid "* Portuguese: Odenilton J\303\272nior Santos."
|
msgid "* Italian: [Christian Leo Mameli](https://twitter.com/llajta2012)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:419
|
#: ../doc\strings.py:419
|
||||||
msgid "* Russian: Alexander Jaszyn."
|
msgid "* Polish: Pawel Masarczyk."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:420
|
#: ../doc\strings.py:420
|
||||||
msgid "* Turkish: Burak."
|
msgid "* Portuguese: Odenilton J\303\272nior Santos."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:423
|
#: ../doc\strings.py:421
|
||||||
|
msgid "* Russian: [\320\220\320\273\320\265\320\272\321\201\320\260\320\275\320\264\321\200 \320\257\321\210\320\270\320\275](https://twitter.com/radovest)."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../doc\strings.py:422
|
||||||
|
msgid "* Turkish: [Burak Y\303\274ksek](https://twitter.com/burakyuksek)."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ../doc\strings.py:425
|
||||||
msgid "Many thanks also to the people who worked on the documentation. Initially, [Manuel Cortez](https://twitter.com/manuelcortez00) did the documentation in Spanish, and translated to English by [Bryner Villalobos](https://twitter.com/Bry_StarkCR), [Robert Spangler](https://twitter.com/glasscity1837), [Sussan Rey](https://twitter.com/sussanrey17), [Anibal Hernandez](https://twitter.com/anibalmetal), and [Holly Scott-Gardner](https://twitter.com/holly1994). It was updated by [Sukil Etxenike](https://twitter.com/sukil2011), with some valuable corrections by [Brian Hartgen](https://twitter.com/brianhartgen) and [Bill Dengler](https://twitter.com/codeofdusk)."
|
msgid "Many thanks also to the people who worked on the documentation. Initially, [Manuel Cortez](https://twitter.com/manuelcortez00) did the documentation in Spanish, and translated to English by [Bryner Villalobos](https://twitter.com/Bry_StarkCR), [Robert Spangler](https://twitter.com/glasscity1837), [Sussan Rey](https://twitter.com/sussanrey17), [Anibal Hernandez](https://twitter.com/anibalmetal), and [Holly Scott-Gardner](https://twitter.com/holly1994). It was updated by [Sukil Etxenike](https://twitter.com/sukil2011), with some valuable corrections by [Brian Hartgen](https://twitter.com/brianhartgen) and [Bill Dengler](https://twitter.com/codeofdusk)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:426
|
#: ../doc\strings.py:428
|
||||||
msgid "---"
|
msgid "---"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../doc\strings.py:427
|
#: ../doc\strings.py:429
|
||||||
msgid "Copyright \302\251 2013-2015. Manuel Cort\303\251z"
|
msgid "Copyright \302\251 2013-2015. Manuel Cort\303\251z"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
1654
tools/twblue.pot
1654
tools/twblue.pot
File diff suppressed because it is too large
Load Diff
Submodule windows-dependencies updated: 0f65f42c9f...4d106f04f7
Reference in New Issue
Block a user