Compare commits

..

106 Commits

Author SHA1 Message Date
7d7a9d72c4 Fixed update file 2023-02-03 12:18:12 -06:00
fcfbae4964 Fixed important issue on updater 2023-02-03 12:16:31 -06:00
aca51a2fb9 Mastodon: Fixed minor issue on notifications handler for streaming API 2023-02-03 11:31:57 -06:00
b4ea6ffcbe Prepare new version release 2023-02-03 10:37:18 -06:00
f69af7aaa1 Twitter: Stop supporting Twitter sessions starting on february 9 2023-02-03 10:29:21 -06:00
a8c5fc8589 Mastodon: Fixed getting more mentions. Closes #508 2023-02-03 10:13:08 -06:00
f87ced817f Fixed visibility setting for replies to dm's. Closes #507 2023-01-29 16:12:37 -06:00
3be01013f4 Mastodon: Use TWBlue user agent, check streaming API health before starting streaming session 2023-01-29 14:34:36 -06:00
fd176f92d3 Mastodon: Set visibility in replies as unlisted by default. Closes #504 2023-01-29 13:11:34 -06:00
97d4fea563 Merge branch 'weblate-twblue-twblue' into 'next-gen'
Translations update from Translations hub

See merge request twblue/twblue!15
2023-01-29 18:51:36 +00:00
b35f2e0fed Translations update from Translations hub 2023-01-29 18:51:35 +00:00
b3851cde95 Updated changelog 2023-01-29 11:55:45 -06:00
4b232d527c Mastodon: Added status updates for subscribed entities to notifications 2023-01-29 11:39:52 -06:00
12b4c8ac23 Merge branch 'next-gen' of github.com:mcv-software/twblue into next-gen 2023-01-05 17:22:22 -06:00
d89c5150f8 Merge branch 'next-gen' of gitlab.mcvsoftware.com:twblue/twblue into next-gen 2023-01-05 17:21:50 -06:00
d17e9ecdac Merge branch 'weblate-twblue-twblue' into 'next-gen'
Translations update from Translations hub

