Compare commits

...

17 Commits

Author SHA1 Message Date
eefe5e6200 Updated snapshot information 2020-06-04 12:14:57 -05:00
492f1d8aa5 Expand URL'S in profile bios 2020-06-04 10:25:00 -05:00
ac20ced5fa Expand URL in user profiles. Closes #275 2020-06-03 12:32:01 -05:00
866cd53328 Fixed typo in changelog 2020-06-03 11:24:20 -05:00
f523e3e81e Updated changelog 2020-06-03 11:22:07 -05:00
bdd7d617c3 Update title on user changes when sending a DM. Fixes #276 2020-06-03 11:19:23 -05:00
a0bc5f6cb3 Ignore folder env for virtual environments. Closes #321 2020-05-30 08:42:30 -05:00
3f238635f2 Fixed a typo 2020-05-29 21:25:13 -05:00
c300476ad2 Updated changelog to add a reference to an issue 2020-05-29 21:22:00 -05:00
6a2e00c467 Fixed calls to paths.config_path in Autocompletion module 2020-05-29 12:37:25 -05:00
4fa983a314 Show error when loading an account with invalid or expired tokens. Fixes #328 2020-05-29 11:17:18 -05:00
ed5b66d033 Fixed audio playback from URL 2020-05-29 10:28:10 -05:00
bec45c37c1 Updated Readme instructions to Python 3 and cx_freeze 2020-05-29 10:13:28 -05:00
ad42c09fef Updated changelog 2020-05-29 09:51:34 -05:00
084fa1894c Restart TWBlue gracefully 2020-05-29 09:49:57 -05:00
6bc63d79ff Updated data for ftp stuff 2020-05-28 16:52:18 -05:00
b1f06f6b1d Fixed some params in CI script 2020-05-28 16:45:36 -05:00
15 changed files with 55 additions and 39 deletions

3
.gitignore vendored
View File

@@ -19,4 +19,5 @@ src/sounds/iOs
release-snapshot/
src/com_cache/
doc/strings.py
doc/changelog.py
doc/changelog.py
env/

View File