See merge request twblue/twblue!14
2023-01-05 23:21:06 +00:00
76d0866780 Mastodon: TWBlue should be able to ignore sessions if there are errors attempting to log-in 2023-01-05 17:16:34 -06:00
Corentin Bacqué-Cazenave
706616717e Translated using Weblate (French)
Currently translated at 100.0% (941 of 941 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/fr/
2023-01-02 16:39:56 -06:00
7c47d6171a Merge pull request #505 from Mohamed00/NewShortcuts
Mastodon: added new keyboard shortcuts
2022-12-29 13:47:54 -06:00
Mohamed
b743d7af09 Mastodon: added keyboard shortcuts for visibility combo box and sensitive content checkbox 2022-12-29 04:17:58 -05:00
d4219f1705 Merge branch 'weblate-twblue-twblue' into 'next-gen'
Translations update from Translations hub

See merge request twblue/twblue!13
2022-12-26 03:26:06 +00:00
Corentin Bacqué-Cazenave
e25d007149 Translated using Weblate (French)
Currently translated at 100.0% (941 of 941 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/fr/
2022-12-25 11:39:54 -06:00
Nikola Jović
fcb8edbda2 Added translation using Weblate (Serbian) 2022-12-23 13:58:43 -06:00
Nikola Jović
a6ca588115 Translated using Weblate (Serbian)
Currently translated at 100.0% (941 of 941 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/sr/
2022-12-23 13:58:43 -06:00
18a7a42b5a Mastodon: Started implementation of read preferences from instance. Currently only content warnings are displayed by taking into accounts values from instance preferences 2022-12-23 13:58:10 -06:00
460cea702b code: updated readme 2022-12-22 11:39:29 -06:00
b14c77b730 Merge branch 'next-gen' of gitlab.mcvsoftware.com:twblue/twblue into next-gen 2022-12-22 11:38:48 -06:00
1e5c7512e4 Merge branch 'weblate-twblue-twblue' into 'next-gen'
Translations update from Translations hub

See merge request twblue/twblue!12
2022-12-22 14:42:48 +00:00
d76dbe318c Merge pull request #503 from CoBC/tr_quote_from
Allow translation of templates text
2022-12-21 11:01:57 -06:00
Nikola Jović
4d4901b029 Translated using Weblate (Serbian)
Currently translated at 95.2% (896 of 941 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/sr/
2022-12-21 10:54:17 -06:00
Corentin Bacqué-Cazenave
07128d2e4a Add missing parenthesis 2022-12-21 17:36:05 +01:00
c45ba5e705 Translated using Weblate (Spanish)
Currently translated at 92.2% (284 of 308 strings)

Translation: TWBlue/changelog
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/changelog/es/
2022-12-21 10:24:59 -06:00
Nikola Jović
795cb33efc Translated using Weblate (Serbian)
Currently translated at 89.4% (842 of 941 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/sr/
2022-12-21 10:24:59 -06:00
98bcb9d279 Translated using Weblate (Spanish)
Currently translated at 99.8% (940 of 941 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/es/
2022-12-21 10:24:59 -06:00
Corentin Bacqué-Cazenave
06cbe0a3b5 Translated using Weblate (French)
Currently translated at 100.0% (941 of 941 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/fr/
2022-12-21 10:24:59 -06:00
e4f2793aaf Core: Update 'tweet' menu on the menu bar for mastodon sessions 2022-12-21 10:24:44 -06:00
43ae43ce26 core: Fix issues when removing sessions 2022-12-21 10:23:18 -06:00
Corentin Bacqué-Cazenave
7082a5f3ec Translate templates text 2022-12-21 17:21:10 +01:00
c278fba4c7 Code: Delete unneeded code & fixed some typos 2022-12-21 08:45:14 -06:00
cfc8221825 Merge branch 'weblate-twblue-twblue' into 'next-gen'
Translations update from Translations hub

See merge request twblue/twblue!11
2022-12-21 14:23:34 +00:00
Weblate
32c1ed225e Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: TWBlue/changelog
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/changelog/
2022-12-20 17:19:37 -06:00
Weblate
d3b15fcefa Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/
2022-12-20 17:19:36 -06:00
7ec96c47d6 Code: Updated documentation translation catalogs 2022-12-20 17:19:18 -06:00
97812ec8b0 Code: Removed uneeded scripts 2022-12-20 17:13:58 -06:00
d1ca3c9fb2 Fixed merge conflict 2022-12-20 16:52:57 -06:00
Anonymous
492352bc27 Translated using Weblate (Finnish)
Currently translated at 86.3% (687 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/fi/
2022-12-20 16:43:48 -06:00
Anonymous
6328c252f7 Translated using Weblate (Hungarian)
Currently translated at 62.8% (500 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/hu/
2022-12-20 16:43:45 -06:00
Anonymous
e1a46f338a Translated using Weblate (French)
Currently translated at 100.0% (796 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/fr/
2022-12-20 16:43:41 -06:00
Corentin Bacqué-Cazenave
f7e09a05b2 Translated using Weblate (French)
Currently translated at 100.0% (796 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/fr/
2022-12-20 16:43:38 -06:00
Anonymous
c7116916ba Translated using Weblate (Serbian)
Currently translated at 98.1% (781 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/sr/
2022-12-20 16:43:36 -06:00
Anonymous
f1fbe858e9 Translated using Weblate (Polish)
Currently translated at 86.3% (687 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/pl/
2022-12-20 16:43:32 -06:00
Riku
fc5a1060be Translated using Weblate (Japanese)
Currently translated at 100.0% (796 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/ja/
2022-12-20 16:43:29 -06:00
Anonymous
5951276033 Translated using Weblate (Japanese)
Currently translated at 100.0% (796 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/ja/
2022-12-20 16:43:28 -06:00
Anonymous
2d761c423f Translated using Weblate (Mongolian)
Currently translated at 45.1% (359 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/mn/
2022-12-20 16:43:24 -06:00
Anonymous
434e2878a7 Translated using Weblate (Russian)
Currently translated at 86.3% (687 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/ru/
2022-12-20 16:43:20 -06:00
Anonymous
89cdba5910 Translated using Weblate (Hebrew (Israel))
Currently translated at 10.1% (81 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/he_IL/
2022-12-20 16:43:16 -06:00
Anonymous
e9a885784f Translated using Weblate (Galician)
Currently translated at 86.3% (687 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/gl/
2022-12-20 16:43:12 -06:00
Anonymous
3a968e49aa Translated using Weblate (Catalan)
Currently translated at 86.3% (687 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/ca/
2022-12-20 16:43:09 -06:00
Anonymous
c6417962a9 Translated using Weblate (Portuguese)
Currently translated at 90.5% (721 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/pt/
2022-12-20 16:43:05 -06:00
Jonas S. Marques
2f55eca575 Translated using Weblate (Portuguese)
Currently translated at 90.5% (721 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/pt/
2022-12-20 16:43:01 -06:00
Anonymous
1cd66e7f10 Translated using Weblate (Arabic)
Currently translated at 79.0% (629 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/ar/
2022-12-20 16:42:59 -06:00
Anonymous
0ddb4e6f32 Translated using Weblate (Croatian)
Currently translated at 95.6% (761 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/hr/
2022-12-20 16:42:55 -06:00
zvonimir stanecic
39aac0a3e7 Translated using Weblate (Croatian)
Currently translated at 95.6% (761 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/hr/
2022-12-20 16:42:52 -06:00
Anonymous
45ab6d953b Translated using Weblate (Italian)
Currently translated at 83.5% (665 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/it/
2022-12-20 16:42:49 -06:00
Anonymous
fdd0d566ad Translated using Weblate (Basque)
Currently translated at 81.2% (647 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/eu/
2022-12-20 16:42:46 -06:00
Anonymous
c606fedda5 Translated using Weblate (Spanish)
Currently translated at 100.0% (796 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/es/
2022-12-20 16:42:42 -06:00
9b0ecdf928 Translated using Weblate (Spanish)
Currently translated at 100.0% (796 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/es/
2022-12-20 16:42:39 -06:00
Anonymous
f5e1ff39be Translated using Weblate (German)
Currently translated at 100.0% (796 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/de/
2022-12-20 16:42:37 -06:00
Steffen Schultz
5dff35fd02 Translated using Weblate (German)
Currently translated at 100.0% (796 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/de/
2022-12-20 16:42:34 -06:00
Anonymous
a5104fd76a Translated using Weblate (Turkish)
Currently translated at 86.3% (687 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/tr/
2022-12-20 16:42:32 -06:00
Anonymous
423b63e486 Translated using Weblate (Romanian)
Currently translated at 86.3% (687 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/ro/
2022-12-20 16:42:28 -06:00
Anonymous
25c6db7dd8 Translated using Weblate (Danish)
Currently translated at 86.3% (687 of 796 strings)

Translation: TWBlue/TWBlue
Translate-URL: https://weblate.mcvsoftware.com/projects/twblue/twblue/da/
2022-12-20 16:42:25 -06:00
ca40103df7 Core: Keystroke editor will show actions available for current session. Changed wording to use correct terms forh both networks 2022-12-20 13:02:27 -06:00
250b248d25 Core: Update menu bar items when switching between Twitter and Mastodon session to use terms according to the focused network. 2022-12-20 12:21:30 -06:00
efd11b90fb Merge branch 'new-documentation' into next-gen 2022-12-20 09:49:33 -06:00
2a90e7be25 Mastodon: Fixed an issue that prevented TWBlue to open a timeline for users in followers or following buffer. 2022-12-19 17:53:10 -06:00
32a86f1bb4 Core: Updated changelog 2022-12-19 17:34:28 -06:00
b0fa59cc01 Mastodon: Show dialog before dismissing a notification. Mention notifications will make the mention to not be loaded in mentions buffer, as TWBlue reads mentions from the notifications data 2022-12-19 16:50:43 -06:00
b8647c29ea Mastodon: Dismiss notifications from GUI or invisible interface (by using the keystroke to delete an item in current buffer) 2022-12-19 16:21:50 -06:00
1eb9aefbf1 Mastodon: Added notifications in real time from streaming API 2022-12-19 16:07:45 -06:00
d4ebfac317 Core: Skip sessions not yet started when switching accounts in invisible interface 2022-12-19 08:45:05 -06:00
3680349b59 Mastodon: Fix issue when creating user timelines during startup 2022-12-19 02:41:19 -06:00
ec68c7ccae Mastodon: Added initial implementation for notifications buffer (actions not available yet) 2022-12-14 12:12:05 -06:00
4bf155b421 Mastodon: Added compose function for notifications 2022-12-14 12:09:14 -06:00
e63479a261 Mastodon: Add line breaks when new paragraphs are present on posts content 2022-12-14 12:08:02 -06:00
ae0dcc7b21 Generate all versions properly 2022-12-13 15:56:01 -06:00
11b6669bf6 Started to rebuild TWBlue's documentation 2022-12-13 15:46:39 -06:00
3adc726f33 Handle properly a psutil exception. Closes #501 2022-12-13 11:16:10 -06:00
a3bc684721 Mastodon: Added reverse timeline ordering to buffers 2022-12-10 18:52:07 -06:00
ffbb67765d Replaced check_pid to use psutil as opposed to deal directly with win32 API 2022-12-10 18:29:59 -06:00
b57a430dc5 Bring back support for Windows 7 on 32-bit portable variant 2022-12-09 16:41:18 -06:00
0f04cfabf9 Fixed small typo on win7 version 2022-12-09 13:27:36 -06:00
3b29cbd746 Ensure python 3.7 installs wxpython for 32 bits 2022-12-09 13:19:54 -06:00
730665b5da fixed a typo 2022-12-09 13:03:37 -06:00
924cc83090 Modified CI for an experiment with Window 7 versions 2022-12-09 12:55:58 -06:00
4d46bab37f Remove fixes for libloader and win32com 2022-12-09 12:36:00 -06:00
a5e075a215 Replace httpcore submodule to fix an issue with googletrans 2022-12-09 12:35:26 -06:00
c9b75925b9 Removed unneeded code 2022-12-08 16:11:25 -06:00
3450e0d38f twitter: Fixed reply keystroke not working on dm buffer 2022-12-08 11:48:04 -06:00
ca83604870 Updated changelog 2022-12-08 11:38:17 -06:00
35b758ecf1 mastodon: Added account settings dialog (except autocompletion settings) 2022-12-08 11:14:14 -06:00
d5ed5f12af mastodon: Added missing settings in config file 2022-12-08 11:10:06 -06:00
eedcb49f3d Mastodon: Added template editor 2022-12-08 11:07:44 -06:00
a1878f10b3 Fixed dm ordering issue 2022-12-06 13:31:09 -06:00
2323c3cac5 Include mastodon default config file on builds 2022-12-06 10:06:27 -06:00
e90c370e73 Add secrets on build stages 2022-12-06 09:12:09 -06:00
115 changed files with 65246 additions and 35771 deletions

View File

@@ -1,6 +1,7 @@
variables:
GIT_SUBMODULE_STRATEGY: recursive
PYTHON: "C:\\python310\\python.exe"
PYTHON37: "C:\\python37\\python.exe" # for Windows 7 support.
NSIS: "C:\\program files (x86)\\nsis\\makensis.exe"
stages:
@@ -31,6 +32,7 @@ twblue32:
- cd ..\src
- '&$env:PYTHON ..\doc\generator.py'
- '&$env:PYTHON write_version_data.py'
- New-Item "appkeys.py" -ItemType File -Value "twitter_api_key='$TWITTER_API_KEY'`ntwitter_api_secret='$TWITTER_API_SECRET'"
- '&$env:PYTHON setup.py build'
- cd ..
- mkdir artifacts
@@ -70,6 +72,7 @@ twblue64:
- cd ..\src
- '&$env:PYTHON ..\doc\generator.py'
- '&$env:PYTHON write_version_data.py'
- New-Item "appkeys.py" -ItemType File -Value "twitter_api_key='$TWITTER_API_KEY'`ntwitter_api_secret='$TWITTER_API_SECRET'"
- '&$env:PYTHON setup.py build'
- cd ..
- mkdir artifacts
@@ -85,6 +88,44 @@ twblue64:
- artifacts
expire_in: 1 day
twblueWin7:
tags:
- shared-windows
- windows
- windows-1809
before_script:
- Set-Variable -Name "time" -Value (date -Format "%H:%m")
- echo ${time}
- echo "started by ${GITLAB_USER_NAME}"
- choco install python --version 3.7.9 -y -ForceX86
- '&$env:PYTHON37 -V'
- '&$env:PYTHON37 -m pip install --upgrade pip'
- '&$env:PYTHON37 -m pip install --upgrade https://github.com/josephsl/wxpy32whl/blob/main/wxPython-4.2.0-cp37-cp37m-win32.whl?raw=true'
- '&$env:PYTHON37 -m pip install --upgrade -r requirements.txt'
stage: build
interruptible: true
script:
# Create html documentation firstly.
- cd doc
- '&$env:PYTHON37 documentation_importer.py'
- cd ..\src
- '&$env:PYTHON37 ..\doc\generator.py'
- '&$env:PYTHON37 write_version_data.py'
- New-Item "appkeys.py" -ItemType File -Value "twitter_api_key='$TWITTER_API_KEY'`ntwitter_api_secret='$TWITTER_API_SECRET'"
- '&$env:PYTHON37 setup.py build'
- cd ..
- mkdir artifacts
- cd scripts
- '&$env:PYTHON37 make_archive.py'
- cd ..
- move src/twblue.zip artifacts/twblue_windows7_x86.zip
only:
- tags
artifacts:
paths:
- artifacts
expire_in: 1 day
generate_versions:
stage: make_installer
tags:

View File

@@ -1,21 +1,11 @@
TWBlue -
TWBlue
======
[![Build status](https://ci.appveyor.com/api/projects/status/fml5fu7h1fj8vf6l?svg=true)](https://ci.appveyor.com/project/manuelcortez/twblue)
TW Blue is an app designed to use Twitter simply and efficiently while using minimal system resources.
With this app youll have access to twitter features such as:
TWBlue is a free and open source application that allows you to interact with the main features of Twitter and mastodon from the comfort of a windows software, with 2 different interfaces specially designed for screen reader users.
* Create, reply to, like, retweet and delete tweets,
* Send and delete direct messages,
* See your friends and followers,
* Follow, unfollow, block and report users as spam,
* Open a users timeline, which will allow you to get that users tweets separately,
* Open URLs when attached to a tweet or direct message,
* Play audio tweets
* and more!
See [TWBlue's webpage](http://twblue.es) for more details.
See [TWBlue's webpage](https://twblue.es) for more details.
## Running TWBlue from source
@@ -83,15 +73,7 @@ This dependency has been built using pure basic 4.61. Its source can be found at
* [NSIS,](http://nsis.sourceforge.net/) version 3.04
#### Dependencies required to build the portableApps.com format archive
* [NSIS Portable,](http://portableapps.com/apps/development/nsis_portable) version 3.03
* [PortableApps.com Launcher,](http://portableapps.com/apps/development/portableapps.com_launcher) version 2.2.1
* [PortableApps.com Installer,](http://portableapps.com/apps/development/portableapps.com_installer) version 3.5.11
Important! Install these 3 apps into the same folder, otherwise you won't be able to build the pa.c version. For example: D:\portableApps\NSISPortable, D:\PortableApps\PortableApps.com installer, ...
#### Dependencies to make the spell checker multilingual ####
#### Dependencies to make the spell checker multilingual
In order to add the support for spell checking in more languages than english you need to add some additional dictionaries to pyenchant. These are located on the dictionaries folder under windows-dependencies. Simply copy them to the share/enchant/myspell folder located in your enchant installation. They will be automatically copied when building a binary version.
@@ -136,16 +118,8 @@ If you want to install TWBlue on your computer, you must create the installer fi
### 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.
To manage translations in TWBlue, you can install the [Babel package.](https://pypi.org/project/Babel/) You can extract message catalogs and generate the main template file with the following command:
### How to build the portableApps.com archive
If you want to have TWBlue on your PortableApps.com platform, follow these steps:
* Navigate to the src directory, and create a binary version for x86: C:\python37\python setup.py build
* Move the dist directory to the misc\pa.c format\app folder in this repo, and rename it to twblue
* Repeat these steps with Python for x64: C:\python37x64\python setup.py build
* Move the new dist directory to the misc\pa.c format\app folder, and rename it to twblue64
* Run the PortableApps.com Launcher Generator, and follow the wizard. Choose the pa.c format folder and continue to generate the launcher. If the wizard is completed, you will see a file named TWBlue portable.exe inside the pa.c format folder.
* Run the PortableApps.com Installer, and follow the wizard. As in the above step, choose the pa.c format folder. When it completes, you will see a file named TWBluePortable_x.y.paf.exe inside the misc folder, where x.y is the version number.
pybabel extract -o twblue.pot --msgid-bugs-address "manuel@manuelcortez.net" --copyright-holder "MCV software" --input-dirs ..\src
Take into account, though, that we use [weblate](https://weblate.mcvsoftware.com) to track translation work for TWBlue. If you wish to be part of our translation team, please open an issue so we can create an account for you in Weblate.

View File

@@ -2,6 +2,41 @@ TWBlue Changelog
## changes in this version
In this version, TWBlue will no longer support Twitter sessions starting on February 9, due to Twitter's policies prohibiting third-party clients, in addition to the shutdown of the free access to the Twitter API. All Twitter sessions that are active on TWBlue will stop working as of February 9, when the free API access will finally be shut down. It will not be possible to display or add Twitter sessions from the Session manager. From the TWBlue team, we will continue working to improve our support for Mastodon instances and add other social networks in the near future. If you want to keep in touch with the project, you can follow us in our mastodon account, at [@twblue@maaw.social.](https://maaw.social/@twblue)
* In the graphical interface, TWBlue will update menu items, in the menu bar, depending on whether you are focusing a Twitter or Mastodon session. This makes it possible for TWBlue to display the correct terms in each social network. Take into account that there might be unavailable items for the currently active session.
* in the keystroke editor for the invisible interface, TWBlue displays the available shortcuts for the currently active session. Descriptions of those keystrokes are also different for Twitter and mastodon sessions to use correct terms for both networks.
* In the invisible interface, TWBlue will skip sessions that have not been started when using the keyboard shortcut to switch between different accounts.
* Fixed a bug when deleting a session in the session manager dialog. Sessions can now be deleted correctly.
* Mastodon:
* Added basic support to notifications buffer. This buffer shows mastodon notifications in real time. Every notification is attached to a kind of object (posts, users, relationships or polls). At the moment, the only supported action for notification is dismissing, which allows you to remove the notification from the buffer (take into account, though, that mention notifications will remove also the mention in its corresponding buffer, due to the way TWBlue reads mentions from mastodon instances).
* Fixed an issue that was preventing TWBlue to create more than one user timeline during startup.
* Fixed getting more items in mentions buffer. ([#508](https://github.com/mcv-software/twblue/issues/508))
* TWBlue will display properly new paragraphs in mastodon posts.
* In the session manager, Mastodon sessions are now displayed including the instance to avoid confusion.
* TWBlue will now read default visibility preferences when posting new statuses, and display sensitive content. These preferences can be set on the mastodon instance, in the account's preferences section. If you wish to change TWBlue's behavior and have it not read those preferences from your instance, but instead set the default public visibility and hide sensitive content, you can uncheck the Read preferences from instance checkbox in the account options.
* If a mastodon instance is not active or there are errors during login, TWBlue will report it in the log file and will continue with other sessions.
* When replying to someone in a public post, TWBlue will default to "unlisted" as its visibility setting. This is done so replies will not clutter local and federated timelines. This setting might be changed when writing the reply, though. ([#504,](https://github.com/MCV-Software/TWBlue/issues/504))
* TWBlue uses its own user agent in Mastodon sessions, so it will be easier to identify the client for instance admins.
* TWBlue will check if the streaming API endpoints are available before attempting to start Streaming for the current session. Before, TWBlue caused load issues in misconfigured mastodon instances where the streaming API were not available.
## Changes in version 2022.12.13
* per popular request, We will generate a 32-bit portable version of TWBlue available for Windows 7 operating systems. This version will not be supported in our automatic updater, so in case of using such version, you would need to download it manually every time there is a new update. TWBlue will continue to be available for Windows 7 as long as it is possible to build it using Python 3.7.
* Fixed a couple of bugs that were making TWBlue unable to be opened in some computers, related to our translator module and some COM objects handled incorrectly.
* Fixed an issue that was making TWBlue unable to open in certain computers due to errors related to Win32 API'S.
* Twitter:
* Fixed a bug that was making sent direct messages to be placed in received direct messages buffer.
* When quoting a tweet, you can use all 280 characters to send your quoted tweet, as opposed to the 256 characters TWBlue allowed before.
* Fixed a bug that was making TWBlue unable to reply to direct messages by using the "reply" keystroke.
* Mastodon:
* Added account settings dialog.
* Added template editing functionality for mastodon accounts.
* When a post is edited, TWBlue will update the post object in the buffer to reflect the latest edit.
* Fixed a small issue that was preventing TWBlue to display some posts in their corresponding dialog.
## Changes in version 2022.12.6
Most of all changes in this release are focused on adding Mastodon support to TWBlue. The features present to handle Twitter should not have been altered in any way. We were not intended to release this version so soon, but unfortunately, Twitter started to present issues in some regions with one particular API endpoint we were using, making impossible for everyone in such regions to use the application. We will release more updates to fix any possible issue regarding Twitter API, but please take into account that this is sometimes an issue happening in Twitter's servers and while we do our best to make TWBlue work despite those problems, you might encounter glitches from time to time.
* TWBlue now builds with Python 3.10.8. ([#493](https://github.com/MCV-Software/TWBlue/issues/493))

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

20
documentation/Makefile Normal file
View File

@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

35
documentation/make.bat Normal file
View File

@@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
if "%1" == "" goto help
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

View File

@@ -0,0 +1,31 @@
Basic concepts
----------------------
Before starting to describe TWBlue's usage, we'll explain some concepts that will be used extensively throughout this manual.
Session
++++++
A session is an account set up on a service. When you authorize TWBlue to use any of your social network accounts, a session will be created in the application. In this session, TWBlue creates buffers that allow you to display different types of items present in the social network. TWBlue allows you to have any number of sessions authorized and started. You can have TWBlue automatically start all your sessions, which is the default setting, although it is also possible to make certain sessions not start when you open the application.
Buffer
++++++
A buffer is a list of items that come from your configured account, after being processed by TWBlue. TWBlue will create buffers with different types of items. For example, your posts sent on a social network, or your private messages with other users. You can perform certain actions on each of these elements depending on the type of buffer you are focusing.
Graphical user Interface (GUI)
+++++++++++++++++++++++++++++++++
TWBlue has two different interfaces: The graphical user interface (GUI) and the invisible interface. The GUI allows you to interact with the application through a window containing two important elements: A menu bar, which can be accessed by pressing the Alt key, and the list of sessions, buffers and available actions for them, which you can access by pressing the Tab key.
The list of sessions and buffers is grouped in a tree view, where sessions are located at the root level and each session contains the buffers that belong to it. When you select one of these buffers, you can access the list of items it contains by using the Tab key. Depending on the selected buffer, you can find, also with the Tab key, a list of buttons representing actions you can perform on the session (such as posting a message on the social network) or on the focused item.
Invisible interface
++++++++++++++++++
The invisible interface, as its name suggests, has no graphical window and works directly with screen readers such as JAWS for Windows, NVDA and System Access through keyboard shortcuts that you can use in any window. This interface is disabled by default, but you can enable it by pressing Control + M, which will hide the TWBlue window. If you use other applications to manage Twitter, such as The Qube and chicken Nugget, TWBlue includes support for keymaps for these clients, which you can configure from the global options dialog. It is also possible to use the invisible interface from TWBlue's graphical window, although this option can be disabled to avoid conflicting with other applications that require the keyboard shortcuts globally.
Global settings and session settings
++++++++++++++++++++++++++++++++++++++++++++++
TWBlue has two different configuration dialogs: the global configuration dialog, which affects how TWBlue works for all sessions, and the session configuration dialog, which only affects how the current session works. You will find specific information about the session settings dialog for Twitter and Mastodon in its corresponding chapter in this guide.

View File

@@ -0,0 +1,390 @@
TWBlue Changelog
===========================
Changes in this version
+++++++++++++++++++++++++
* per popular request, We will generate a 32-bit portable version of TWBlue available for Windows 7 operating systems. This version will not be supported in our automatic updater, so in case of using such version, you would need to download it manually every time there is a new update. TWBlue will continue to be available for Windows 7 as long as it is possible to build it using Python 3.7.
* Fixed a couple of bugs that were making TWBlue unable to be opened in some computers, related to our translator module and some COM objects handled incorrectly.
* Fixed an issue that was making TWBlue unable to open in certain computers due to errors related to Win32 API'S.
* Twitter:
* Fixed a bug that was making sent direct messages to be placed in received direct messages buffer.
* When quoting a tweet, you can use all 280 characters to send your quoted tweet, as opposed to the 256 characters TWBlue allowed before.
* Fixed a bug that was making TWBlue unable to reply to direct messages by using the "reply" keystroke.
* Mastodon:
* Added account settings dialog.
* Added template editing functionality for mastodon accounts.
* When a post is edited, TWBlue will update the post object in the buffer to reflect the latest edit.
* Fixed a small issue that was preventing TWBlue to display some posts in their corresponding dialog.
Version 2022.12.6
-----------------
Most of all changes in this release are focused on adding Mastodon support to TWBlue. The features present to handle Twitter should not have been altered in any way. We were not intended to release this version so soon, but unfortunately, Twitter started to present issues in some regions with one particular API endpoint we were using, making impossible for everyone in such regions to use the application. We will release more updates to fix any possible issue regarding Twitter API, but please take into account that this is sometimes an issue happening in Twitter's servers and while we do our best to make TWBlue work despite those problems, you might encounter glitches from time to time.
* TWBlue now builds with Python 3.10.8. (`#493 <https://github.com/MCV-Software/TWBlue/issues/493>`_)
* This change also drops support for Windows 7.
* The TWBlue interface has not been translated yet, as we are releasing this update to fix an important Twitter issue for some regions.
* Twitter sessions should be able to be opened properly again in TWBlue, in regions where it didn't work since last week.
* It is now possible to log in to instances of mastodon, hometown and similar software (Pleroma should work as well, although it has not been tested at this time). From the session manager, clicking on the “new account” button will bring up a menu from which you can select whether you want to log in to Twitter or Mastodon. For instances that have a different character limit than the one set by Mastodon, TWBlue will detect the new limit and adjust the dialogs to allow you to use it correctly.
* Most of the TWBlue GUI has been adapted so that the buffers reflect the change of social network (in mastodon, for example, the buttons to write posts say post instead of tweet). However, the menu bar has not yet been updated. This means that most of the options still refer to Twitter, although they can be used with mastodon accounts. For example, if you select the “tweet” menu in the menu bar, and then select the “Retweet” option, TWBlue will actually do a “boost” if the buffer you are in is a Mastodon account buffer.
* Keystrokes for the invisible interface also refer to terms used in Twitter, but can be applied to Mastodon as well.
* There are some features, within TWBlue, that are not yet compatible with mastodon accounts. These are as follows:
* User autocompletion.
* Currently, it is not possible to update account settings for mastodon sessions. However, if you know how to edit configuration files, you can close TWBlue, change your session file with any text editor and restart the application to update what you want.
* The template editor is not yet available for mastodon accounts.
* Filters have not yet been implemented in TWBlue mastodon support.
* User aliases are not implemented yet.
* It is not possible to view a users profile, nor edit your own, for now. However, you can use the keystroke to open the item in the browser when focusing a user to access their profile website. This only works in buffers where users are listed.
* You cannot manage lists in TWBlue at the moment.
* Most of the buffers planned for mastodon should just work. Among those currently tested are: home (main timeline for the logged-in user), Local (public posts for the instance), federated (public posts for all federating instances), mentions, direct messages, sent posts, favorites, bookmarks, followers, following, blocked users, muted users, user searches and timelines for users.
* The difference between favorites and bookmarks is that the author of the post can see who has marked his posts as favorites, but bookmarks are completely private. In any buffer containing mastodon posts, except direct messages, the GUI will display an option to add the post to favorites or bookmarks.
* Direct messages in mastodon are posts, exactly like normal posts, but with their privacy setting set so that they can only be seen by the accounts that are mentioned. In the direct message buffer, a conversation will appear for each item in the buffer. The conversation represents a thread of messages, but TWBlue can only display the last of the messages sent. This is similar to what happens on platforms like Telegram, where you can only see the list of conversations at the beginning. To see the entire thread of direct messages present in a conversation, you can use the command to open the conversation, or go to the “tweet” menu in the menu bar, and then towards the “view conversation” option. This will create a new conversation buffer that will be located just after the direct messages buffer (for the GUI, the buffer will be located just inside the direct messages buffer in the buffer tree). When a private post appears (whose visibility only allows the mentioned accounts to see it), TWBlue will display that post in the home buffer, in mentions and also will update/create the conversation with that item. This is because Mastodon does not differentiate between a private message and a normal post. You can reply to the post in any buffer to continue the conversation. If you reply to any post, the privacy set in the original post is maintained by default, but can also be changed.
* The buffer showing the federated timeline has been disabled from settings. This is because on servers that federate with many instances it can load many posts in a very short time. To enable this buffer, for now, edit the TWBlue configuration while the application is closed, and add the “federated” buffer in the option called “buffer_order”. As soon as buffers can be shown or hidden, this process can be done through the GUI.
* There is a Streaming API that allows the elements for the start buffers, mentions, direct messages, sent posts and followers to appear in real time. This feature is implemented by default and should also just work.
* Timelines for users only allow to get all posts from users who are in the same instance. For users belonging to other instances, you can get the posts that have been downloaded to your instance since your instance “knows” the remote user.
* Timelines for followers and following can be fully retrieved only for users belonging to the same instance. Remote users may yield unclear results.
* You can search by users (by opening a search and selecting the “users” radio button). The search can be done by local users, such as twblue, or by remote users, such as @twblue@maaw.social.
* In all buffers, a maximum of 40 items are retrieved per load, but more can be retrieved by using the option to load more items in the buffer.
* In post buffers, you can do most of the actions already supported in TWBlue (boost, add/remove from favorites or bookmarks, reply, send message to user, open post URL, play audio or video, open post on web, view conversation, open action dialog for user).
* In user buffers, you can send private message to the user, and open user actions dialog, which in turn allows you to follow/unfollow, block/unblock and mute/unmute.
* When writing posts, it is possible to attach up to 4 images, 4 givs, or even a video, poll, or audio. It is also possible to add the “sensitive content” tag to posts, change privacy and write a content warning text. It is possible to create threads using the “add post” button.
* When replying to a post, TWBlue will place the username of all participants in the item you reply to. The privacy options will default to those of the original post.
Version 2022.8.28
------------------
* the user autocompletion feature has been completely rewritten to be easier to use, particularly for people with many followers/following users:
* In the account settings dialog, there's a button that opens up a new dialog that allows you to "scan" your account in order to add all users from your followers/following list. This process will read your data directly from Twitter and depending in the amount of people you have in your account it might take too many API calls. Please use it with caution. You can, for example, do the process separately for your followers/following people so it will be easier to handle, in case you have a massive amount of people. If TWBlue is unable to complete the scan, you will see an error and will be prompted to try again in 15 minutes, once your API calls have refreshed.
* It is possible to use the user autocompletion functionality in dialogs where you can select an user, for example when adding or removing someone from a list, or displaying lists for someone.
* Implemented a new setting, available in the account settings dialog, that allows to hide emojis in twitter usernames.
* TWBlue should be able to sort conversations in a more logical way. This should make it easier to follow a long thread in Twitter.
* When opening a thread, TWBlue should be able to load the right conversation if the original tweet from where the thread was loaded was a retweet.
* TWBlue will restart the Streaming subsystem every time there are changes to followed, muted or blocked users within the application.
* Fixed error when attempting to mention an user by using the "mention" button in any people buffer. Now tweets should be posted normally.
* Fixed error when loading other user lists. (`#465 <https://github.com/MCV-Software/TWBlue/issues/465>`_)
* Fixed an issue that was making TWBlue to display incorrectly some retweets of quoted tweets.
* If TWBlue is unable to open a timeline for someone who has blocked you, this will be reported in a dialog. (`#485, <https://github.com/mcv-software/twblue/issues/485>`_)
* Added "find a string in the currently focused buffer" action into Windows 10 and windows 11 keymap. (`#476 <https://github.com/MCV-Software/TWBlue/pull/476>`_)
Version 2022.2.23
--------------------
* We have added Experimental support for templates in the invisible interface. The GUI will remain unchanged for now:
* Each object (tweet, received direct message, sent direct message and people) has its own template in the settings. You can edit those templates from the account settings dialog, in the new "templates" tab.
* Every template is composed of the group of variables you want to display for each object. Each variable will start with a dollar sign ($) and cannot contain spaces or special characters. Templates can include arbitrary text that will not be processed. When editing the example templates, you can get an idea of the variables that are available for each object by using the template editing dialog. When you press enter on a variable from the list of available variables, it will be added to the template automatically. When you try to save a template, TWBlue will warn you if the template is incorrectly formatted or if it includes variables that do not exist in the information provided by objects. It is also possible to return to default values from the same dialog when editing a template.
* TWBlue can display image descriptions within Tweet templates. For that, you can use the $image_description variable in your template.
* We have restored conversation and threads support powered by Twitter API V2 thanks to a set of improvements we have done in the application, as well as more generous limits to Tweet monthly cap by Twitter.
* In the Windows 11 Keymap, the default shortcut to open the keystrokes editor is now CTRL+Alt+Windows+K to avoid conflicts with the new global mute microphone shortcut.
* TWBlue show display properly HTML entities in tweet's text.
* TWBlue should no longer load old tweets in buffers.
* Fixed issue when uploading attachments (images, videos or gif files) while sending tweets or replies.
* Fixed an error that was making TWBlue to ask for a restart after saving account settings, even if such restart was not required. (`#413, <https://github.com/manuelcortez/TWBlue/issues/413>`_)
Version 2021.11.12
------------------
* Now it is possible to create a tweet from a trending topics buffer again.
* TWBlue now includes a completely new set of dialogs to handle tweeting, replying and sending direct messages that take advantage of more Twitter features.
* It is possible to add videos in tweets and direct messages by using the new "add" button, located in every dialog where media can be added. Twitter suggests to add videos from 5 seconds up to 2 minutes lenght, in mp4 format (video Codec H.264 and audio codec AAC). Currently, TWBlue does not check if the uploaded video complies with Twitter media requirements. You can add only a video in a tweet or direct message. No other kind of media can be added after a video is in a tweet. If the video was unable to be uploaded successfully, the tweet or direct message won't be created.
* Now you can add a poll to tweets. Polls can have up to 4 different options and allow voting up to 7 days after being created. Take into account, though, that currently TWBlue does not support reading polls in tweets.
* TWBlue now support threads while creating a new tweet. There is a new button, called add tweet which will add the current tweet to the thread and will allow you to write another tweet in the thread. Every tweet might include media (up to 4 photos, or one GIF image or a video) or up to one poll.
* Some functionality was removed from tweet dialogs within TWBlue. Particularly, URL shorteners and long tweets via Twishort. You still can read long tweets posted via Twishort, though.
Version 2021.11.07
------------------
* TWBlue should retrieve tweets from threads and conversations in a more reliable way. Tweets in the same thread (made by the same author) will be sorted correctly, although replies to the thread (made by different people) may not be ordered in the same way they are displayed in Twitter apps. (`#417 <https://github.com/manuelcortez/TWBlue/issues/417>`_)
* When creating a filter, TWBlue will show an error if user has not provided a name for the filter. Before, unnamed filters were a cause of config breaks in the application.
* It is again possible to read the changelog for TWBlue from the help menu in the menu bar.
* fixed a bug when clearing the direct messages buffer. (`#418 <https://github.com/manuelcortez/TWBlue/issues/418>`_)
* fixed an issue that was making TWBlue to show incorrectly titles for trending topic buffers upon startup. (`#421 <https://github.com/manuelcortez/TWBlue/issues/421>`_)
* fixed an issue that was making users of the graphical user interface to delete a buffer if a trends buffer was opened in the same session.
* Updated Spanish, Japanese and french translations.
Version 2021.10.30
------------------
* Fixed many errors in the way we compile TWBlue, so users of 64 bits systems and particularly windows 7 users would be able to install TWBlue again. In case of issues with versions prior to 2021.10.30, please remove everything related to TWBlue (except configs) and reinstall the version 2021.10.30 to fix any possible error. This step won't be needed again in 23 months. (`#416, <https://github.com/manuelcortez/TWBlue/issues/416>`_, `#415, <https://github.com/manuelcortez/TWBlue/issues/415>`_)
* fixed an issue that was making impossible to manually add an user to the autocomplete users database.
* Started to improve support to conversations by searching for conversation_id.
Version 2021.10.27
------------------
* Added an user alias manager, located in the application menu in the menu bar. From this dialog, it is possible to review, add, edit or remove user aliases for the current account. (`#401 <https://github.com/manuelcortez/TWBlue/issues/401>`_)
* TWBlue now closes the VLC player window automatically when a video reaches its end. (`#399 <https://github.com/manuelcortez/TWBlue/issues/399>`_)
* After a lot of time, TWBlue now uses a new default Soundpack, called FreakyBlue. This soundpack will be set by default in all new sessions created in the application. Thanks to `Andre Louis <https://twitter.com/FreakyFwoof>`_ for the pack. (`#247 <https://github.com/manuelcortez/TWBlue/issues/247>`_)
* When reading a tweet, if the tweet contains more than 2 consecutive mentions, TWBlue will announce how many more users the tweet includes, as opposed to read every user in the conversation. You still can display the tweet to read all users.
* In the tweet displayer, It is possible to copy a link to the current tweet or person by pressing a button called "copy link to clipboard".
* Added a keymap capable to work under Windows 11. (`#391 <https://github.com/manuelcortez/TWBlue/pull/391>`_)
* Added user aliases to TWBlue. This feature allows you to rename user's display names on Twitter, so the next time you'll read an user it will be announced as you configured. For adding an alias to an user, select the "add alias" option in the user menu, located in the menu bar. This feature works only if you have set display screen names unchecked. Users are displayed with their display name in people buffers only. This action is supported in all keymaps, although it is undefined by default. (`#389 <https://github.com/manuelcortez/TWBlue/pull/389>`_)
* There are some changes to the autocomplete users feature:
* Now users can search for twitter screen names or display names in the database.
* It is possible to undefine keystrokes in the current keymap in TWBlue. This allows you, for example, to redefine keystrokes completely.
* We have changed our Geocoding service to the Nominatim API from OpenStreetMap. Addresses present in tweets are going to be determined by this service, as the Google Maps API now requires an API key. (`#390 <https://github.com/manuelcortez/TWBlue/issues/390>`_)
* Added a limited version of the Twitter's Streaming API: The Streaming API will work only for tweets, and will receive tweets only by people you follow. Protected users are not possible to be streamed. It is possible that during high tweet traffic, the Stream might get disconnected at times, but TWBlue should be capable of detecting this problem and reconnecting the stream again. (`#385 <https://github.com/manuelcortez/TWBlue/pull/385>`_)
* Fixed an issue that made TWBlue to not show a dialog when attempting to show a profile for a suspended user. (`#387 <https://github.com/manuelcortez/TWBlue/issues/387>`_)
* Added support for Twitter audio and videos: Tweets which contain audio or videos will be detected as audio items, and you can playback those with the regular command to play audios. (`#384, <https://github.com/manuelcortez/TWBlue/pull/384>`_)
* We just implemented some changes in the way TWBlue handles tweets in order to reduce its RAM memory usage (`#380 <https://github.com/manuelcortez/TWBlue/pull/380>`_):
* We reduced the tweets size by storing only the tweet fields we currently use. This should reduce tweet's size in memory for every object up to 75%.
* When using the cache database to store your tweets, there is a new setting present in the account settings dialog, in the general tab. This setting allows you to control whether TWBlue will load the whole database into memory (which is the current behaviour) or not.
* Loading the whole database into memory has the advantage of being extremely fast to access any element (for example when moving through tweets in a buffer), but it requires more memory as the tweet buffers grow up. This should, however, use less memory than before thanks to the optimizations performed in tweet objects. If you have a machine with enough memory, this should be a good option for your case.
* If you uncheck this setting, TWBlue will read the whole database from disk. This is significantly slower, but the advantage of this setting is that it will consume almost no extra memory, no matter how big is the tweets dataset. Be ware, though, that TWBlue might start to feel slower when accessing elements (for example when reading tweets) as the buffers grow up. This setting is suggested for computers with low memory or for those people not wanting to keep a really big amount of tweets stored.
* Changed the label in the direct message's text control so it will indicate that the user needs to write the text there, without referring to any username in particular. (`#366, <https://github.com/manuelcortez/TWBlue/issues/366>`_)
* TWBlue will take Shift+F10 again as the contextual menu key in the list of items in a buffer. This stopped working after we have migrated to WX 4.1. (`#353, <https://github.com/manuelcortez/TWBlue/issues/353>`_)
* TWBlue should render correctly retweets of quoted tweets. (`#365, <https://github.com/manuelcortez/TWBlue/issues/365>`_)
* Fixed an error that was causing TWBlue to be unable to output to screen readers at times. (`#369, <https://github.com/manuelcortez/TWBlue/issues/369>`_)
* Fixed autocomplete users feature. (`#367, <https://github.com/manuelcortez/TWBlue/issues/367>`_)
* Fixed error when displaying an URL at the end of a line, when the tweet or direct message contained multiple lines. Now the URL should be displayed correctly. (`#305, <https://github.com/manuelcortez/TWBlue/issues/305>`_ `#272, <https://github.com/manuelcortez/TWBlue/issues/272>`_)
* TWBlue has been migrated completely to Python 3 (currently, the software builds with Python 3.8).
* TWBlue should be restarted gracefully. Before, the application was alerting users of not being closed properly every time the application restarted by itself.
* If TWBlue attemps to load an account with invalid tokens (this happens when reactivating a previously deactivated account, or when access to the ap is revoqued), TWBlue will inform the user about this error and will skip the account. Before, the app was unable to start due to a critical error. (`#328, <https://github.com/manuelcortez/TWBlue/issues/328>`_)
* When sending a direct message, the title of the window will change appropiately when the recipient is edited. (`#276, <https://github.com/manuelcortez/TWBlue/issues/276>`_)
* URL'S in user profiles are expanded automatically. (`#275, <https://github.com/manuelcortez/TWBlue/issues/275>`_)
* TWBlue now uses `Tweepy, <https://github.com/tweepy/tweepy>`_ to connect with Twitter. We have adopted this change in order to support Twitter'S API V 2 in the very near future. (`#333, <https://github.com/manuelcortez/TWBlue/issues/337>`_ `#347 <https://github.com/manuelcortez/TWBlue/pull/347>`_)
* TWBlue can upload images in Tweets and replies again. (`#240, <https://github.com/manuelcortez/TWBlue/issues/240>`_)
* Fixed the way we use to count characters in Twitter. The new methods in TWBlue take into account special characters and URLS as documented in Twitter. (`#199, <https://github.com/manuelcortez/TWBlue/issues/199>`_ `#315 <https://github.com/manuelcortez/TWBlue/issues/315>`_)
* Proxy support now works as expected.
* Changed translation service from yandex.translate to Google Translator. (`#355, <https://github.com/manuelcortez/TWBlue/issues/355>`_)
* Improved method to load direct messages in the buffers. Now it should be faster due to less calls to Twitter API performed from the client.
* And more. (`#352, <https://github.com/manuelcortez/TWBlue/issues/352>`_)
Version 0.95
-------------
* TWBlue can open a Tweet or user directly in Twitter. There is a new option in the context menu for people and tweet buffers, and also, the shortcut control+win+alt+Enter will open the focused item in Twitter.
* Some keystrokes were remapped in the Windows 10 Keymap:
* Read location of a tweet: Ctrl+Win+G. (`#177 <https://github.com/manuelcortez/TWBlue/pull/177>`_)
* Open global settings dialogue: Ctrl+Win+Alt+O.
* Mute/unmute current session: Control + Windows + Alt + M.
* Fixed an error that was preventing TWBlue to load the direct messages buffer if an user who sent a message has been deleted.
* Added support for playing audios posted in `AnyAudio.net <http://anyaudio.net>`_ directly from TWBlue. Thanks to `Sam Tupy <http://www.samtupy.com/>`_
* Custom buffer ordering will not be reset every time the application restarts after an account setting has been modified.
* When adding or removing an user from a list, it is possible to press enter in the focused list instead of having to search for the "add" or "delete" button.
* Quoted and long tweets are displayed properly in the sent tweets buffer after being send. (`#253 <https://github.com/manuelcortez/TWBlue/issues/253>`_)
* Fixed an issue that was making the list manager keystroke unable to be shown in the keystroke editor. Now the keystroke is listed properly. (`#260 <https://github.com/manuelcortez/TWBlue/issues/260>`_)
* The volume slider, located in the account settings of TWBlue, now should decrease and increase value properly when up and down arrows are pressed. Before it was doing it in inverted order. (`#261 <https://github.com/manuelcortez/TWBlue/issues/261>`_)
* autoreading has been redesigned to work in a similar way for almost all buffers. Needs testing. (`#221 <https://github.com/manuelcortez/TWBlue/issues/221>`_)
* When displaying tweets or direct messages, a new field has been added to show the date when the item has been posted to Twitter.
* Added support for deleting direct messages by using the new Twitter API methods.
* When quoting a retweet, the quote will be made to the original tweet instead of the retweet.
* If the sent direct messages buffer is hidden, TWBlue should keep loading everything as expected. (`#246 <https://github.com/manuelcortez/TWBlue/issues/246>`_)
* There is a new soundpack, called FreakyBlue (Thanks to `Andre Louis <https://twitter.com/FreakyFwoof>`_) as a new option in TWBlue. This pack can be the default in the next stable, so users can take a look and share their opinion in snapshot versions. (`#247 <https://github.com/manuelcortez/TWBlue/issues/247>`_)
* There is a new option in the help menu that allows you to visit the soundpacks section in the TWBlue website. (`#247 <https://github.com/manuelcortez/TWBlue/issues/247>`_)
* When reading location of a geotagged tweet, it will be translated for users of other languages. (`#251 <https://github.com/manuelcortez/TWBlue/pull/251>`_)
* When there are no more items to retrieve in direct messages and people buffers, a message will announce it.
* Fixed an issue reported by some users that was making them unable to load more items in their direct messages.
* It is possible to add a tweet to the likes buffer from the menu bar again.
* Tweets, replies and retweets will be added to sent tweets right after being posted in Twitter.
* Extended Tweets should be displayed properly in list buffers.
Version 0.94
-------------
* Added an option in the global settings dialog to disable the Streaming features of TWBlue. TWBlue will remove all Streaming features after August 16, so this option will give people an idea about how it will be. (`#219 <https://github.com/manuelcortez/TWBlue/issues/219>`_)
* Due to Twitter API changes, Switched authorisation method to Pin-code based authorisation. When you add new accounts to TWBlue, you will be required to paste a code displayed in the Twitter website in order to grant access to TWBlue. (`#216 <https://github.com/manuelcortez/TWBlue/issues/216>`_)
* In order to comply with latest Twitter changes, TWBlue has switched to the new method used to send and receive direct messages, according to issue `#215. <https://github.com/manuelcortez/twblue/issues/215>`_
* The new method does not allow direct messages to be processed in real time. Direct messages will be updated periodically.
* After august 16 or when streaming is disabled, the events buffer will no longer be created in TWBlue.
* You can configure frequency for buffer updates in TWBlue. By default, TWBlue will update all buffers every 2 minutes, but you can change this setting in the global settings dialog. (`#223 <https://github.com/manuelcortez/TWBlue/issues/223>`_)
* Added a new tab called feedback, in the account settings dialog. This tab allows you to control whether automatic speech or Braille feedbak in certain events (mentions and direct messages received) is enabled. Take into account that this option will take preference over automatic reading of buffers and any kind of automatic output. (`#203 <https://github.com/manuelcortez/TWBlue/issues/203>`_)
* The spell checking dialog now has access keys defined for the most important actions. (`#211 <https://github.com/manuelcortez/TWBlue/issues/211>`_)
* TWBlue now Uses WXPython 4.0.1. This will allow us to migrate all important components to Python 3 in the future. (`#207 <https://github.com/manuelcortez/TWBlue/issues/207>`_)
* When you quote a Tweet, if the original tweet was posted with Twishort, TWBlue should display properly the quoted tweet. Before it was displaying the original tweet only. (`#206 <https://github.com/manuelcortez/TWBlue/issues/206>`_)
* It is possible to filter by retweets, quotes and replies when creating a new filter.
* Added support for playing youtube Links directly from the client. (`#94 <https://github.com/manuelcortez/TWBlue/issues/94>`_)
* Replaced Bass with libVLC for playing URL streams.
* the checkbox for indicating whether TWBlue will include everyone in a reply or not, will be unchecked by default.
* You can request TWBlue to save the state for two checkboxes: Long tweet and mention all, from the global settings dialogue.
* For windows 10 users, some keystrokes in the invisible user interface have been changed or merged:
* control+Windows+alt+F will be used for toggling between adding and removing a tweet to user's likes. This function will execute the needed action based in the current status for the focused tweet.
* TWBlue will show an error if something goes wrong in an audio upload.
* And more. (`#171, <https://github.com/manuelcortez/TWBlue/issues/171>`_)
Version 0.93
--------------
* A new soundpack has been added to TWBlue. Thanks to `@ValeriaK305 <https://twitter.com/ValeriaK305>`_
* In the Windows 10 keymap, we have changed some default keystrokes as windows now uses some previously assigned shortcuts:
* For liking a tweet, press Control+Windows+alt+f
* for opening a trends buffer, press control+Windows+T
* TWBlue has received improvements in some functions for handling extended tweets, long tweets and quoted retweets. It should render some tweets in a better way.
* In the spell checker module, there is a new button that will allow you to add your own words to your personal dictionary so the module won't mark them as mispelled the next time you will check spelling.
* Added filtering capabilities to TWBlue. (`#102 <https://github.com/manuelcortez/TWBlue/issues/102>`_)
* You can create a filter for the current buffer from the buffer menu in the menu bar. At this moment, invisible interface does not have any shorcut for this.
* You can create filters by word or languages.
* For deleting already created filters, you can go to the filter manager in the buffer menu and delete the filters you won't need.
* Links should be opened properly in quoted tweets (`#167, <https://github.com/manuelcortez/TWBlue/issues/167>`_ `#184 <https://github.com/manuelcortez/TWBlue/issues/184>`_)
* Increased display name limit up to 50 characters in update profile dialog.
* When authorising an account, you will see a dialogue with a cancel button, in case you want to abort the process. Also, NVDA will not be blocked when the process starts. (`#101 <https://github.com/manuelcortez/TWBlue/issues/101>`_)
* In the translator module, the list of available languages is fetched automatically from the provider. That means all of these languages will work and there will not be inconsistencies. Also we've removed the first combo box, because the language is detected automatically by Yandex'S API. (`#153 <https://github.com/manuelcortez/TWBlue/issues/153>`_)
* Trending topics, searches and conversation buffers will use mute settings set for the session in wich they were opened. (`#157 <https://github.com/manuelcortez/TWBlue/issues/157>`_)
* The Tweet limit is now 280 characters lenght instead 140. It means you can tweet longer tweets. (`#172 <https://github.com/manuelcortez/TWBlue/issues/172>`_)
* Per popular request, Status for mention to all and long tweet checkboxes will not be saved in settings. (`#170 <https://github.com/manuelcortez/TWBlue/issues/170>`_)
* Fixed a problem that was making TWBlue unable to start if it was being ran in Windows with Serbian language. (`#175 <https://github.com/manuelcortez/TWBlue/issues/175>`_)
* Added Danish translation.
* And more. (`#156, <https://github.com/manuelcortez/TWBlue/issues/156>`_ `#163, <https://github.com/manuelcortez/TWBlue/issues/163>`_ `#159, <https://github.com/manuelcortez/TWBlue/issues/159>`_ `#173, <https://github.com/manuelcortez/TWBlue/issues/173>`_ `#174, <https://github.com/manuelcortez/TWBlue/issues/174>`_ `#176, <https://github.com/manuelcortez/TWBlue/issues/176>`_)
Versions 0.91 and 0.92
-------------------------
* Fixed incorrect unicode handling when copying tweet to clipboard. (`#150 <https://github.com/manuelcortez/TWBlue/issues/150>`_)
* TWBlue will show an error when trying to open a timeline for a suspended user. (`#128 <https://github.com/manuelcortez/TWBlue/issues/128>`_)
* Removed TwUp as service as it no longer exists. (`#112 <https://github.com/manuelcortez/TWBlue/issues/112>`_)
* Release audio files after uploading them. (`#130 <https://github.com/manuelcortez/TWBlue/issues/130>`_)
* Now TWBlue will use Yandex's translation services instead microsoft translator. (`#132 <https://github.com/manuelcortez/TWBlue/issues/132>`_)
* SndUp users will be able to upload audio in their account by using their API Key again. (`#134 <https://github.com/manuelcortez/TWBlue/issues/134>`_)
* old tweets shouldn't be added as new items in buffers. (`#116, <https://github.com/manuelcortez/TWBlue/issues/116>`_ `#133 <https://github.com/manuelcortez/TWBlue/issues/133>`_)
* All mentionned users should be displayed correctly in Twishort's long tweets. (`#116, <https://github.com/manuelcortez/TWBlue/issues/116>`_ `#135 <https://github.com/manuelcortez/TWBlue/issues/135>`_)
* It is possible to select a language for OCR service from the extras panel, in the account settings dialogue. You can, however, set this to detect automatically. OCR should work better in languages with special characters or non-english symbols. (`#107 <https://github.com/manuelcortez/TWBlue/issues/107>`_)
* Fixed a problem with JAWS for Windows and TWBlue. Now JAWS will work normally in this update. (`#100 <https://github.com/manuelcortez/twblue/issues/100>`_)
* And more (`#136, <https://github.com/manuelcortez/TWBlue/issues/136>`_)
Version 0.90
--------------
* Fixed a bug in long tweet parsing that was making TWBlue to disconnect the streaming API. (`#103 <https://github.com/manuelcortez/TWBlue/issues/103>`_)
* Now OCR will work in images from retweets. It fixes a bug where TWBlue was detecting images but couldn't apply OCR on them. (`#105 <https://github.com/manuelcortez/TWBlue/issues/105>`_)
* TWBlue won't try to load tweets already deleted, made with Twishort. Before, if someone posted a long tweet but deleted it in the Twishort's site, TWBlue was trying to load the tweet and it was causing problems in all the client. (`#113 <https://github.com/manuelcortez/TWBlue/issues/113>`_)
* TWBlue shows an error message when you try to view the profile of an user that does not exist or has been suspended. (`#114, <https://github.com/manuelcortez/TWBlue/issues/114>`_ `#115 <https://github.com/manuelcortez/TWBlue/issues/115>`_)
* The spell checker module should select the right language when is set to "user default". (`#117 <https://github.com/manuelcortez/TWBlue/issues/117>`_)
* Image description will be displayed in retweets too. (`#119 <https://github.com/manuelcortez/TWBlue/issues/119>`_)
* When reading a long tweet, you shouldn't read strange entities anymore. (`#118 <https://github.com/manuelcortez/twblue/issues/118>`_)
* TWBlue will not try to load timelines if the user is blocking you. (`#125 <https://github.com/manuelcortez/twblue/issues/125>`_)
Versions 0.88 and 0.89
------------------------
* Fixed more issues with streams and reconnections.
* newer updates will indicate the release date in the updater.
* Changes to keystrokes are reflected in keystroke editor automatically.
* In replies with multiple users, if the mention to all checkbox is unchecked, you will see a checkbox per user so you will be able to control who will be mentioned in the reply.
* Fixed a bug that caused duplicated user mentions in replies when the tweet was made with Twishort.
* Retweets should be displayed normally again when the originating tweet is a Twishort's long tweet.
* Changed the way TWBlue saves user timelines in configuration. Now it uses user IDS instead usernames. With user IDS, if an user changes the username, TWBlue still will create his/her timeline. This was not possible by using usernames.
* Added a new setting in the account settings dialogue that makes TWBlue to show twitter usernames instead the full name.
* Added OCR in twitter pictures. There is a new item in the tweet menu that allows you to extract and display text in images. Also the keystroke alt+Win+o has been added for the same purpose from the invisible interface.
* Now TWBlue will play a sound when the focused tweet contains images.
* Your own quoted tweets will not appear in the mentions buffer anymore.
* The config file is saved in a different way, it should fix the bug where TWBlue needs to be restarted after the config folder is deleted.
* Mentioning people from friends or followers buffers works again.
* Support for proxy servers has been improved. Now TWBlue supports http, https, socks4 and socks5 proxies, with and without autentication.
Version 0.87
--------------
* Fixed stream connection errors.
* Now TWBlue can handle properly a reply to the sender without including all other mentioned users.
* Updated translations.
* The status of the mention to all checkbox will be remembered the next time you reply to multiple users.
Version 0.86
--------------
* Fixed a very important security issue. Now TWBlue will send tweets to twishort without using any other server.
* When you add a comment to a tweet, it will be sent as a quoted tweet, even if your reply plus the original tweet is not exceeding 140 characters.
* Updated windows 10 keymap for reflecting changes made in the last windows 10 build.
* Added last changes in the twitter API.
* When replying, it will not show the twitter username in the text box. When you send the tweet, the username will be added automatically.
* When replying to multiple users, you'll have a checkbox instead a button for mentioning all people. If this is checked, twitter usernames will be added automatically when you send your reply.
Version 0.85
--------------
* Long and quoted tweets should be displayed properly In lists.
* The connection should be more stable.
* Added an autostart option in the global settings dialogue.
* Updated translations.
* Updated russian documentation.
* Tweets in cached database should be loaded properly.
* Added some missed dictionaries for spelling correction.
* Timelines, lists and other buffer should be created in the right order at startup.
Version 0.84
--------------
* More improvements in quoted and long tweets.
* Updated translations: Russian, Italian, French, Romanian, Galician and Finnish.
* Improvements in the audio uploader module: Now it can handle audio with non-english characters.
* the title of the window should be updated properly when spellcheck, translate or shorten/unshorten URL buttons are pressed.
* the bug that changes the selected tweet in the home timeline shouldn't be happening so often.
Version 0.82 and 0.83
------------------------
* If the tweet source (client) is an application with unicode characters (example: российская газета) it will not break the tweet displayer.
* Added a new field for image description in tweet displayer. When available, it will show description for images posted in tweets.
* users can add image descriptions to their photos. When uploading an image, a dialog will show for asking a description.
* Redesigned upload image dialog.
* Fixed photo uploads when posting tweets.
* When getting tweets for a conversation, ignores deleted tweets or some errors, now TWBlue will try to get as much tweets as possible, even if some of these are no longer available.
* Added audio playback from soundcloud.
* Now the session mute option don't makes the screen reader speaks.
* Fixed the direct message dialog. Now it should be displayed properly.
* when a tweet is deleted in twitter, TWBlue should reflect this change and delete that tweet in every buffer it is displayed.
* If your session is broken, TWBlue will be able to remove it automatically instead just crashing.
* audio uploader should display the current progress.
* users can disable the check for updates feature at startup from the general tab, in the global settings dialogue.
* The invisible interface and the window should be synchronized when the client reconnects.
* The documentation option in the systray icon should be enabled.
* In trending buffers, you can press enter for posting a tweet about the focused trend.
* Updated russian documentation and main program interface (thanks to Natalia Hedlund (Наталья Хедлунд), `@lifestar_n <https://twitter.com/lifestar_n>`_ in twitter)
* updated translations.
Version 0.81
--------------
* Updated translations
* The updater module has received some improvements. Now it includes a Mirror URL for checking updates if the main URL is not available at the moment. If something is wrong and both locations don't work, the program will start anyway.
* some GUI elements now use keyboard shortcuts for common actions.
* fixed a bug in the geolocation dialog.
* the chicken nugget keymap should work properly.
* Added a new soundpack to the default installation of TWBlue, thanks to `@Deng90 <https://twitter.com/deng90>`_
* Now the changelog is written in an html File.
* Added some missed dictionaries in last version for the spell checking feature.
* Trimmed the beginnings of the sounds in the default soundpack. Thanks to `@masonasons <https://github.com/masonasons>`_
* Added Opus support for sound playback in TWBlue. Thanks to `@masonasons <https://github.com/masonasons>`_
* Added a source field in view tweet dialogue. Thanks to `@masonasons <https://github.com/masonasons>`_
* You can load previous items in followers and friend buffers for others.
* The Spell Checker dialogue should not display an error message when you have set "default language" in the global settings dialogue if your language is supported.
* Updated romanian translation.
* Some code cleanups.
* The bug reports feature is fully operational again.
* TWBlue should work again for users that contains special characters in windows usernames.
* Added more options for the tweet searches.
* Added play_audio to the keymap editor.
* Windows key is no longer required in the keymap editor
* Switched to the Microsoft translator.
* You can update the current buffer by pressing ctrl+win+shift+u in the default keymap or in the buffer menu.
* Changed some keystrokes in the windows 10 default keymap
* New followers and friends buffer for user timelines.

View File

@@ -0,0 +1,56 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'TWBlue'
copyright = '2013 - 2022, MCV Software'
author = 'MCV Software'
# The full version, including alpha/beta/rc tags
release = '2022.12.9'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx_rtd_theme',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

View File

@@ -0,0 +1,20 @@
Credits, contact and acknowledgments
--------------------------------------
Tw Blue is free software, licensed under the GNU GPL license, either version 2 or, at your option, any later version. You can view the license in the file named license.txt, or online at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
The source code of the program is available on GitHub at https://www.github.com/mcv-software/twblue.
If you want to donate to the project, you can do so at https://twblue.es/donate. Thank you for your support!
Contact
========
If you still have questions after reading this document, if you wish to collaborate to the project in some other way, or if you simply want to get in touch with the application developers, you can follow the accounts of TWBlue (`@tw_blue2 in Twitter <https://twitter.com/tw_blue2>`_ and `@twblue@maaw.social in mastodon <https://maaw.social/@twble>`_).
Credits
---------
TWBlue is developed and maintained by `Manuel Cortéz <https://twitter.com/manuelcortez00>`_.
We would also like to thank the translators of TWBlue, who have allowed the spreading of the application.

View File

@@ -0,0 +1,3 @@
global settings
----------------

View File

@@ -0,0 +1,22 @@
.. TWBlue documentation master file, created by
sphinx-quickstart on Mon Dec 12 18:50:18 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
TWBlue documentation
==========================================
This is the user guide for the latest available version of TWBlue. The purpose of this manual, which has been divided into several chapters, is to inform about the use of this application. It is possible that this documentation will be updated throughout the development of TWBlue with new features. You can always find the latest version of this guide at its URL address: https://twblue.es/documentation
.. toctree::
:maxdepth: 2
:caption: Topics:
introduction
system_requirements
installation
basic_concepts
usage
global_settings
credits
changelog

View File

@@ -0,0 +1,20 @@
Installation
-------------
TWBlue is available from its `Download page. <https://twblue.es/downloads>`_ On this page, you can always find the latest version of the application, completely free of charge. Currently, 4 different packages are distributed: two portable packages, for 32-bit and 64-bit systems; an installer, which selects the version to install depending on the architecture of the system where it runs, and a portable package for 32-bit, specially generated to be compatible with Windows 7.
:note: Windows 7 users must download the Windows 7 compatible package. Any other TWBlue package will be impossible to run under this operating system.
If you downloaded a portable version, simply unzip the file into an empty directory and run the twblue.exe file.
If you downloaded the installer, open the twblue_setup.exe file and follow the instructions to install the software. The installer will select the best version for your operating system architecture. When finished, you will be able to run TWBlue from the desktop or the windows start menu.
Troubleshooting
++++++++++++++++
In case TWBlue doesn't work for any reason, please verify the following before getting in touch, just to make sure everything is alright in your system:
* for windows 7 Users, please have in mind that you will need to apply all available Windows Updates. Also you'll need the Service Pack 1 installed.
* If TWBlue is unable to run and you are using Windows 8.1 or earlier, please make sure you have installed the Microsoft Visual C++ 2019 redistributable package. Download the `32 bit <https://aka.ms/vs/16/release/vc_redist.x86.exe>`_ or `64 bit <https://aka.ms/vs/16/release/vc_redist.x64.exe>`_ versiom.
If the application still doesn't work after you have checked this, please `Get in touch <contact.rst>`_ so we can help to determine what might b the issue and fix it for future versions.

View File

@@ -0,0 +1,6 @@
Introduction
==========================================
TWBlue is a free and open source application that allows you to interact with the main features of Twitter and mastodon from the comfort of a windows software, with two different interfaces specially designed for screen reader users.
Please note that in order to use TWBlue, as well as to read this documentation, an internet connection and a Windows computer are required.

View File

@@ -0,0 +1,62 @@
Mastodon
--------
Authorizing TWBlue
==================
Buffer types
============
Actions
=======
Context menus
==============
Posts
++++++
Conversations
++++++++++++++++
Users
++++++
Hashtags
+++++++++++++++
Composing posts
==============
Sending Direct messages
=======================
User actions
============
Timelines
=========
Hashtags
======
Searches
========
User aliases
==============
Lists management
===================
Account settings
=================
User Autocomplete
==================
Template editor
================
Filters
=======

View File

@@ -0,0 +1,11 @@
System requirements
==========================================
In order to run TWBlue successfully on a computer, these are the minimum system requirements. Please note that while it may be possible to use TWBlue under more limited resources, it is not recommended because the experience may be degraded or the application may not work as expected:
* Processor: Dual core processor, 1.3 GHZ or higher.
* Operating system: Windows 7 (service pack 1), Windows 8/8.1, Windows 10 or Windows 11.
* Hard Drive: Minimum 200 MB of free space.
* RAM memory: 4 GB.
:note: TWBlue is compatible with Windows 7 systems (requires service pack 1 to be installed) in a special version, available on the `Project downloads page. <https://twblue.es/downloads>`_ This version is only available in a portable package, for 32-bit systems, and cannot be updated automatically. Windows 7 users will need to update TWBlue manually every time there is a new version to keep using the application.

View File

@@ -0,0 +1,153 @@
Twitter
-------
Twitter is a social networking or micro-blogging tool which allows you to compose short status updates of your activities in 280 characters or less. Twitter is a way for friends, family and co-workers to communicate and stay connected through the exchange of quick, frequent messages. You can restrict delivery of updates to those in your circle of friends or, by default, allow anyone to access them.
You can monitor the status of updates from your friends, family or co-workers (known as following), and they in turn can read any updates you create, (known as followers). The updates are referred to as Tweets. The Tweets are posted to your Twitter profile or Blog and are searchable using Twitter Search.
In order to use TWBlue, you must first have created an account on the Twitter website. The process for signing up for a Twitter account is very accessible. During the account registration, you will need to choose a Twitter username. This serves two purposes. This is the method through which people will comunicate with you, but most importantly, your username and password will be required to connect TWBlue to your Twitter account. We suggest you choose a username which is memorable both to you and the people you hope will follow you.
We'll start from the premise that you have a Twitter account with its corresponding username and password.
authorizing TWBlue
==================
First of all, it's necessary to authorise the program so it can access your Twitter account and act on your behalf. The authorisation process is quite simple, and the program never retains data such as your password. In order to authorise the application, you just need to run the main executable file, called TWBlue.exe (on some computers it may appear simply as TWBlue if Windows Explorer is not set to display file extensions). We suggest you may like to place a Windows shortcut on your Desktop pointing to this executable file for quick and easy location.
You can log into several Twitter accounts simultaneously. The program refers to each Twitter account you have configured as a "Session". If this is the first time you have launched TWBlue, and if no Twitter session exists, you will see the Session Manager. This dialogue box allows you to authorise as many accounts as you wish. If you press the Tab key to reach the "new account" button and activate it by pressing the Space Bar, you will see a menu with all available services to configure in TWBlue. By choosing Twitter, a dialogue box will advise you that your default internet browser will be opened in order to authorise the application and you will be asked if you would like to continue. Activate the "yes" Button by pressing the letter "Y" so the process may start.
Your default browser will open on the Twitter page to request authorisation. Enter your username and password into the appropriate edit fields if you're not already logged in, select the authorise button, and press it.
Once you've authorised your twitter account, the website will redirect you to a page which will notify you that TWBlue has been authorised successfully. On this page, you will be shown a code composed of several numbers that you must paste in the TWBlue authorization dialogue in order to allow the application to access your account. Once you have pasted the code in the corresponding text field, press enter to finish the account setup and go back to the session manager. On the session list, you will see a new item temporarily called "Authorised account x" -where x is a number. The session name will change once you open that session.
To start running TWBlue, press the Ok button in the Session Manager dialogue. By default, the program starts all the configured sessions automatically, however, you can change this behavior.
If all went well, the application will start playing sounds, indicating your data is being updated.
When the process is finished, by default the program will play another sound, and the screen reader will say "ready" (this behaviour can be configured).
Buffer types
============
The following is a description for every one of TWBlue's buffers available for Twitter sessions, and the kind of items they work with.
* Home: this shows all the tweets on the main timeline. These are the tweets by users you follow.
* Mentions: if a user, whether you follow them or not, mentions you on Twitter, you will find it in this list.
* Direct messages: here you will find the private direct messages you exchange with users who follow you , or with any user, if you allow direct messages from everyone (this setting is configurable from Twitter). This list only shows received messages.
* Sent direct messages: this buffer shows all the direct messages sent from your account.
* Sent tweets: this shows all the tweets sent from your account.
* Likes: here you will see all the tweets you have liked.
* Followers: when users follow you, you'll be able to see them on this buffer, with some of their account details.
* Following: the same as the previous buffer, but these are the users you follow.
* Muted users: when you mute someone in Twitter, you no longer see their tweets in any of your buffers. However, you still can receive direct messages from them. This buffer contains the list of your muted users.
* Blocked users: Contains a list with all people you have blocked in Twitter. When blocking an user, they cannot see your profile, timelines or exchange direct messages with your account.
* User timelines: these are buffers you may create. They contain only the tweets by a specific user. They're used so you can see the tweets by a single person and you don't want to look all over your timeline. You may create as many as you like.
* Lists: A list is similar to a user timeline, except that you can configure it to contain tweets from multiple users.
* Search: A search buffer contains the results of a search operation.
* User likes: You can have the program create a buffer containing tweets liked by a particular user.
* Followers or following timeline: You can have TWBlue create a buffer containing all users who follow, or are followed by a specific user.
* Trending Topics: a trend buffer shows the top 50 most used terms in a geographical region. This region may be a country or a city. Trends are updated every five minutes.
If a tweet contains a URL, you can press enter in the GUI to open it. If it contains video or audio, including live stream content, you can press Control + Enter to play it, respectively. TWBlue will play a sound if the tweet contains video metadata or the \#audio hashtag, but there may be tweets which contain media without this.
Actions
=======
The available actions for each buffer may vary, and are found by pressing the Tab key, once a specific buffer has been focused. Note that these are not all the actions available for the Twitter session in TWBlue. Generally, you can perform the actions you want from 3 different ways:
* In each buffer, by pressing the Tab key until you find the action panel.
* By using the menu bar, which can be accessed by pressing the Alt key.
* Using the keyboard shortcuts, either from the graphical interface or the invisible interface.
You can find more information on the meaning of these actions later in this topic:
* For all sessions, you can log in or log out of TWBlue, as well as control whether the session should start automatically when you start the application.
* For buffers containing tweets (home, mentions, favorites, timelines and searches), you can write a new tweet, reply to the currently selected tweet, retweet it or send a direct message to the user who wrote it.
* For buffers containing direct messages, you can reply to the selected direct message.
* For buffers containing users (followers, following, blocked users, muted, timelines and searches), the available actions are to mention the selected user, send a direct message or open the actions dialog for that user.
* Buffers showing trends allow you to write a Tweet about the selected trend.
Context menus
==============
By pressing the contextual menu key, or the right mouse button on a focused item, TWBlue will display a list of some actions that can be performed on it. These actions will be different depending on the type of item that is selected (for example, tweets allow you to retweet them, while a trend will allow you to perform a Twitter search on it). Below are the options that you will be able to see in the menus, sorted according to the type of element that is selected when displayed:
Tweets
++++++
* Retweet: this option retweets the message you're reading. After you press it, if you haven't configured the application not to do so, you'll be asked if you want to add a comment or simply send it as written. If you choose to add a comment, it will post a quoted tweet, that is, the comment with a link to the originating tweet.
* Reply: when you're viewing a tweet, you can reply to the user who sent it by pressing this option. A dialogue will open up similar to the one for tweeting. If there are more users referred to in the tweet, you can press tab and activate the mention to all checkbox, or enabling checkbox for the users you want to mention separately. Note, however, that sometimes -especially when replying to a retweet or quoted tweet, the user who made the retweet or quote may also be mentioned. This is done by Twitter automatically.
* Like: Adds the tweet you're viewing to your likes list.
* Unlike: removes the tweet from your likes, but not from Twitter.
* Open URL: if the focused tweet contains URL addresses, shows up a dialogue where you can choose which one to open in the default web browser. Bear in mind that if the tweet contains only one URL, it will open it automatically.
* Open in Twitter: Opens the focused tweet in Twitter's website.
* Play audio: if the focused tweet contains audio or video streams, shows up a dialogue where you can choose which one to play. TWBlue uses a reduced version of VLC media player to play most audio and video streams. Bear in mind that if the tweet contains only one audio or video URL, it will play it automatically.
* Show tweet: opens up a dialogue box where you can read the item which has focus. You can read the text with the arrow keys. It's a similar dialog box as used for composing tweets, without the ability to send the tweet, file attachment and autocompleting capabilities. It does however include a retweets and likes count.
* Copy to clipboard: copies focused item text to clipboard.
* Delete: permanently removes the tweet which has focus from Twitter and from your lists. Bear in mind that Twitter only allows you to delete tweets you have posted yourself.
* User actions: Opens a dialogue where you can interact with a user. This dialogue box will be populated with the user who sent the item in focus. User actions are described later.
Direct messages
++++++++++++++++
* Reply: Opens a direct message dialogue, from where you can reply to the focused direct message. Sending direct messages will be described later.
* Open URL: if the focused item contains URL addresses, shows up a dialogue where you can choose which one to open in the default web browser. Bear in mind that if the item contains only one URL, it will open it automatically.
* Play audio: if the focused item contains audio or video streams, shows up a dialogue where you can choose which one to play. TWBlue uses a reduced version of VLC media player to play most audio and video streams. Bear in mind that if the item contains only one audio or video URL, it will play it automatically.
* Show direct message: opens up a dialogue box where you can read the item which has focus. You can read the text with the arrow keys. It's a dialogue with the text to be read and a close button.
* Copy to clipboard: copies focused item text to clipboard.
* Delete: permanently removes the direct message which has focus from your account. Note that this will not remove the message from its recipient's account.
* User actions: Opens a dialogue where you can interact with a user. This dialogue box will be populated with the user who sent the item in focus. User actions are described later.
Users
++++++
* Direct message: Opens up a dialogue box from where it is possible to send a private message to the focused user.
* Show user profile: Opens up a dialog box from where it is possible to see details for the focused user. You can read the dialog by using the up and down arrow keys. If the user has a website in their profile, you can press tab and find a button to open it in your default browser.
* Show user:
* Open in Twitter:
* Copy to clipboard:
* User actions:
Trending topics
+++++++++++++++
* Search topic:
* Tweet about this trend:
* Show item:
* Copy to clipboard:
Posting Tweets
==============
Sending Direct messages
=======================
User actions
============
Timelines
=========
Trends
======
Searches
========
User aliases
==============
Lists management
===================
Account settings
=================
User Autocomplete
==================
Template editor
================
Filters
=======

View File

@@ -0,0 +1,11 @@
Usage
-----
TWBlue can create Twitter or Mastodon sessions. In this chapter, you can choose to visit the topic of your interest, depending on the account you are setting up. You will find specific information about the social network of your choice in the following topics:
.. toctree::
:maxdepth: 2
:caption: Session types:
twitter
mastodon

View File

@@ -50,6 +50,7 @@ numpy
pillow
charset-normalizer
demoji
psutil
git+https://github.com/accessibleapps/libloader
git+https://github.com/accessibleapps/platform_utils
git+https://github.com/accessibleapps/accessible_output2

View File

@@ -1,8 +1,16 @@
# -*- coding: utf-8 -*-
import datetime
# Make date check for feb 9.
now = datetime.datetime.now()
end_of_twitter = datetime.datetime(2023, 2, 9)
twitter_support_enabled = True
if now >= end_of_twitter:
twitter_support_enabled = False
name = 'TWBlue'
short_name='twblue'
update_url = 'https://twblue.es/updates/updates.php'
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/updates.json'
mirror_update_url = 'https://raw.githubusercontent.com/mcv-software/TWBlue/next-gen/updates/updates.json'
authors = ["Manuel Cortéz", "José Manuel Delicado"]
authorEmail = "manuel@manuelcortez.net"
copyright = "Copyright (C) 2013-2022, MCV Software."

View File

@@ -2,4 +2,5 @@
from .base import BaseBuffer
from .mentions import MentionsBuffer
from .conversations import ConversationBuffer, ConversationListBuffer
from .users import UserBuffer
from .users import UserBuffer
from .notifications import NotificationsBuffer

View File

@@ -9,6 +9,7 @@ import config
import sound
import languageHandler
import logging
from mastodon import MastodonNotFoundError
from audio_services import youtube_utils
from controller.buffers.base import base
from controller.mastodon import messages
@@ -72,14 +73,22 @@ class BaseBuffer(base.Buffer):
post.message.destroy()
def get_formatted_message(self):
return self.compose_function(self.get_item(), self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])[1]
safe = True
if self.session.settings["general"]["read_preferences_from_instance"]:
safe = self.session.expand_spoilers == False
return self.compose_function(self.get_item(), self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)[1]
def get_message(self):
post = self.get_item()
if post == None:
return
template = self.session.settings["templates"]["post"]
# If template is set to hide sensitive media by default, let's change it according to user preferences.
if self.session.settings["general"]["read_preferences_from_instance"] == True:
if self.session.expand_spoilers == True and "$safe_text" in template:
template = template.replace("$safe_text", "$text")
elif self.session.expand_spoilers == False and "$text" in template:
template = template.replace("$text", "$safe_text")
t = templates.render_post(post, template, relative_times=self.session.settings["general"]["relative_times"], offset_hours=self.session.db["utc_offset"])
return t
@@ -93,7 +102,10 @@ class BaseBuffer(base.Buffer):
min_id = None
# toDo: Implement reverse timelines properly here.
if (self.name != "favorites" and self.name != "bookmarks") and self.name in self.session.db and len(self.session.db[self.name]) > 0:
min_id = self.session.db[self.name][-1].id
if self.session.settings["general"]["reverse_timelines"]:
min_id = self.session.db[self.name][0].id
else:
min_id = self.session.db[self.name][-1].id
try:
results = getattr(self.session.api, self.function)(min_id=min_id, limit=count, *self.args, **self.kwargs)
results.reverse()
@@ -121,7 +133,10 @@ class BaseBuffer(base.Buffer):
else:
post = self.session.db[self.name][0]
output.speak(_("New post in {0}").format(self.get_buffer_name()))
output.speak(" ".join(self.compose_function(post, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])))
safe = True
if self.session.settings["general"]["read_preferences_from_instance"]:
safe = self.session.expand_spoilers == False
output.speak(" ".join(self.compose_function(post, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)))
elif number_of_items > 1 and 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(_("{0} new posts in {1}.").format(number_of_items, self.get_buffer_name()))
@@ -147,13 +162,16 @@ class BaseBuffer(base.Buffer):
self.session.db[self.name] = items_db
selection = self.buffer.list.get_selected()
log.debug("Retrieved %d items from cursored search in function %s." % (len(elements), self.function))
safe = True
if self.session.settings["general"]["read_preferences_from_instance"]:
safe = self.session.expand_spoilers == False
if self.session.settings["general"]["reverse_timelines"] == False:
for i in elements:
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.insert_item(True, *post)
else:
for i in items:
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
for i in elements:
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.insert_item(False, *post)
self.buffer.list.select_item(selection)
output.speak(_(u"%s items retrieved") % (str(len(elements))), True)
@@ -182,27 +200,33 @@ class BaseBuffer(base.Buffer):
if number_of_items == 0 and self.session.settings["general"]["persist_size"] == 0: return
log.debug("The list contains %d items " % (self.buffer.list.get_count(),))
log.debug("Putting %d items on the list" % (number_of_items,))
safe = True
if self.session.settings["general"]["read_preferences_from_instance"]:
safe = self.session.expand_spoilers == False
if self.buffer.list.get_count() == 0:
for i in list_to_use:
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.insert_item(False, *post)
self.buffer.set_position(self.session.settings["general"]["reverse_timelines"])
elif self.buffer.list.get_count() > 0 and number_of_items > 0:
if self.session.settings["general"]["reverse_timelines"] == False:
items = list_to_use[len(list_to_use)-number_of_items:]
for i in items:
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.insert_item(False, *post)
else:
items = list_to_use[0:number_of_items]
items.reverse()
for i in items:
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.insert_item(True, *post)
log.debug("Now the list contains %d items " % (self.buffer.list.get_count(),))
def add_new_item(self, item):
post = self.compose_function(item, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
safe = True
if self.session.settings["general"]["read_preferences_from_instance"]:
safe = self.session.expand_spoilers == False
post = self.compose_function(item, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
if self.session.settings["general"]["reverse_timelines"] == False:
self.buffer.list.insert_item(False, *post)
else:
@@ -211,7 +235,10 @@ class BaseBuffer(base.Buffer):
output.speak(" ".join(post[:2]), speech=self.session.settings["reporting"]["speech_reporting"], braille=self.session.settings["reporting"]["braille_reporting"])
def update_item(self, item, position):
post = self.compose_function(item, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
safe = True
if self.session.settings["general"]["read_preferences_from_instance"]:
safe = self.session.expand_spoilers == False
post = self.compose_function(item, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.list.SetItem(position, 1, post[1])
def bind_events(self):
@@ -295,6 +322,9 @@ class BaseBuffer(base.Buffer):
else:
title = _("Reply to {}").format(item.account.username)
caption = _("Write your reply here")
# Set unlisted by default, so we will not clutter other user's buffers with replies.
# see https://github.com/MCV-Software/TWBlue/issues/504
visibility = "unlisted"
if item.reblog != None:
users = ["@{} ".format(user.acct) for user in item.reblog.mentions if user.id != self.session.db["user_id"]]
if item.reblog.account.acct != item.account.acct and "@{} ".format(item.reblog.account.acct) not in users:
@@ -347,7 +377,7 @@ class BaseBuffer(base.Buffer):
def share_item(self, *args, **kwargs):
if self.can_share() == False:
return output.speak(_("This action is not supported on conversation posts."))
return output.speak(_("This action is not supported on conversations."))
post = self.get_item()
id = post.id
if self.session.settings["general"]["boost_mode"] == "ask":
@@ -436,6 +466,7 @@ class BaseBuffer(base.Buffer):
self.buffer.list.remove_item(index)
except Exception as e:
self.session.sound.play("error.ogg")
log.exception("")
self.session.db[self.name] = items
def user_details(self):
@@ -469,7 +500,11 @@ class BaseBuffer(base.Buffer):
item = self.get_item()
if item.reblog != None:
item = item.reblog
item = self.session.api.status(item.id)
try:
item = self.session.api.status(item.id)
except MastodonNotFoundError:
output.speak(_("No status found with that ID"))
return
if item.favourited == False:
call_threaded(self.session.api_call, call_name="status_favourite", preexec_message=_("Adding to favorites..."), _sound="favourite.ogg", id=item.id)
else:
@@ -479,7 +514,11 @@ class BaseBuffer(base.Buffer):
item = self.get_item()
if item.reblog != None:
item = item.reblog
item = self.session.api.status(item.id)
try:
item = self.session.api.status(item.id)
except MastodonNotFoundError:
output.speak(_("No status found with that ID"))
return
if item.bookmarked == False:
call_threaded(self.session.api_call, call_name="status_bookmark", preexec_message=_("Adding to bookmarks..."), _sound="favourite.ogg", id=item.id)
else:
@@ -488,8 +527,12 @@ class BaseBuffer(base.Buffer):
def view_item(self):
post = self.get_item()
# Update object so we can retrieve newer stats
post = self.session.api.status(id=post.id)
print(post)
try:
post = self.session.api.status(id=post.id)
except MastodonNotFoundError:
output.speak(_("No status found with that ID"))
return
# print(post)
msg = messages.viewPost(post, offset_hours=self.session.db["utc_offset"], item_url=self.get_item_url())
def ocr_image(self):

View File

@@ -4,6 +4,7 @@ import logging
import wx
import widgetUtils
import output
from mastodon import MastodonNotFoundError
from controller.mastodon import messages
from controller.buffers.mastodon.base import BaseBuffer
from mysc.thread_utils import call_threaded
@@ -46,9 +47,6 @@ class ConversationListBuffer(BaseBuffer):
log.debug("args: %s, kwargs: %s" % (self.args, self.kwargs))
count = self.session.settings["general"]["max_posts_per_call"]
min_id = None
# toDo: Implement reverse timelines properly here.
# if (self.name != "favorites" and self.name != "bookmarks") and self.name in self.session.db and len(self.session.db[self.name]) > 0:
# min_id = self.session.db[self.name][-1].id
try:
results = getattr(self.session.api, self.function)(min_id=min_id, limit=count, *self.args, **self.kwargs)
results.reverse()
@@ -94,7 +92,7 @@ class ConversationListBuffer(BaseBuffer):
conversation = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
self.buffer.list.insert_item(True, *conversation)
else:
for i in items:
for i in elements:
conversation = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
self.buffer.list.insert_item(False, *conversation)
self.buffer.list.select_item(selection)
@@ -203,7 +201,11 @@ class ConversationBuffer(BaseBuffer):
self.execution_time = current_time
log.debug("Starting stream for buffer %s, account %s and type %s" % (self.name, self.account, self.type))
log.debug("args: %s, kwargs: %s" % (self.args, self.kwargs))
self.post = self.session.api.status(id=self.post.id)
try:
self.post = self.session.api.status(id=self.post.id)
except MastodonNotFoundError:
output.speak(_("No status found with that ID"))
return
# toDo: Implement reverse timelines properly here.
try:
results = []

View File

@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import time
import logging
import output
from controller.buffers.mastodon.base import BaseBuffer
from sessions.mastodon import utils
@@ -8,6 +9,11 @@ log = logging.getLogger("controller.buffers.mastodon.mentions")
class MentionsBuffer(BaseBuffer):
def get_item(self):
index = self.buffer.list.get_selected()
if index > -1 and self.session.db.get(self.name) != None and len(self.session.db[self.name]) > index:
return self.session.db[self.name][index]["status"]
def start_stream(self, mandatory=False, play_sound=True, avoid_autoreading=False):
current_time = time.time()
if self.execution_time == 0 or current_time-self.execution_time >= 180 or mandatory==True:
@@ -16,17 +22,13 @@ class MentionsBuffer(BaseBuffer):
log.debug("args: %s, kwargs: %s" % (self.args, self.kwargs))
count = self.session.settings["general"]["max_posts_per_call"]
min_id = None
# toDo: Implement reverse timelines properly here.
# if self.name != "favorites" and self.name in self.session.db and len(self.session.db[self.name]) > 0:
# min_id = self.session.db[self.name][-1].id
try:
items = getattr(self.session.api, self.function)(min_id=min_id, limit=count, exclude_types=["follow", "favourite", "reblog", "poll", "follow_request"], *self.args, **self.kwargs)
items = getattr(self.session.api, self.function)(min_id=min_id, limit=count, types=["mention"], *self.args, **self.kwargs)
items.reverse()
results = [item.status for item in items if item.get("status") and item.type == "mention"]
except Exception as e:
log.exception("Error %s" % (str(e)))
return
number_of_items = self.session.order_buffer(self.name, results)
number_of_items = self.session.order_buffer(self.name, items)
log.debug("Number of items retrieved: %d" % (number_of_items,))
self.put_items_on_list(number_of_items)
if number_of_items > 0 and self.name != "sent_posts" and self.name != "sent_direct_messages" and self.sound != None and self.session.settings["sound"]["session_mute"] == False and self.name not in self.session.settings["other_buffers"]["muted_buffers"] and play_sound == True:
@@ -43,11 +45,11 @@ class MentionsBuffer(BaseBuffer):
else:
max_id = self.session.db[self.name][-1].id
try:
items = getattr(self.session.api, self.function)(max_id=max_id, limit=self.session.settings["general"]["max_posts_per_call"], exclude_types=["follow", "favourite", "reblog", "poll", "follow_request"], *self.args, **self.kwargs)
items = [item.status for item in items if item.get("status") and item.type == "mention"]
items = getattr(self.session.api, self.function)(max_id=max_id, limit=self.session.settings["general"]["max_posts_per_call"], types=["mention"], *self.args, **self.kwargs)
except Exception as e:
log.exception("Error %s" % (str(e)))
return
print(items)
items_db = self.session.db[self.name]
for i in items:
if utils.find_item(i, self.session.db[self.name]) == None:
@@ -59,13 +61,55 @@ class MentionsBuffer(BaseBuffer):
self.session.db[self.name] = items_db
selection = self.buffer.list.get_selected()
log.debug("Retrieved %d items from cursored search in function %s." % (len(elements), self.function))
safe = True
if self.session.settings["general"]["read_preferences_from_instance"]:
safe = self.session.expand_spoilers == False
if self.session.settings["general"]["reverse_timelines"] == False:
for i in elements:
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
post = self.compose_function(i.status, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.insert_item(True, *post)
else:
for i in items:
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
for i in elements:
post = self.compose_function(i.status, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.insert_item(False, *post)
self.buffer.list.select_item(selection)
output.speak(_(u"%s items retrieved") % (str(len(elements))), True)
output.speak(_(u"%s items retrieved") % (str(len(elements))), True)
def put_items_on_list(self, number_of_items):
list_to_use = self.session.db[self.name]
if number_of_items == 0 and self.session.settings["general"]["persist_size"] == 0: return
log.debug("The list contains %d items " % (self.buffer.list.get_count(),))
log.debug("Putting %d items on the list" % (number_of_items,))
safe = True
if self.session.settings["general"]["read_preferences_from_instance"]:
safe = self.session.expand_spoilers == False
if self.buffer.list.get_count() == 0:
for i in list_to_use:
post = self.compose_function(i.status, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.insert_item(False, *post)
self.buffer.set_position(self.session.settings["general"]["reverse_timelines"])
elif self.buffer.list.get_count() > 0 and number_of_items > 0:
if self.session.settings["general"]["reverse_timelines"] == False:
items = list_to_use[len(list_to_use)-number_of_items:]
for i in items:
post = self.compose_function(i.status, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.insert_item(False, *post)
else:
items = list_to_use[0:number_of_items]
items.reverse()
for i in items:
post = self.compose_function(i.status, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
self.buffer.list.insert_item(True, *post)
log.debug("Now the list contains %d items " % (self.buffer.list.get_count(),))
def add_new_item(self, item):
safe = True
if self.session.settings["general"]["read_preferences_from_instance"]:
safe = self.session.expand_spoilers == False
post = self.compose_function(item.status, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], safe=safe)
if self.session.settings["general"]["reverse_timelines"] == False:
self.buffer.list.insert_item(False, *post)
else:
self.buffer.list.insert_item(True, *post)
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(post[:2]), speech=self.session.settings["reporting"]["speech_reporting"], braille=self.session.settings["reporting"]["braille_reporting"])

View File

@@ -0,0 +1,63 @@
# -*- coding: utf-8 -*-
import time
import logging
import widgetUtils
import output
from controller.buffers.mastodon.base import BaseBuffer
from sessions.mastodon import compose, templates
from wxUI import buffers
from wxUI.dialogs.mastodon import dialogs as mastodon_dialogs
log = logging.getLogger("controller.buffers.mastodon.notifications")
class NotificationsBuffer(BaseBuffer):
def get_message(self):
notification = self.get_item()
if notification == None:
return
template = self.session.settings["templates"]["notification"]
post_template = self.session.settings["templates"]["post"]
t = templates.render_notification(notification, template, post_template, relative_times=self.session.settings["general"]["relative_times"], offset_hours=self.session.db["utc_offset"])
return t
def create_buffer(self, parent, name):
self.buffer = buffers.mastodon.notificationsPanel(parent, name)
def onFocus(self, *args, **kwargs):
item = self.get_item()
if self.session.settings["general"]["relative_times"] == True:
original_date = arrow.get(self.session.db[self.name][self.buffer.list.get_selected()].created_at)
ts = original_date.humanize(locale=languageHandler.getLanguage())
self.buffer.list.list.SetItem(self.buffer.list.get_selected(), 1, ts)
def bind_events(self):
widgetUtils.connect_event(self.buffer.list.list, widgetUtils.KEYPRESS, self.get_event)
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.post_status, self.buffer.post)
widgetUtils.connect_event(self.buffer, widgetUtils.BUTTON_PRESSED, self.destroy_status, self.buffer.dismiss)
def fav(self):
pass
def unfav(self):
pass
def can_share(self):
return False
def destroy_status(self, *args, **kwargs):
index = self.buffer.list.get_selected()
item = self.session.db[self.name][index]
answer = mastodon_dialogs.delete_notification_dialog()
if answer == False:
return
items = self.session.db[self.name]
try:
self.session.api.notifications_dismiss(id=item.id)
items.pop(index)
self.buffer.list.remove_item(index)
output.speak(_("Notification dismissed."))
except Exception as e:
self.session.sound.play("error.ogg")
log.exception("")
self.session.db[self.name] = items

View File

@@ -75,7 +75,6 @@ class UserBuffer(BaseBuffer):
log.debug("Starting stream for buffer %s, account %s and type %s" % (self.name, self.account, self.type))
log.debug("args: %s, kwargs: %s" % (self.args, self.kwargs))
count = self.session.settings["general"]["max_posts_per_call"]
# toDo: Implement reverse timelines properly here.
try:
results = getattr(self.session.api, self.function)(limit=count, *self.args, **self.kwargs)
if hasattr(results, "_pagination_next") and self.name not in self.session.db["pagination_info"]:
@@ -127,7 +126,7 @@ class UserBuffer(BaseBuffer):
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
self.buffer.list.insert_item(True, *post)
else:
for i in items:
for i in elements:
post = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"])
self.buffer.list.insert_item(False, *post)
self.buffer.list.select_item(selection)

View File

@@ -457,7 +457,7 @@ class BaseBuffer(base.Buffer):
def _retweet_with_comment(self, tweet, id):
if hasattr(tweet, "retweeted_status"):
tweet = tweet.retweeted_status
retweet = messages.tweet(session=self.session, title=_("Quote"), caption=_("Add your comment to the tweet"), max=256, thread_mode=False)
retweet = messages.tweet(session=self.session, title=_("Quote"), caption=_("Add your comment to the tweet"), thread_mode=False)
if retweet.message.ShowModal() == widgetUtils.OK:
text = retweet.message.text.GetValue()
tweet_data = dict(text=text, attachments=retweet.attachments, poll_period=retweet.poll_period, poll_options=retweet.poll_options)

View File

@@ -87,14 +87,7 @@ class DirectMessagesBuffer(base.BaseBuffer):
output.speak(_(u"%s items retrieved") % (total), True)
def reply(self, *args, **kwargs):
tweet = self.get_right_tweet()
screen_name = self.session.get_user(tweet.message_create["sender_id"]).screen_name
message = messages.reply(session=self.session, title=_("Mention"), caption=_("Mention to %s") % (screen_name,), text="@%s " % (screen_name,), thread_mode=False, users=[screen_name,])
if message.message.ShowModal() == widgetUtils.OK:
tweet_data = message.get_tweet_data()
call_threaded(self.session.send_tweet, tweet_data)
if hasattr(message.message, "destroy"):
message.message.destroy()
return self.send_message()
def onFocus(self, *args, **kwargs):
tweet = self.get_tweet()

View File

@@ -152,7 +152,7 @@ class Controller(object):
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.edit_keystrokes, menuitem=self.view.keystroke_editor)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.post_tweet, self.view.compose)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.post_reply, self.view.reply)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.post_retweet, self.view.retweet)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.post_retweet, self.view.share)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.add_to_favourites, self.view.fav)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.remove_from_favourites, self.view.unfav)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.view_item, self.view.view)
@@ -234,6 +234,8 @@ class Controller(object):
self.accounts = []
# This saves the current account (important in invisible mode)
self.current_account = ""
# this saves current menu bar layout.
self.menubar_current_handler = ""
# Handlers are special objects as they manage the mapping of available features and events in different social networks.
self.handlers = dict()
self.view.prepare()
@@ -284,6 +286,9 @@ class Controller(object):
self.started = True
self.streams_checker_function = RepeatingTimer(60, self.check_streams)
self.streams_checker_function.start()
if len(self.accounts) > 0:
b = self.get_first_buffer(self.accounts[0])
self.update_menus(handler=self.get_handler(b.session.type))
def create_ignored_session_buffer(self, session):
pub.sendMessage("core.create_account", name=session.get_name(), session_id=session.session_id)
@@ -300,7 +305,6 @@ class Controller(object):
session.start_streaming()
def create_account_buffer(self, name, session_id, logged=False):
self.accounts.append(name)
account = buffers.base.AccountBuffer(self.view.nb, name, name, session_id)
if logged == False:
account.logged = logged
@@ -429,7 +433,8 @@ class Controller(object):
output.speak("Unable to seek.",True)
def edit_keystrokes(self, *args, **kwargs):
editor = keystrokeEditor.KeystrokeEditor()
buffer = self.get_best_buffer()
editor = keystrokeEditor.KeystrokeEditor(buffer.session.type)
if editor.changed == True:
config.keymap.write()
register = False
@@ -676,8 +681,15 @@ class Controller(object):
def buffer_changed(self, *args, **kwargs):
buffer = self.get_current_buffer()
if buffer.account != self.current_account:
old_account = self.current_account
new_account = buffer.account
if new_account != old_account:
self.current_account = buffer.account
new_first_buffer = self.get_first_buffer(new_account)
if new_first_buffer != None and new_first_buffer.session.type != self.menubar_current_handler:
handler = self.get_handler(new_first_buffer.session.type)
self.menubar_current_handler = new_first_buffer.session.type
self.update_menus(handler)
if not hasattr(buffer, "session") or buffer.session == None:
return
muted = autoread = False
@@ -688,6 +700,19 @@ class Controller(object):
self.view.check_menuitem("mute_buffer", muted)
self.view.check_menuitem("autoread", autoread)
def update_menus(self, handler):
if hasattr(handler, "menus"):
for m in list(handler.menus.keys()):
if hasattr(self.view, m):
menu_item = getattr(self.view, m)
if handler.menus[m] == None:
menu_item.Enable(False)
else:
menu_item.Enable(True)
menu_item.SetItemLabel(handler.menus[m])
if hasattr(handler, "item_menu"):
self.view.menubar.SetMenuLabel(1, handler.item_menu)
def fix_wrong_buffer(self):
buf = self.get_best_buffer()
if buf == None:
@@ -1057,8 +1082,9 @@ class Controller(object):
for i in sm.removed_sessions:
if sessions.sessions[i].logged == True:
self.logout_account(sessions.sessions[i].session_id)
self.destroy_buffer(sessions.sessions[i].settings["twitter"]["user_name"], sessions.sessions[i].settings["twitter"]["user_name"])
self.accounts.remove(sessions.sessions[i].settings["twitter"]["user_name"])
self.destroy_buffer(sessions.sessions[i].get_name(), sessions.sessions[i].get_name())
if sessions.sessions[i].get_name() in self.accounts:
self.accounts.remove(sessions.sessions[i].get_name())
sessions.sessions.pop(i)
def update_profile(self, *args, **kwargs):
@@ -1208,7 +1234,7 @@ class Controller(object):
self.notify(buffer.session, sound_to_play)
def toggle_share_settings(self, shareable=True):
self.view.retweet.Enable(shareable)
self.view.share.Enable(shareable)
def check_streams(self):
if self.started == False:
@@ -1239,6 +1265,7 @@ class Controller(object):
elif buff == "direct_messages": sound_to_play = "dm_received.ogg"
elif buff == "sent": sound_to_play = "tweet_send.ogg"
elif buff == "followers" or buff == "following": sound_to_play = "update_followers.ogg"
elif buff == "notifications": sound_to_play = "new_event.ogg"
elif "timeline" in buff: sound_to_play = "tweet_timeline.ogg"
else: sound_to_play = None
if sound_to_play != None and buff not in buffer.session.settings["other_buffers"]["muted_buffers"]:

View File

@@ -2,12 +2,13 @@
import wx
import logging
from pubsub import pub
from mysc import restart
from wxUI.dialogs.mastodon import dialogs
from wxUI.dialogs.mastodon import search as search_dialogs
from wxUI.dialogs.mastodon import dialogs
from wxUI import commonMessageDialogs
from sessions.twitter import utils
from . import userActions
from . import userActions, settings
log = logging.getLogger("controller.mastodon.handler")
@@ -15,10 +16,47 @@ class Handler(object):
def __init__(self):
super(Handler, self).__init__()
# Structure to hold names for menu bar items.
# empty names mean the item will be Disabled.
self.menus = dict(
# In application menu.
updateProfile=None,
menuitem_search=_("&Search"),
lists=None,
manageAliases=None,
# In item menu.
compose=_("&Post"),
reply=_("Re&ply"),
share=_("&Boost"),
fav=_("&Add to favorites"),
unfav=_("Remove from favorites"),
view=_("&Show post"),
view_coordinates=None,
view_conversation=_("View conversa&tion"),
ocr=None,
delete=_("&Delete"),
# In user menu.
follow=_("&Actions..."),
timeline=_("&View timeline..."),
dm=_("Direct me&ssage"),
addAlias=None,
addToList=None,
removeFromList=None,
viewLists=None,
details=None,
favs=None,
# In buffer Menu.
trends=None,
filter=None,
manage_filters=None
)
# Name for the "tweet" menu in the menu bar.
self.item_menu = _("&Post")
def create_buffers(self, session, createAccounts=True, controller=None):
session.get_user_info()
name = session.get_name()
controller.accounts.append(name)
if createAccounts == True:
pub.sendMessage("core.create_account", name=name, session_id=session.session_id, logged=True)
root_position =controller.view.search(name, name)
@@ -47,14 +85,16 @@ class Handler(object):
pub.sendMessage("createBuffer", buffer_type="UserBuffer", session_type=session.type, buffer_title=_("Muted users"), parent_tab=root_position, start=False, kwargs=dict(parent=controller.view.nb, compose_func="compose_user", function="mutes", name="muted", sessionObject=session, account=name))
elif i == 'blocked':
pub.sendMessage("createBuffer", buffer_type="UserBuffer", session_type=session.type, buffer_title=_("Blocked users"), parent_tab=root_position, start=False, kwargs=dict(parent=controller.view.nb, compose_func="compose_user", function="blocks", name="blocked", sessionObject=session, account=name))
elif i == 'notifications':
pub.sendMessage("createBuffer", buffer_type="NotificationsBuffer", session_type=session.type, buffer_title=_("Notifications"), parent_tab=root_position, start=False, kwargs=dict(parent=controller.view.nb, compose_func="compose_notification", function="notifications", name="notifications", sessionObject=session, account=name))
pub.sendMessage("createBuffer", buffer_type="EmptyBuffer", session_type="base", buffer_title=_("Timelines"), parent_tab=root_position, start=False, kwargs=dict(parent=controller.view.nb, name="timelines", account=name))
timelines_position =controller.view.search("timelines", name)
for i in session.settings["other_buffers"]["timelines"]:
pub.sendMessage("createBuffer", buffer_type="BaseBuffer", session_type=session.type, buffer_title=i, parent_tab=timelines_position, start=False, kwargs=dict(parent=controller.view.nb, function="account_statuses", name="%s-timeline".format(i), sessionObject=session, account=name, sound="tweet_timeline.ogg", id=i))
pub.sendMessage("createBuffer", buffer_type="BaseBuffer", session_type=session.type, buffer_title=_("Timeline for {}").format(i), parent_tab=timelines_position, start=False, kwargs=dict(parent=controller.view.nb, function="account_statuses", name="{}-timeline".format(i), sessionObject=session, account=name, sound="tweet_timeline.ogg", id=i))
for i in session.settings["other_buffers"]["followers_timelines"]:
pub.sendMessage("createBuffer", buffer_type="UserBuffer", session_type=session.type, buffer_title=_("Followers for {}").format(i), parent_tab=timelines_position, start=False, kwargs=dict(parent=controller.view.nb, compose_func="compose_user", function="account_followers", name="%s-followers" % (i,), sessionObject=session, account=name, sound="new_event.ogg", id=i))
pub.sendMessage("createBuffer", buffer_type="UserBuffer", session_type=session.type, buffer_title=_("Followers for {}").format(i), parent_tab=timelines_position, start=False, kwargs=dict(parent=controller.view.nb, compose_func="compose_user", function="account_followers", name="{}-followers".format(i,), sessionObject=session, account=name, sound="new_event.ogg", id=i))
for i in session.settings["other_buffers"]["following_timelines"]:
pub.sendMessage("createBuffer", buffer_type="UserBuffer", session_type=session.type, buffer_title=_("Following for {}").format(i), parent_tab=timelines_position, start=False, kwargs=dict(parent=controller.view.nb, compose_func="compose_user", function="account_following", name="%s-following" % (i,), sessionObject=session, account=name, sound="new_event.ogg", id=i))
pub.sendMessage("createBuffer", buffer_type="UserBuffer", session_type=session.type, buffer_title=_("Following for {}").format(i), parent_tab=timelines_position, start=False, kwargs=dict(parent=controller.view.nb, compose_func="compose_user", function="account_following", name="{}-following".format(i,), sessionObject=session, account=name, sound="new_event.ogg", id=i))
# pub.sendMessage("createBuffer", buffer_type="EmptyBuffer", session_type="base", buffer_title=_("Lists"), parent_tab=root_position, start=False, kwargs=dict(parent=controller.view.nb, name="lists", name))
# lists_position =controller.view.search("lists", session.db["user_name"])
# for i in session.settings["other_buffers"]["lists"]:
@@ -137,43 +177,53 @@ class Handler(object):
users = [user.acct for user in item.mentions if user.id != buffer.session.db["user_id"]]
if item.account.acct not in users and item.account.id != buffer.session.db["user_id"]:
users.insert(0, item.account.acct)
u = userActions.UserTimeline(buffer.session, users)
if u.dialog.ShowModal() == wx.ID_OK:
action = u.process_action()
if action == None:
return
user = u.user
if action == "posts":
if user.statuses_count == 0:
dialogs.no_posts()
return
if user.id in buffer.session.settings["other_buffers"]["timelines"]:
commonMessageDialogs.timeline_exist()
return
timelines_position =controller.view.search("timelines", buffer.session.get_name())
pub.sendMessage("createBuffer", buffer_type="BaseBuffer", session_type=buffer.session.type, buffer_title=_("Timeline for {}").format(user.username,), parent_tab=timelines_position, start=True, kwargs=dict(parent=controller.view.nb, function="account_statuses", name="%s-timeline" % (user.id,), sessionObject=buffer.session, account=buffer.session.get_name(), sound="tweet_timeline.ogg", id=user.id))
buffer.session.settings["other_buffers"]["timelines"].append(user.id)
buffer.session.sound.play("create_timeline.ogg")
elif action == "followers":
if user.followers_count == 0:
dialogs.no_followers()
return
if user.id in buffer.session.settings["other_buffers"]["followers_timelines"]:
commonMessageDialogs.timeline_exist()
return
timelines_position =controller.view.search("timelines", buffer.session.get_name())
pub.sendMessage("createBuffer", buffer_type="UserBuffer", session_type=buffer.session.type, buffer_title=_("Followers for {}").format(user.username,), parent_tab=timelines_position, start=True, kwargs=dict(parent=controller.view.nb, compose_func="compose_user", function="account_followers", name="%s-followers" % (user.id,), sessionObject=buffer.session, account=buffer.session.get_name(), sound="new_event.ogg", id=user.id))
buffer.session.settings["other_buffers"]["followers_timelines"].append(user.id)
buffer.session.sound.play("create_timeline.ogg")
elif action == "following":
if user.following_count == 0:
dialogs.no_following()
return
if user.id in buffer.session.settings["other_buffers"]["following_timelines"]:
commonMessageDialogs.timeline_exist()
return
timelines_position =controller.view.search("timelines", buffer.session.get_name())
pub.sendMessage("createBuffer", buffer_type="UserBuffer", session_type=buffer.session.type, buffer_title=_("Following for {}").format(user.username,), parent_tab=timelines_position, start=True, kwargs=dict(parent=controller.view.nb, compose_func="compose_user", function="account_following", name="%s-followers" % (user.id,), sessionObject=buffer.session, account=buffer.session.get_name(), sound="new_event.ogg", id=user.id))
buffer.session.settings["other_buffers"]["following_timelines"].append(user.id)
buffer.session.sound.play("create_timeline.ogg")
u = userActions.UserTimeline(buffer.session, users)
if u.dialog.ShowModal() == wx.ID_OK:
action = u.process_action()
if action == None:
return
user = u.user
if action == "posts":
if user.statuses_count == 0:
dialogs.no_posts()
return
if user.id in buffer.session.settings["other_buffers"]["timelines"]:
commonMessageDialogs.timeline_exist()
return
timelines_position =controller.view.search("timelines", buffer.session.get_name())
pub.sendMessage("createBuffer", buffer_type="BaseBuffer", session_type=buffer.session.type, buffer_title=_("Timeline for {}").format(user.username,), parent_tab=timelines_position, start=True, kwargs=dict(parent=controller.view.nb, function="account_statuses", name="%s-timeline" % (user.id,), sessionObject=buffer.session, account=buffer.session.get_name(), sound="tweet_timeline.ogg", id=user.id))
buffer.session.settings["other_buffers"]["timelines"].append(user.id)
buffer.session.sound.play("create_timeline.ogg")
elif action == "followers":
if user.followers_count == 0:
dialogs.no_followers()
return
if user.id in buffer.session.settings["other_buffers"]["followers_timelines"]:
commonMessageDialogs.timeline_exist()
return
timelines_position =controller.view.search("timelines", buffer.session.get_name())
pub.sendMessage("createBuffer", buffer_type="UserBuffer", session_type=buffer.session.type, buffer_title=_("Followers for {}").format(user.username,), parent_tab=timelines_position, start=True, kwargs=dict(parent=controller.view.nb, compose_func="compose_user", function="account_followers", name="%s-followers" % (user.id,), sessionObject=buffer.session, account=buffer.session.get_name(), sound="new_event.ogg", id=user.id))
buffer.session.settings["other_buffers"]["followers_timelines"].append(user.id)
buffer.session.sound.play("create_timeline.ogg")
elif action == "following":
if user.following_count == 0:
dialogs.no_following()
return
if user.id in buffer.session.settings["other_buffers"]["following_timelines"]:
commonMessageDialogs.timeline_exist()
return
timelines_position =controller.view.search("timelines", buffer.session.get_name())
pub.sendMessage("createBuffer", buffer_type="UserBuffer", session_type=buffer.session.type, buffer_title=_("Following for {}").format(user.username,), parent_tab=timelines_position, start=True, kwargs=dict(parent=controller.view.nb, compose_func="compose_user", function="account_following", name="%s-followers" % (user.id,), sessionObject=buffer.session, account=buffer.session.get_name(), sound="new_event.ogg", id=user.id))
buffer.session.settings["other_buffers"]["following_timelines"].append(user.id)
buffer.session.sound.play("create_timeline.ogg")
buffer.session.settings.write()
def account_settings(self, buffer, controller):
d = settings.accountSettingsController(buffer, controller)
if d.response == wx.ID_OK:
d.save_configuration()
if d.needs_restart == True:
commonMessageDialogs.needs_restart()
buffer.session.settings.write()
buffer.session.save_persistent_data()
restart.restart_program()

View File

@@ -185,6 +185,11 @@ class post(messages.basicTweet):
visibility_settings = ["public", "unlisted", "private", "direct"]
return visibility_settings[self.message.visibility.GetSelection()]
def set_visibility(self, setting):
visibility_settings = ["public", "unlisted", "private", "direct"]
visibility_setting = visibility_settings.index(setting)
self.message.visibility.SetSelection(setting)
class viewPost(post):
def __init__(self, post, offset_hours=0, date="", item_url=""):
if post.reblog != None:

View File

@@ -0,0 +1,218 @@
# -*- coding: utf-8 -*-
import os
import threading
import logging
import sound_lib
import paths
import widgetUtils
import output
from collections import OrderedDict
from wxUI import commonMessageDialogs
from wxUI.dialogs.mastodon import configuration
from extra.autocompletionUsers import scan, manage
from extra.ocr import OCRSpace
from controller.settings import globalSettingsController
from . templateEditor import EditTemplate
log = logging.getLogger("Settings")
class accountSettingsController(globalSettingsController):
def __init__(self, buffer, window):
self.user = buffer.session.db["user_name"]
self.buffer = buffer
self.window = window
self.config = buffer.session.settings
self.dialog = configuration.configurationDialog()
self.create_config()
self.needs_restart = False
self.is_started = True
def create_config(self):
self.dialog.create_general_account()
# widgetUtils.connect_event(self.dialog.general.userAutocompletionScan, widgetUtils.BUTTON_PRESSED, self.on_autocompletion_scan)
# widgetUtils.connect_event(self.dialog.general.userAutocompletionManage, widgetUtils.BUTTON_PRESSED, self.on_autocompletion_manage)
self.dialog.set_value("general", "relative_time", self.config["general"]["relative_times"])
self.dialog.set_value("general", "read_preferences_from_instance", self.config["general"]["read_preferences_from_instance"])
self.dialog.set_value("general", "show_screen_names", self.config["general"]["show_screen_names"])
self.dialog.set_value("general", "hide_emojis", self.config["general"]["hide_emojis"])
self.dialog.set_value("general", "itemsPerApiCall", self.config["general"]["max_posts_per_call"])
self.dialog.set_value("general", "reverse_timelines", self.config["general"]["reverse_timelines"])
boost_mode = self.config["general"]["boost_mode"]
if boost_mode == "ask":
self.dialog.set_value("general", "ask_before_boost", True)
else:
self.dialog.set_value("general", "ask_before_boost", False)
self.dialog.set_value("general", "persist_size", str(self.config["general"]["persist_size"]))
self.dialog.set_value("general", "load_cache_in_memory", self.config["general"]["load_cache_in_memory"])
self.dialog.create_reporting()
self.dialog.set_value("reporting", "speech_reporting", self.config["reporting"]["speech_reporting"])
self.dialog.set_value("reporting", "braille_reporting", self.config["reporting"]["braille_reporting"])
post_template = self.config["templates"]["post"]
conversation_template = self.config["templates"]["conversation"]
person_template = self.config["templates"]["person"]
self.dialog.create_templates(post_template=post_template, conversation_template=conversation_template, person_template=person_template)
widgetUtils.connect_event(self.dialog.templates.post, widgetUtils.BUTTON_PRESSED, self.edit_post_template)
widgetUtils.connect_event(self.dialog.templates.conversation, widgetUtils.BUTTON_PRESSED, self.edit_conversation_template)
widgetUtils.connect_event(self.dialog.templates.person, widgetUtils.BUTTON_PRESSED, self.edit_person_template)
self.dialog.create_other_buffers()
buffer_values = self.get_buffers_list()
self.dialog.buffers.insert_buffers(buffer_values)
self.dialog.buffers.connect_hook_func(self.toggle_buffer_active)
widgetUtils.connect_event(self.dialog.buffers.toggle_state, widgetUtils.BUTTON_PRESSED, self.toggle_state)
widgetUtils.connect_event(self.dialog.buffers.up, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.move_up)
widgetUtils.connect_event(self.dialog.buffers.down, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.move_down)
self.input_devices = sound_lib.input.Input.get_device_names()
self.output_devices = sound_lib.output.Output.get_device_names()
self.soundpacks = []
[self.soundpacks.append(i) for i in os.listdir(paths.sound_path()) if os.path.isdir(os.path.join(paths.sound_path(), i)) == True ]
self.dialog.create_sound(self.input_devices, self.output_devices, self.soundpacks)
self.dialog.set_value("sound", "volumeCtrl", int(self.config["sound"]["volume"]*100))
self.dialog.set_value("sound", "input", self.config["sound"]["input_device"])
self.dialog.set_value("sound", "output", self.config["sound"]["output_device"])
self.dialog.set_value("sound", "session_mute", self.config["sound"]["session_mute"])
self.dialog.set_value("sound", "soundpack", self.config["sound"]["current_soundpack"])
self.dialog.set_value("sound", "indicate_audio", self.config["sound"]["indicate_audio"])
self.dialog.set_value("sound", "indicate_img", self.config["sound"]["indicate_img"])
self.dialog.create_extras(OCRSpace.translatable_langs)
language_index = OCRSpace.OcrLangs.index(self.config["mysc"]["ocr_language"])
self.dialog.extras.ocr_lang.SetSelection(language_index)
self.dialog.realize()
self.dialog.set_title(_("Account settings for %s") % (self.user,))
self.response = self.dialog.get_response()
def edit_post_template(self, *args, **kwargs):
template = self.config["templates"]["post"]
control = EditTemplate(template=template, type="post")
result = control.run_dialog()
if result != "": # Template has been saved.
self.config["templates"]["post"] = result
self.config.write()
self.dialog.templates.post.SetLabel(_("Edit template for posts. Current template: {}").format(result))
def edit_conversation_template(self, *args, **kwargs):
template = self.config["templates"]["conversation"]
control = EditTemplate(template=template, type="conversation")
result = control.run_dialog()
if result != "": # Template has been saved.
self.config["templates"]["conversation"] = result
self.config.write()
self.dialog.templates.conversation.SetLabel(_("Edit template for conversations. Current template: {}").format(result))
def edit_person_template(self, *args, **kwargs):
template = self.config["templates"]["person"]
control = EditTemplate(template=template, type="person")
result = control.run_dialog()
if result != "": # Template has been saved.
self.config["templates"]["person"] = result
self.config.write()
self.dialog.templates.person.SetLabel(_("Edit template for persons. Current template: {}").format(result))
def save_configuration(self):
if self.config["general"]["relative_times"] != self.dialog.get_value("general", "relative_time"):
self.needs_restart = True
log.debug("Triggered app restart due to change in relative times.")
self.config["general"]["relative_times"] = self.dialog.get_value("general", "relative_time")
self.config["general"]["read_preferences_from_instance"] = self.dialog.get_value("general", "read_preferences_from_instance")
self.config["general"]["show_screen_names"] = self.dialog.get_value("general", "show_screen_names")
self.config["general"]["hide_emojis"] = self.dialog.get_value("general", "hide_emojis")
self.config["general"]["max_posts_per_call"] = self.dialog.get_value("general", "itemsPerApiCall")
if self.config["general"]["load_cache_in_memory"] != self.dialog.get_value("general", "load_cache_in_memory"):
self.config["general"]["load_cache_in_memory"] = self.dialog.get_value("general", "load_cache_in_memory")
self.needs_restart = True
log.debug("Triggered app restart due to change in database strategy management.")
if self.config["general"]["persist_size"] != self.dialog.get_value("general", "persist_size"):
if self.dialog.get_value("general", "persist_size") == '':
self.config["general"]["persist_size"] =-1
else:
try:
self.config["general"]["persist_size"] = int(self.dialog.get_value("general", "persist_size"))
except ValueError:
output.speak("Invalid cache size, setting to default.",True)
self.config["general"]["persist_size"] =1764
if self.config["general"]["reverse_timelines"] != self.dialog.get_value("general", "reverse_timelines"):
self.needs_restart = True
log.debug("Triggered app restart due to change in timeline order.")
self.config["general"]["reverse_timelines"] = self.dialog.get_value("general", "reverse_timelines")
ask_before_boost = self.dialog.get_value("general", "ask_before_boost")
if ask_before_boost == True:
self.config["general"]["boost_mode"] = "ask"
else:
self.config["general"]["boost_mode"] = "direct"
buffers_list = self.dialog.buffers.get_list()
if buffers_list != self.config["general"]["buffer_order"]:
self.needs_restart = True
log.debug("Triggered app restart due to change in buffer ordering.")
self.config["general"]["buffer_order"] = buffers_list
self.config["reporting"]["speech_reporting"] = self.dialog.get_value("reporting", "speech_reporting")
self.config["reporting"]["braille_reporting"] = self.dialog.get_value("reporting", "braille_reporting")
self.config["mysc"]["ocr_language"] = OCRSpace.OcrLangs[self.dialog.extras.ocr_lang.GetSelection()]
if self.config["sound"]["input_device"] != self.dialog.sound.get("input"):
self.config["sound"]["input_device"] = self.dialog.sound.get("input")
try:
self.buffer.session.sound.input.set_device(self.buffer.session.sound.input.find_device_by_name(self.config["sound"]["input_device"]))
except:
self.config["sound"]["input_device"] = "default"
if self.config["sound"]["output_device"] != self.dialog.sound.get("output"):
self.config["sound"]["output_device"] = self.dialog.sound.get("output")
try:
self.buffer.session.sound.output.set_device(self.buffer.session.sound.output.find_device_by_name(self.config["sound"]["output_device"]))
except:
self.config["sound"]["output_device"] = "default"
self.config["sound"]["volume"] = self.dialog.get_value("sound", "volumeCtrl")/100.0
self.config["sound"]["session_mute"] = self.dialog.get_value("sound", "session_mute")
self.config["sound"]["current_soundpack"] = self.dialog.sound.get("soundpack")
self.config["sound"]["indicate_audio"] = self.dialog.get_value("sound", "indicate_audio")
self.config["sound"]["indicate_img"] = self.dialog.get_value("sound", "indicate_img")
self.buffer.session.sound.config = self.config["sound"]
self.buffer.session.sound.check_soundpack()
self.config.write()
def toggle_state(self,*args,**kwargs):
return self.dialog.buffers.change_selected_item()
def on_autocompletion_scan(self, *args, **kwargs):
configuration = scan.autocompletionScan(self.buffer.session.settings, self.buffer, self.window)
to_scan = configuration.show_dialog()
if to_scan == True:
configuration.prepare_progress_dialog()
t = threading.Thread(target=configuration.scan)
t.start()
def on_autocompletion_manage(self, *args, **kwargs):
configuration = manage.autocompletionManage(self.buffer.session)
configuration.show_settings()
def get_buffers_list(self):
all_buffers=OrderedDict()
all_buffers['home']=_("Home")
all_buffers['local'] = _("Local")
all_buffers['federated'] = _("Federated")
all_buffers['mentions']=_("Mentions")
all_buffers['direct_messages']=_("Direct Messages")
all_buffers['sent']=_("Sent")
all_buffers['favorites']=_("Favorites")
all_buffers['bookmarks']=_("Bookmarks")
all_buffers['followers']=_("Followers")
all_buffers['following']=_("Following")
all_buffers['blocked']=_("Blocked users")
all_buffers['muted']=_("Muted users")
all_buffers['notifications']=_("Notifications")
list_buffers = []
hidden_buffers=[]
all_buffers_keys = list(all_buffers.keys())
# Check buffers shown first.
for i in self.config["general"]["buffer_order"]:
if i in all_buffers_keys:
list_buffers.append((i, all_buffers[i], True))
# This second pass will retrieve all hidden buffers.
for i in all_buffers_keys:
if i not in self.config["general"]["buffer_order"]:
hidden_buffers.append((i, all_buffers[i], False))
list_buffers.extend(hidden_buffers)
return list_buffers
def toggle_buffer_active(self, ev):
change = self.dialog.buffers.get_event(ev)
if change == True:
self.dialog.buffers.change_selected_item()

View File

@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
import re
import wx
from typing import List
from sessions.mastodon.templates import post_variables, conversation_variables, person_variables
from wxUI.dialogs.twitterDialogs import templateDialogs
class EditTemplate(object):
def __init__(self, template: str, type: str) -> None:
super(EditTemplate, self).__init__()
self.default_template = template
if type == "post":
self.variables = post_variables
elif type == "conversation":
self.variables = conversation_variables
else:
self.variables = person_variables
self.template: str = template
def validate_template(self, template: str) -> bool:
used_variables: List[str] = re.findall("\$\w+", template)
validated: bool = True
for var in used_variables:
if var[1:] not in self.variables:
validated = False
return validated
def run_dialog(self) -> str:
dialog = templateDialogs.EditTemplateDialog(template=self.template, variables=self.variables, default_template=self.default_template)
response = dialog.ShowModal()
if response == wx.ID_SAVE:
validated: bool = self.validate_template(dialog.template.GetValue())
if validated == False:
templateDialogs.invalid_template()
self.template = dialog.template.GetValue()
return self.run_dialog()
else:
return dialog.template.GetValue()
else:
return ""

View File

@@ -16,10 +16,47 @@ class Handler(object):
def __init__(self):
super(Handler, self).__init__()
# Structure to hold names for menu bar items.
# empty names mean the item will be Disabled.
self.menus = dict(
# In application menu.
updateProfile=_("&Update profile"),
menuitem_search=_("&Search"),
lists=_("&Lists manager"),
manageAliases=_("Manage user aliases"),
# In Item Menu.
compose=_("&Tweet"),
reply=_("Re&ply"),
share=_("&Retweet"),
fav=_("&Like"),
unfav=_("&Unlike"),
view=_("&Show tweet"),
view_coordinates=_("View &address"),
view_conversation=_("View conversa&tion"),
ocr=_("Read text in picture"),
delete=_("&Delete"),
# In user menu.
follow=_("&Actions..."),
timeline=_("&View timeline..."),
dm=_("Direct me&ssage"),
addAlias=_("Add a&lias"),
addToList=_("&Add to list"),
removeFromList=_("R&emove from list"),
viewLists=_("&View lists"),
details=_("Show user &profile"),
favs=_("View likes"),
# In buffer menu.
trends=_("New &trending topics buffer..."),
filter=_("Create a &filter"),
manage_filters=_("&Manage filters"),
)
# Name for the "tweet" menu in the menu bar.
self.item_menu = _("&Tweet")
def create_buffers(self, session, createAccounts=True, controller=None):
session.get_user_info()
name = session.get_name()
controller.accounts.append(name)
if createAccounts == True:
pub.sendMessage("core.create_account", name=name, session_id=session.session_id, logged=True)
root_position =controller.view.search(name, name)

View File

@@ -4,15 +4,15 @@ from __future__ import absolute_import
from __future__ import unicode_literals
import sys
from . import fix_arrow # A few new locales for Three languages in arrow.
from . import fix_libloader # Regenerates comcache properly.
#from . import fix_libloader # Regenerates comcache properly.
from . import fix_urllib3_warnings # Avoiding some SSL warnings related to Twython.
from . import fix_win32com
#from . import fix_win32com
#from . import fix_requests #fix cacert.pem location for TWBlue binary copies
def setup():
fix_arrow.fix()
if hasattr(sys, "frozen"):
fix_libloader.fix()
fix_win32com.fix()
# if hasattr(sys, "frozen"):
# fix_libloader.fix()
# fix_win32com.fix()
# fix_requests.fix()
# else:
# fix_requests.fix(False)

View File

@@ -1,3 +1 @@
from __future__ import absolute_import
from __future__ import unicode_literals
from .keystrokeEditor import KeystrokeEditor

View File

@@ -0,0 +1 @@
from . import twitter, mastodon

View File

@@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
actions = {
"up": _(u"Go up in the current buffer"),
"down": _(u"Go down in the current buffer"),
"left": _(u"Go to the previous buffer"),
"right": _(u"Go to the next buffer"),
"next_account": _(u"Focus the next session"),
"previous_account": _(u"Focus the previous session"),
"show_hide": _(u"Show or hide the GUI"),
"post_tweet": _("Make a new post"),
"post_reply": _(u"Reply"),
"post_retweet": _(u"Boost"),
"send_dm": _(u"Send direct message"),
"add_to_favourites": _("Add post to favorites"),
"remove_from_favourites": _(u"Remove post from favorites"),
"toggle_like": _("Add/remove post from favorites"),
"follow": _(u"Open the user actions dialogue"),
# "user_details": _(u"See user details"),
"view_item": _(u"Show post"),
"exit": _(u"Quit"),
"open_timeline": _(u"Open user timeline"),
"remove_buffer": _(u"Destroy buffer"),
"interact": _(u"Interact with the currently focused post."),
"url": _(u"Open URL"),
"open_in_browser": _(u"View in browser"),
"volume_up": _(u"Increase volume by 5%"),
"volume_down": _(u"Decrease volume by 5%"),
"go_home": _(u"Jump to the first element of a buffer"),
"go_end": _(u"Jump to the last element of the current buffer"),
"go_page_up": _(u"Jump 20 elements up in the current buffer"),
"go_page_down": _(u"Jump 20 elements down in the current buffer"),
# "update_profile": _(u"Edit profile"),
"delete": _("Delete post"),
"clear_buffer": _(u"Empty the current buffer"),
"repeat_item": _(u"Repeat last item"),
"copy_to_clipboard": _(u"Copy to clipboard"),
# "add_to_list": _(u"Add to list"),
# "remove_from_list": _(u"Remove from list"),
"toggle_buffer_mute": _(u"Mute/unmute the active buffer"),
"toggle_session_mute": _(u"Mute/unmute the current session"),
"toggle_autoread": _(u"toggle the automatic reading of incoming tweets in the active buffer"),
"search": _(u"Search on instance"),
"find": _(u"Find a string in the currently focused buffer"),
"edit_keystrokes": _(u"Show the keystroke editor"),
# "view_user_lists": _(u"Show lists for a specified user"),
"get_more_items": _(u"load previous items"),
# "get_trending_topics": _(u"Create a trending topics buffer"),
"open_conversation": _(u"View conversation"),
"check_for_updates": _(u"Check and download updates"),
"configuration": _(u"Opens the global settings dialogue"),
# "list_manager": _(u"Opens the list manager"),
"accountConfiguration": _(u"Opens the account settings dialogue"),
"audio": _(u"Try to play a media file"),
"update_buffer": _(u"Updates the buffer and retrieves possible lost items there."),
# "ocr_image": _(u"Extracts the text from a picture and displays the result in a dialog."),
# "add_alias": _("Adds an alias to an user"),
}

View File

@@ -53,7 +53,7 @@ actions = {
"configuration": _(u"Opens the global settings dialogue"),
"list_manager": _(u"Opens the list manager"),
"accountConfiguration": _(u"Opens the account settings dialogue"),
"audio": _(u"Try to play an audio file"),
"audio": _(u"Try to play a media file"),
"update_buffer": _(u"Updates the buffer and retrieves possible lost items there."),
"ocr_image": _(u"Extracts the text from a picture and displays the result in a dialog."),
"add_alias": _("Adds an alias to an user"),

View File

@@ -2,18 +2,19 @@
import widgetUtils
import config
from . import wx_ui
from . import constants
from . import actions
from pubsub import pub
class KeystrokeEditor(object):
def __init__(self):
def __init__(self, session_type="twitter"):
super(KeystrokeEditor, self).__init__()
self.actions = getattr(actions, session_type).actions
self.changed = False # Change it if the keyboard shorcuts are reassigned.
self.dialog = wx_ui.keystrokeEditorDialog()
self.map = config.keymap["keymap"]
# we need to copy the keymap before modify it, for unregistering the old keystrokes if is needed.
self.hold_map = self.map.copy()
self.dialog.put_keystrokes(constants.actions, self.map)
self.dialog.put_keystrokes(self.actions, self.map)
widgetUtils.connect_event(self.dialog.edit, widgetUtils.BUTTON_PRESSED, self.edit_keystroke)
widgetUtils.connect_event(self.dialog.undefine, widgetUtils.BUTTON_PRESSED, self.undefine_keystroke)
widgetUtils.connect_event(self.dialog.execute, widgetUtils.BUTTON_PRESSED, self.execute_action)
@@ -29,7 +30,7 @@ class KeystrokeEditor(object):
if new_keystroke != self.map[action]:
self.changed = True
self.map[action] = new_keystroke
self.dialog.put_keystrokes(constants.actions, self.map)
self.dialog.put_keystrokes(self.actions, self.map)
def undefine_keystroke(self, *args, **kwargs):
action = self.dialog.actions[self.dialog.get_action()]
@@ -40,7 +41,7 @@ class KeystrokeEditor(object):
if answer == widgetUtils.YES:
self.map[action] = ""
self.changed = True
self.dialog.put_keystrokes(constants.actions, self.map)
self.dialog.put_keystrokes(self.actions, self.map)
def set_keystroke(self, keystroke, dialog):
for i in keystroke.split("+"):

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

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

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from win32com.client import GetObject
import httpcore
httpcore.SyncHTTPTransport = httpcore.AsyncHTTPProxy
import sys
import os
import platform
@@ -14,6 +15,7 @@ import paths
# ToDo: Remove this soon as this is done already when importing the paths module.
if os.path.exists(os.path.join(paths.app_path(), "Uninstall.exe")):
paths.mode="installed"
import psutil
import commandline
import config
import output
@@ -107,23 +109,19 @@ def donation():
webbrowser.open_new_tab(_("https://twblue.es/donate"))
config.app["app-settings"]["donation_dialog_displayed"] = True
def is_running(pid):
"Check if the process with ID pid is running. Adapted from https://stackoverflow.com/a/568589"
WMI = GetObject('winmgmts:')
processes = WMI.InstancesOf('Win32_Process')
return [process.Properties_('ProcessID').Value for process in processes if process.Properties_('ProcessID').Value == pid]
def check_pid():
"Insures that only one copy of the application is running at a time."
"Ensures that only one copy of the application is running at a time."
pidpath = os.path.join(os.getenv("temp"), "{}.pid".format(application.name))
if os.path.exists(pidpath):
with open(pidpath) as fin:
pid = int(fin.read())
if is_running(pid):
# Display warning dialog
commonMessageDialogs.common_error(_(u"{0} is already running. Close the other instance before starting this one. If you're sure that {0} isn't running, try deleting the file at {1}. If you're unsure of how to do this, contact the {0} developers.").format(application.name, pidpath))
sys.exit(1)
else:
try:
p = psutil.Process(pid=pid)
if p.is_running():
# Display warning dialog
commonMessageDialogs.common_error(_("{0} is already running. Close the other instance before starting this one. If you're sure that {0} isn't running, try deleting the file at {1}. If you're unsure of how to do this, contact the {0} developers.").format(application.name, pidpath))
sys.exit(1)
except psutil.NoSuchProcess:
commonMessageDialogs.dead_pid()
# Write the new PID
with open(pidpath,"w") as cam:

View File

@@ -6,11 +6,13 @@ ignored_clients = list(default=list())
[general]
relative_times = boolean(default=True)
read_preferences_from_instance = boolean(default=True)
max_posts_per_call = integer(default=40)
reverse_timelines = boolean(default=False)
persist_size = integer(default=0)
load_cache_in_memory=boolean(default=True)
show_screen_names = boolean(default=False)
hide_emojis = boolean(default=False)
buffer_order = list(default=list('home', 'local', 'mentions', 'direct_messages', 'sent', 'favorites', 'bookmarks', 'followers', 'following', 'blocked', 'muted', 'notifications'))
boost_mode = string(default="ask")
@@ -47,6 +49,7 @@ speech_reporting = boolean(default=True)
post = string(default="$display_name, $safe_text $image_descriptions $date. $visibility. $source")
person = string(default="$display_name (@$screen_name). $followers followers, $following following, $posts posts. Joined $created_at.")
conversation = string(default="Conversation with $users. Last message: $last_post")
notification = string(default="$display_name $text, $date")
[filters]

View File

@@ -3,12 +3,14 @@
import time
import os
import logging
import shutil
import widgetUtils
import sessions
import output
import paths
import config_utils
import config
import application
from pubsub import pub
from tweepy.errors import TweepyException
from controller import settings
@@ -65,12 +67,14 @@ class sessionManagerController(object):
os.exception("Exception thrown while removing malformed session")
continue
if config_test.get("twitter") != None:
if application.twitter_support_enabled == False:
continue
name = _("{account_name} (Twitter)").format(account_name=config_test["twitter"]["user_name"])
if config_test["twitter"]["user_key"] != "" and config_test["twitter"]["user_secret"] != "":
sessionsList.append(name)
self.sessions.append(dict(type="twitter", id=i))
elif config_test.get("mastodon") != None:
name = _("{account_name} (Mastodon)").format(account_name=config_test["mastodon"]["user_name"])
name = _("{account_name}@{instance} (Mastodon)").format(account_name=config_test["mastodon"]["user_name"], instance=config_test["mastodon"]["instance"].replace("https://", ""))
if config_test["mastodon"]["instance"] != "" and config_test["mastodon"]["access_token"] != "":
sessionsList.append(name)
self.sessions.append(dict(type="mastodon", id=i))
@@ -98,6 +102,8 @@ class sessionManagerController(object):
continue
# Create the session object based in session type.
if i.get("type") == "twitter":
if application.twitter_support_enabled == False:
continue
s = TwitterSession.Session(i.get("id"))
elif i.get("type") == "mastodon":
s = MastodonSession.Session(i.get("id"))

View File

@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
""" Base GUI (Wx) class for the Session manager module."""
import wx
import application
from pubsub import pub
from multiplatform_widgets import widgets
@@ -50,9 +51,10 @@ class sessionManagerWindow(wx.Dialog):
def on_new_account(self, *args, **kwargs):
menu = wx.Menu()
twitter = menu.Append(wx.ID_ANY, _("Twitter"))
if application.twitter_support_enabled:
twitter = menu.Append(wx.ID_ANY, _("Twitter"))
menu.Bind(wx.EVT_MENU, self.on_new_twitter_account, twitter)
mastodon = menu.Append(wx.ID_ANY, _("Mastodon"))
menu.Bind(wx.EVT_MENU, self.on_new_twitter_account, twitter)
menu.Bind(wx.EVT_MENU, self.on_new_mastodon_account, mastodon)
self.PopupMenu(menu, self.new.GetPosition())
@@ -64,6 +66,8 @@ class sessionManagerWindow(wx.Dialog):
pub.sendMessage("sessionmanager.new_account", type="mastodon")
def on_new_twitter_account(self, *args, **kwargs):
if application.twitter_support_enabled == False:
return
dlg = wx.MessageDialog(self, _(u"The request to authorize your Twitter account will be opened in your browser. You only need to do this once. Would you like to continue?"), _(u"Authorization"), wx.YES_NO)
response = dlg.ShowModal()
dlg.Destroy()

View File

@@ -3,7 +3,7 @@ import arrow
import languageHandler
from . import utils, templates
def compose_post(post, db, relative_times, show_screen_names):
def compose_post(post, db, relative_times, show_screen_names, safe=True):
if show_screen_names == False:
user = post.account.get("display_name")
if user == "":
@@ -16,9 +16,9 @@ def compose_post(post, db, relative_times, show_screen_names):
else:
ts = original_date.shift(hours=db["utc_offset"]).format(_("dddd, MMMM D, YYYY H:m"), locale=languageHandler.curLang[:2])
if post.reblog != None:
text = _("Boosted from @{}: {}").format(post.reblog.account.acct, templates.process_text(post.reblog))
text = _("Boosted from @{}: {}").format(post.reblog.account.acct, templates.process_text(post.reblog, safe=safe))
else:
text = templates.process_text(post)
text = templates.process_text(post, safe=safe)
source = post.get("application", "")
# "" means remote user, None for legacy apps so we should cover both sides.
if source != None and source != "":
@@ -27,7 +27,7 @@ def compose_post(post, db, relative_times, show_screen_names):
source = ""
return [user+", ", text, ts+", ", source]
def compose_user(user, db, relative_times=True, show_screen_names=False):
def compose_user(user, db, relative_times=True, show_screen_names=False, safe=False):
original_date = arrow.get(user.created_at)
if relative_times:
ts = original_date.humanize(locale=languageHandler.curLang[:2])
@@ -38,7 +38,7 @@ def compose_user(user, db, relative_times=True, show_screen_names=False):
name = user.get("username")
return [_("%s (@%s). %s followers, %s following, %s posts. Joined %s") % (name, user.acct, user.followers_count, user.following_count, user.statuses_count, ts)]
def compose_conversation(conversation, db, relative_times, show_screen_names):
def compose_conversation(conversation, db, relative_times, show_screen_names, safe=False):
users = []
for account in conversation.accounts:
if account.display_name != "":
@@ -49,3 +49,32 @@ def compose_conversation(conversation, db, relative_times, show_screen_names):
last_post = compose_post(conversation.last_status, db, relative_times, show_screen_names)
text = _("Last message from {}: {}").format(last_post[0], last_post[1])
return [users, text, last_post[-2], last_post[-1]]
def compose_notification(notification, db, relative_times, show_screen_names, safe=False):
if show_screen_names == False:
user = notification.account.get("display_name")
if user == "":
user = notification.account.get("username")
else:
user = notification.account.get("acct")
original_date = arrow.get(notification.created_at)
if relative_times:
ts = original_date.humanize(locale=languageHandler.curLang[:2])
else:
ts = original_date.shift(hours=db["utc_offset"]).format(_("dddd, MMMM D, YYYY H:m"), locale=languageHandler.curLang[:2])
text = "Unknown: %r" % (notification)
if notification.type == "status":
text = _("{username} has posted: {status}").format(username=user, status=",".join(compose_post(notification.status, db, relative_times, show_screen_names, safe=safe)))
elif notification.type == "mention":
text = _("{username} has mentionned you: {status}").format(username=user, status=",".join(compose_post(notification.status, db, relative_times, show_screen_names, safe=safe)))
elif notification.type == "reblog":
text = _("{username} has boosted: {status}").format(username=user, status=",".join(compose_post(notification.status, db, relative_times, show_screen_names, safe=safe)))
elif notification.type == "favourite":
text = _("{username} has added to favorites: {status}").format(username=user, status=",".join(compose_post(notification.status, db, relative_times, show_screen_names, safe=safe)))
elif notification.type == "follow":
text = _("{username} has followed you.").format(username=user)
elif notification.type == "poll":
text = _("A poll in which you have voted has expired: {status}").format(status=",".join(compose_post(notification.status, db, relative_times, show_screen_names, safe=safe)))
elif notification.type == "follow_request":
text = _("{username} wants to follow you.").format(username=user)
return [user, text, ts]

View File

@@ -15,7 +15,6 @@ from pubsub import pub
from mysc.thread_utils import call_threaded
from sessions import base
from sessions.mastodon import utils, streaming
from .wxUI import authorisationDialog
log = logging.getLogger("sessions.mastodonSession")
@@ -30,6 +29,8 @@ class Session(base.baseSession):
self.type = "mastodon"
self.db["pagination_info"] = dict()
self.char_limit = 500
self.post_visibility = "public"
self.expand_spoilers = False
pub.subscribe(self.on_status, "mastodon.status_received")
pub.subscribe(self.on_status_updated, "mastodon.status_updated")
pub.subscribe(self.on_notification, "mastodon.notification_received")
@@ -38,7 +39,7 @@ class Session(base.baseSession):
if self.settings["mastodon"]["access_token"] != None and self.settings["mastodon"]["instance"] != None:
try:
log.debug("Logging in to Mastodon instance {}...".format(self.settings["mastodon"]["instance"]))
self.api = mastodon.Mastodon(access_token=self.settings["mastodon"]["access_token"], api_base_url=self.settings["mastodon"]["instance"], mastodon_version=MASTODON_VERSION)
self.api = mastodon.Mastodon(access_token=self.settings["mastodon"]["access_token"], api_base_url=self.settings["mastodon"]["instance"], mastodon_version=MASTODON_VERSION, user_agent="TWBlue/{}".format(application.version))
if verify_credentials == True:
credentials = self.api.account_verify_credentials()
self.db["user_name"] = credentials["username"]
@@ -47,8 +48,8 @@ class Session(base.baseSession):
self.logged = True
log.debug("Logged.")
self.counter = 0
except IOError:
log.error("The login attempt failed.")
except MastodonError:
log.exception("The login attempt failed.")
self.logged = False
else:
self.logged = False
@@ -99,14 +100,18 @@ class Session(base.baseSession):
offset = time.timezone if (time.localtime().tm_isdst == 0) else time.altzone
offset = offset / 60 / 60 * -1
self.db["utc_offset"] = offset
instance = self.api.instance()
if len(self.supported_languages) == 0:
self.supported_languages = self.api.instance().languages
self.supported_languages = instance.languages
self.get_lists()
self.get_muted_users()
# determine instance custom characters limit.
instance = self.api.instance()
if hasattr(instance, "configuration") and hasattr(instance.configuration, "statuses") and hasattr(instance.configuration.statuses, "max_characters"):
self.char_limit = instance.configuration.statuses.max_characters
# User preferences for some things.
preferences = self.api.preferences()
self.post_visibility = preferences.get("posting:default:visibility")
self.expand_spoilers = preferences.get("reading:expand:spoilers")
self.settings.write()
def get_lists(self):
@@ -221,8 +226,14 @@ class Session(base.baseSession):
if config.app["app-settings"]["no_streaming"]:
return
listener = streaming.StreamListener(session_name=self.get_name(), user_id=self.db["user_id"])
self.user_stream = self.api.stream_user(listener, run_async=True)
self.direct_stream = self.api.stream_direct(listener, run_async=True)
try:
stream_healthy = self.api.stream_healthy()
if stream_healthy == True:
self.user_stream = self.api.stream_user(listener, run_async=True)
self.direct_stream = self.api.stream_direct(listener, run_async=True)
log.debug("Started streams for session {}.".format(self.get_name()))
except Exception as e:
log.exception("Detected streaming unhealthy in {} session.".format(self.get_name()))
def stop_streaming(self):
if config.app["app-settings"]["no_streaming"]:
@@ -279,7 +290,7 @@ class Session(base.baseSession):
obj = None
if notification.type == "mention":
buffers = ["mentions"]
obj = notification.status
obj = notification
elif notification.type == "follow":
buffers = ["followers"]
obj = notification.account
@@ -287,4 +298,8 @@ class Session(base.baseSession):
num = self.order_buffer(b, [obj])
if num == 0:
buffers.remove(b)
pub.sendMessage("mastodon.new_item", session_name=self.get_name(), item=obj, _buffers=buffers)
pub.sendMessage("mastodon.new_item", session_name=self.get_name(), item=obj, _buffers=buffers)
# Now, add notification to its buffer.
num = self.order_buffer("notifications", [notification])
if num > 0:
pub.sendMessage("mastodon.new_item", session_name=self.get_name(), item=notification, _buffers=["notifications"])

View File

@@ -12,11 +12,13 @@ from . import utils, compose
post_variables = ["date", "display_name", "screen_name", "source", "lang", "safe_text", "text", "image_descriptions", "visibility"]
person_variables = ["display_name", "screen_name", "description", "followers", "following", "favorites", "posts", "created_at"]
conversation_variables = ["users", "last_post"]
notification_variables = ["display_name", "screen_name", "text", "date"]
# Default, translatable templates.
post_default_template = _("$display_name, $text $image_descriptions $date. $source")
dm_sent_default_template = _("Dm to $recipient_display_name, $text $date")
person_default_template = _("$display_name (@$screen_name). $followers followers, $following following, $posts posts. Joined $created_at.")
notification_default_template = _("$display_name $text, $date")
def process_date(field, relative_times=True, offset_hours=0):
original_date = arrow.get(field)
@@ -134,4 +136,46 @@ def render_conversation(conversation, template, post_template, relative_times=Fa
available_data = dict(users=users, last_post=last_post)
result = Template(_(template)).safe_substitute(**available_data)
result = remove_unneeded_variables(result, conversation_variables)
return result
return result
def render_notification(notification, template, post_template, relative_times=False, offset_hours=0):
""" Renders any given notification according to the passed template.
Available data for notifications will be stored in the following variables:
$date: Creation date.
$display_name: User profile name.
$screen_name: User screen name, this is the same name used to reference the user in Twitter.
$text: Notification text, describing the action.
"""
global notification_variables
available_data = dict()
created_at = process_date(notification.created_at, relative_times, offset_hours)
available_data.update(date=created_at)
# user.
display_name = notification.account.display_name
if display_name == "":
display_name = notification.account.username
available_data.update(display_name=display_name, screen_name=notification.account.acct)
text = "Unknown: %r" % (notification)
# Remove date from status, so it won't be rendered twice.
post_template = post_template.replace("$date", "")
if notification.type == "status":
text = _("has posted: {status}").format(status=render_post(notification.status, post_template, relative_times, offset_hours))
elif notification.type == "mention":
text = _("has mentionned you: {status}").format(status=render_post(notification.status, post_template, relative_times, offset_hours))
elif notification.type == "reblog":
text = _("has boosted: {status}").format(status=render_post(notification.status, post_template, relative_times, offset_hours))
elif notification.type == "favourite":
text = _("has added to favorites: {status}").format(status=render_post(notification.status, post_template, relative_times, offset_hours))
elif notification.type == "update":
text = _("has updated a status: {status}").format(status=render_post(notification.status, post_template, relative_times, offset_hours))
elif notification.type == "follow":
text = _("has followed you.")
elif notification.type == "poll":
text = _("A poll in which you have voted has expired: {status}").format(status=render_post(notification.status, post_template, relative_times, offset_hours))
elif notification.type == "follow_request":
text = _("wants to follow you.")
available_data.update(text=text)
result = Template(_(template)).safe_substitute(**available_data)
result = remove_unneeded_variables(result, post_variables)
result = result.replace(" . ", "")
return result

View File

@@ -5,12 +5,19 @@ url_re = re.compile('<a\s*href=[\'|"](.*?)[\'"].*?>')
class HTMLFilter(HTMLParser):
text = ""
first_paragraph = True
def handle_data(self, data):
self.text += data
def handle_starttag(self, tag, attrs):
if tag == "br":
self.text = self.text+"\n"
elif tag == "p":
if self.first_paragraph:
self.first_paragraph = False
else:
self.text = self.text+"\n\n"
def html_filter(data):
f = HTMLFilter()

View File

@@ -1,35 +0,0 @@
# -*- coding: utf-8 -*-
import wx
class authorisationDialog(wx.Dialog):
def __init__(self):
super(authorisationDialog, self).__init__(parent=None, title=_(u"Authorising account..."))
panel = wx.Panel(self)
sizer = wx.BoxSizer(wx.VERTICAL)
static1 = wx.StaticText(panel, wx.NewId(), _("URL of mastodon instance:"))
self.instance = wx.TextCtrl(panel, -1)
sizer1 = wx.BoxSizer(wx.HORIZONTAL)
sizer1.Add(static1, 0, wx.ALL, 5)
sizer1.Add(self.instance, 0, wx.ALL, 5)
sizer.Add(sizer1, 0, wx.ALL, 5)
static2 = wx.StaticText(panel, wx.NewId(), _("Email address:"))
self.email = wx.TextCtrl(panel, -1)
sizer2 = wx.BoxSizer(wx.HORIZONTAL)
sizer2.Add(static2, 0, wx.ALL, 5)
sizer2.Add(self.email, 0, wx.ALL, 5)
sizer.Add(sizer2, 0, wx.ALL, 5)
static3 = wx.StaticText(panel, wx.NewId(), _("Password:"))
self.password = wx.TextCtrl(panel, -1)
sizer3 = wx.BoxSizer(wx.HORIZONTAL)
sizer3.Add(static3, 0, wx.ALL, 5)
sizer3.Add(self.password, 0, wx.ALL, 5)
sizer.Add(sizer3, 0, wx.ALL, 5)
self.ok = wx.Button(panel, wx.ID_OK)
self.cancel = wx.Button(panel, wx.ID_CANCEL)
sizer4 = wx.BoxSizer(wx.HORIZONTAL)
sizer4.Add(self.ok, 0, wx.ALL, 5)
sizer4.Add(self.cancel, 0, wx.ALL, 5)
sizer.Add(sizer4, 0, wx.ALL, 5)
panel.SetSizer(sizer)
min = sizer.CalcMin()
self.SetClientSize(min)

View File

@@ -94,8 +94,7 @@ class Session(base.baseSession):
objects = self.db["direct_messages"]
sent_objects = self.db["sent_direct_messages"]
for i in data:
# Twitter returns sender_id as str, which must be converted to int in order to match to our user_id object.
if int(i.message_create["sender_id"]) == self.db["user_id"]:
if i.message_create["sender_id"] == self.db["user_id"]:
if "sent_direct_messages" in self.db and utils.find_item(i, self.db["sent_direct_messages"]) == None:
if self.settings["general"]["reverse_timelines"] == False: sent_objects.append(i)
else: sent_objects.insert(0, i)

View File

@@ -80,11 +80,11 @@ def render_tweet(tweet, template, session, relative_times=False, offset_seconds=
available_data.update(source=tweet.source)
if hasattr(tweet, "retweeted_status"):
if hasattr(tweet.retweeted_status, "quoted_status"):
text = "RT @{}: {} Quote from @{}: {}".format(session.get_user(tweet.retweeted_status.user).screen_name, process_text(tweet.retweeted_status), session.get_user(tweet.retweeted_status.quoted_status.user).screen_name, process_text(tweet.retweeted_status.quoted_status))
text = _("RT @{}: {} Quote from @{}: {}").format(session.get_user(tweet.retweeted_status.user).screen_name, process_text(tweet.retweeted_status), session.get_user(tweet.retweeted_status.quoted_status.user).screen_name, process_text(tweet.retweeted_status.quoted_status))
else:
text = "RT @{}: {}".format(session.get_user(tweet.retweeted_status.user).screen_name, process_text(tweet.retweeted_status))
text = _("RT @{}: {}").format(session.get_user(tweet.retweeted_status.user).screen_name, process_text(tweet.retweeted_status))
elif hasattr(tweet, "quoted_status"):
text = "{} Quote from @{}: {}".format(process_text(tweet), session.get_user(tweet.quoted_status.user).screen_name, process_text(tweet.quoted_status))
text = _("{} Quote from @{}: {}").format(process_text(tweet), session.get_user(tweet.quoted_status.user).screen_name, process_text(tweet.quoted_status))
else:
text = process_text(tweet)
available_data.update(lang=tweet.lang, text=text)

View File

@@ -42,7 +42,7 @@ build_exe_options = dict(
includes=["enchant.tokenize.en"], # This is not handled automatically by cx_freeze.
include_msvcr=False,
replace_paths = [("*", "")],
include_files=["icon.ico", "conf.defaults", "app-configuration.defaults", "keymaps", "locales", "sounds", "documentation", ("keys/lib", "keys/lib"), find_sound_lib_datafiles(), find_accessible_output2_datafiles()]+get_architecture_files(),
include_files=["icon.ico", "conf.defaults", "app-configuration.defaults", "mastodon.defaults", "keymaps", "locales", "sounds", "documentation", ("keys/lib", "keys/lib"), find_sound_lib_datafiles(), find_accessible_output2_datafiles()]+get_architecture_files(),
packages=["wxUI"],
bin_path_excludes=["C:\\Program Files", "C:\Program Files (x86)"],
)

View File

@@ -1,23 +1,24 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from builtins import str
from past.utils import old_div
import wx
import sys
import application
from . import utils
progress_dialog = None
def available_update_dialog(version, description, date):
dialog = wx.MessageDialog(None, _(u"There's a new %s version available, released on %s. Would you like to download it now?\n\n %s version: %s\n\nChanges:\n%s") % (application.name, date, application.name, version, description), _(u"New version for %s") % application.name, style=wx.YES|wx.NO|wx.ICON_WARNING)
if "3.7" not in sys.version: # Modern operating systems
update_msg = _("There's a new %s version available, released on %s. Would you like to download it now?\n\n %s version: %s\n\nChanges:\n%s") % (application.name, date, application.name, version, description)
styles = wx.YES|wx.NO|wx.ICON_WARNING
else:
update_msg = _("There's a new %s version available, released on %s. Updates are not automatic in Windows 7, so you would need to visit TWBlue's download website to get the latest version.\n\n %s version: %s\n\nChanges:\n%s") % (application.name, date, application.name, version, description)
styles = wx.OK|wx.ICON_WARNING
dialog = wx.MessageDialog(None, update_msg, _("New version for %s") % application.name, style=styles)
if dialog.ShowModal() == wx.ID_YES:
return True
else:
return False
def create_progress_dialog():
return wx.ProgressDialog(_(u"Download in Progress"), _(u"Downloading the new version..."), parent=None, maximum=100)
@@ -29,7 +30,7 @@ def progress_callback(total_downloaded, total_size):
if total_downloaded == total_size:
progress_dialog.Destroy()
else:
progress_dialog.Update(old_div((total_downloaded*100),total_size), _(u"Updating... %s of %s") % (str(utils.convert_bytes(total_downloaded)), str(utils.convert_bytes(total_size))))
progress_dialog.Update(int((total_downloaded*100)/total_size), _(u"Updating... %s of %s") % (str(utils.convert_bytes(total_downloaded)), str(utils.convert_bytes(total_size))))
def update_finished():
ms = wx.MessageDialog(None, _(u"The update has been downloaded and installed successfully. Press OK to continue."), _(u"Done!")).ShowModal()

Some files were not shown because too many files have changed in this diff Show More