@@ -27,26 +27,16 @@ Although most dependencies can be found in the windows-dependencies directory, w
git submodule init
git submodule update
All the dependencies provided in this folder are prebuilt. If you want to build them from source, you will need Microsoft visual Studio 2008.
#### Dependencies packaged in windows installers
* [Python,](http://python.org) version 2.7.16
If you want to build both x86 and x64 binaries, you can install python x86 to C:\python27 and python x64 to C:\python27x64, for example.
* [PyEnchant,](http://pythonhosted.org/pyenchant/) version 1.6.6.
x64 version has been built by TWBlue developers, so you only will find it in windows-dependencies folder
The windows installers are available only in the windows-dependencies folder.
To build a binary version:
* [Py2exe](http://www.sourceforge.net/projects/py2exe/) for Python 2.7, version 0.6.9
* [Python,](http://python.org) version 3.7.7
If you want to build both x86 and x64 binaries, you can install python x86 to C:\python37 and python x64 to C:\python37x64, for example.
#### Dependencies that must be installed using pip
Python installs a tool called Pip that allows to install packages in a simple way. You can find it in the python scripts directory. To install packages using Pip, you have to navigate to the scripts directory using a command prompt, for example:
cd C:\python27x64\scripts
cd C:\python37x64\scripts
You can also add the scripts folder to your path environment variable or choose the corresponding option when installing Python.
Note: pip and setuptools are included in the Python installer since version 2.7.9.
@@ -71,7 +61,7 @@ These dependencies are located in the windows-dependencies directory. You don't
* Bootstrap 1.2.1: included in dependencies directory.
This dependency has been built using pure basic 4.61. Its source can be found at http://hg.q-continuum.net/updater
* [oggenc2.exe,](http://www.rarewares.org/ogg-oggenc.php) version 2.87
* Microsoft Visual c++ 2008 redistributable dlls.
* Microsoft Visual c++ 2017 redistributable dlls.
* VLC plugins and DLL libraries.
#### Dependencies required to build the installer
@@ -114,7 +104,7 @@ A binary version doesn't need python and the other dependencies to run, it's the
To build it, run the following command from the src folder:
python setup.py py2exe
python setup.py build
You will find the binaries in the dist directory.
@@ -122,9 +112,9 @@ To build it, run the following command from the src folder:
If you want to install TWBlue on your computer, you must create the installer first. Follow these steps:
* Navigate to the src directory, and create a binary version for x86: C:\python27\python setup.py py2exe
* Navigate to the src directory, and create a binary version for x86: C:\python37\python setup.py build
* Move the dist directory to the scripts folder in this repo, and rename it to twblue
* Repeat these steps with Python for x64: C:\python27x64\python setup.py py2exe
* Repeat these steps with Python for x64: C:\python37x64\python setup.py build
* Move the new dist directory to the scripts folder, and rename it to twblue64
* Go to the scripts folder, right click on the twblue.nsi file, and choose compyle unicode NSIS script
* This may take a while. After the process, you will find the installer in the scripts folder
@@ -137,9 +127,9 @@ Run the gen_pot.bat file, located in the tools directory. Your python installati
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:\python27\python setup.py py2exe
* 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:\python27x64\python setup.py py2exe
* 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.

View File

@@ -68,7 +68,7 @@ build_script:
- "%CMD_IN_ENV% python setup.py build"
- "cd dist"
# Zip it all.
- cmd: 7z a ..\..\snapshot_python3.zip *
- cmd: 7z a ..\..\snapshot.zip *
artifacts:
- path: snapshot.zip
@@ -78,7 +78,7 @@ deploy:
host: twblue.es
protocol: ftp
beta: true
username: twblue
username: twblue.es
password:
secure: ml/xB8YEoZ7DmjzDr+KSNw==
secure: lQZqpYRnHf4LLVOg0C42NQ==
folder: 'web/pubs'

View File

@@ -2,7 +2,12 @@
## changes in this version
* 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])
* 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))
* TWBlue has been migrated completely to Python 3 (currently, the software builds with Python 3.7).
* 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))
## Changes in version 0.95

View File

@@ -9,7 +9,7 @@ if snapshot == False:
update_url = 'https://twblue.es/updates/stable.php'
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/stable.json'
else:
version = "1"
version = "3"
update_url = 'https://twblue.es/updates/snapshot.php'
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/snapshots.json'
authors = ["Manuel Cortéz", "José Manuel Delicado"]

View File

@@ -1,9 +1,7 @@
from __future__ import unicode_literals
from audio_services import matches_url
import youtube_utils
import requests
from . import youtube_utils
@matches_url('https://audioboom.com')
def convert_audioboom(url):

View File

@@ -194,6 +194,11 @@ class dm(basicTweet):
super(dm, self).__init__(session, title, caption, text, messageType="dm", max=10000)
widgetUtils.connect_event(self.message.autocompletionButton, widgetUtils.BUTTON_PRESSED, self.autocomplete_users)
self.text_processor()
widgetUtils.connect_event(self.message.cb, widgetUtils.ENTERED_TEXT, self.user_changed)
def user_changed(self, *args, **kwargs):
self.title = _("Direct message to %s") % (self.message.get_user())
self.text_processor()
def autocomplete_users(self, *args, **kwargs):
c = autocompletionUsers.completion.autocompletionUsers(self.message, self.session.session_id)

View File

@@ -92,15 +92,18 @@ class profileController(object):
output.speak(u"Error %s. %s" % (e.error_code, e.msg))
def get_user_info(self):
string = u""
string = string + _(u"Username: @%s\n") % (self.data["screen_name"])
string = string + _(u"Name: %s\n") % (self.data["name"])
if self.data["location"] != "":
string = string + _(u"Location: %s\n") % (self.data["location"])
if self.data["url"] != None:
string = string+ _(u"URL: %s\n") % (self.data["url"])
string = string+ _(u"URL: %s\n") % (self.data["entities"]["url"]["urls"][0]["expanded_url"])
if self.data["description"] != "":
if self.data["entities"].get("description") != None and self.data["entities"]["description"].get("urls"):
for url in self.data["entities"]["description"]["urls"]:
if url["url"] in self.data["description"]:
self.data["description"] = self.data["description"].replace(url["url"], url["expanded_url"])
string = string+ _(u"Bio: %s\n") % (self.data["description"])
if self.data["protected"] == True: protected = _(u"Yes")
else: protected = _(u"No")

View File

@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from builtins import object
import sqlite3, paths
import os, sqlite3, paths
class storage(object):
def __init__(self, session_id):
self.connection = sqlite3.connect(paths.config_path("%s/autocompletionUsers.dat" % (session_id)))
self.connection = sqlite3.connect(os.path.join(paths.config_path(), "%s/autocompletionUsers.dat" % (session_id)))
self.cursor = self.connection.cursor()
if self.table_exist("users") == False:
self.create_table()

View File

@@ -1,6 +1,7 @@
# -*- coding: cp1252
from __future__ import unicode_literals
import sys, os
import application
def restart_program():
""" Function that restarts the application if is executed."""
@@ -9,4 +10,7 @@ def restart_program():
args.insert(0, sys.executable)
if sys.platform == 'win32':
args = ['"%s"' % arg for arg in args]
pidpath = os.path.join(os.getenv("temp"), "{}.pid".format(application.name))
if os.path.exists(pidpath):
os.remove(pidpath)
os.execv(sys.executable, args)

View File

@@ -21,7 +21,7 @@ from sessions.twitter import session
from . import manager
import config_utils
import config
from twython.exceptions import TwythonAuthError
log = logging.getLogger("sessionmanager.sessionManager")
class sessionManagerController(object):
@@ -85,11 +85,18 @@ class sessionManagerController(object):
s = session.Session(i)
s.get_configuration()
if i not in config.app["sessions"]["ignored_sessions"]:
s.login()
try:
s.login()
except TwythonAuthError:
self.show_auth_error(s.settings["twitter"]["user_name"])
continue
sessions.sessions[i] = s
self.new_sessions[i] = s
# self.view.destroy()
def show_auth_error(self, user_name):
error = view.auth_error(user_name)
def manage_new_account(self, *args, **kwargs):
if self.view.new_account_dialog() == widgetUtils.YES:
location = (str(time.time())[-6:])

View File

@@ -75,4 +75,7 @@ class sessionManagerWindow(wx.Dialog):
self.configuration.Hide()
def destroy(self):
self.Destroy()
self.Destroy()
def auth_error(user_name):
return wx.MessageDialog(None, _("TWBlue is unable to authenticate the account for {} in Twitter. It might be due to an invalid or expired token, revoqued access to the application, or after an account reactivation. Please remove the account manually from your Twitter sessions in order to stop seeing this message.").format(user_name,), _("Authentication error for session {}").format(user_name,), wx.OK).ShowModal()

View File

@@ -1,3 +1,3 @@
from __future__ import unicode_literals
from . import shorteners
from __main__ import *
from . __main__ import *

View File

@@ -1,6 +1,6 @@
from __future__ import unicode_literals
from functools import wraps
import shorteners
from . import shorteners
def service_selecter (func):

View File

@@ -1,5 +1,5 @@
{"current_version": "1",
{"current_version": "3",
"description": "Snapshot version.",
"date": "unknown",
"downloads":
{"Windows32": "https://twblue.es/snapshot.zip"}}
{"Windows32": "https://twblue.es/pubs/snapshot.zip"}}