Merge branch 'next-gen' of https://github.com/manuelcortez/TWBlue into next-gen

This commit is contained in:
Manuel Cortez 2016-02-02 09:09:56 -06:00
commit f49be6cfed
16 changed files with 79 additions and 80 deletions

View File

@ -35,8 +35,8 @@ Although most dependencies can be found in the windows-dependencies directory, w
* [Python,](http://python.org) version 2.7.11 * [Python,](http://python.org) version 2.7.11
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. 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.
* [wxPython](http://www.wxpython.org) for Python 2.7, version 3.0.2.0 * [wxPython](http://www.wxpython.org) for Python 2.7, version 3.0.2.0
* [Python windows extensions (pywin32)](http://www.sourceforge.net/projects/pywin32/) for python 2.7, build 219 * [Python windows extensions (pywin32)](http://www.sourceforge.net/projects/pywin32/) for python 2.7, build 220
* [Pycurl](http://pycurl.sourceforge.net) 7.19.5.3 for Python 2.7: [downloads](https://pypi.python.org/pypi/pycurl/7.19.5.3) * [Pycurl](http://pycurl.sourceforge.net) 7.21.5 for Python 2.7: [downloads](https://pypi.python.org/pypi/pycurl/7.21.5)
* [PyEnchant,](http://pythonhosted.org/pyenchant/) version 1.6.6. * [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 x64 version has been built by TWBlue developers, so you only will find it in windows-dependencies folder

View File

@ -1,7 +1,7 @@
[Launch] [Launch]
ProgramExecutable=TWBlue\TWBlue.exe ProgramExecutable=TWBlue\TWBlue.exe
ProgramExecutable64=TWBlue64\TWBlue.exe ProgramExecutable64=TWBlue64\TWBlue.exe
CommandLineArguments=-p -d "%PAL:DataDir%" CommandLineArguments=-d "%PAL:DataDir%"
SinglePortableAppInstance=true SinglePortableAppInstance=true
MinOS=XP MinOS=XP
SingleAppInstance=false SingleAppInstance=false

View File

@ -26,7 +26,6 @@ var StartMenuFolder
!define MUI_FINISHPAGE_LINK "Visit TWBlue website" !define MUI_FINISHPAGE_LINK "Visit TWBlue website"
!define MUI_FINISHPAGE_LINK_LOCATION "http://twblue.es" !define MUI_FINISHPAGE_LINK_LOCATION "http://twblue.es"
!define MUI_FINISHPAGE_RUN "$INSTDIR\TWBlue.exe" !define MUI_FINISHPAGE_RUN "$INSTDIR\TWBlue.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS "-i"
!insertmacro MUI_PAGE_FINISH !insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_INSTFILES
@ -58,10 +57,10 @@ File /r TWBlue64\*
${Else} ${Else}
File /r TWBlue\* File /r TWBlue\*
${EndIf} ${EndIf}
CreateShortCut "$DESKTOP\TWBlue.lnk" "$INSTDIR\TWBlue.exe" "-i" CreateShortCut "$DESKTOP\TWBlue.lnk" "$INSTDIR\TWBlue.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN startmenu !insertmacro MUI_STARTMENU_WRITE_BEGIN startmenu
CreateDirectory "$SMPROGRAMS\$StartMenuFolder" CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TWBlue.lnk" "$INSTDIR\TWBlue.exe" "-i" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TWBlue.lnk" "$INSTDIR\TWBlue.exe"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TWBlue on the web.lnk" "http://twblue.es" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\TWBlue on the web.lnk" "http://twblue.es"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_END !insertmacro MUI_STARTMENU_WRITE_END

View File

@ -6,13 +6,7 @@ import application
log = logging.getLogger("commandlineLauncher") log = logging.getLogger("commandlineLauncher")
parser = argparse.ArgumentParser(description=application.name+" command line launcher") parser = argparse.ArgumentParser(description=application.name+" command line launcher")
group = parser.add_mutually_exclusive_group()
group.add_argument("-p", "--portable", help="Use " + application.name + " as a portable application.", action="store_true", default=True)
group.add_argument("-i", "--installed", help="Use " + application.name + " as an installed application. Config files will be saved in the user data directory", action="store_true")
parser.add_argument("-d", "--data-directory", action="store", dest="directory", help="Specifies the directory where " + application.name + " saves userdata.") parser.add_argument("-d", "--data-directory", action="store", dest="directory", help="Specifies the directory where " + application.name + " saves userdata.")
args = parser.parse_args() args = parser.parse_args()
log.debug("Starting " + application.name + " with the following arguments: installed = %s, portable = %s and directory = %s" % (args.installed, args.portable, args.directory)) log.debug("Starting " + application.name + " with the following arguments: directory = %s" % (args.directory))
if args.installed == True: paths.mode = "installed"
elif args.portable == True:
paths.mode = "portable"
if args.directory != None: paths.directory = args.directory if args.directory != None: paths.directory = args.directory

View File

@ -1088,7 +1088,7 @@ class conversationBufferController(searchBufferController):
if dlg == widgetUtils.YES: if dlg == widgetUtils.YES:
self.timer.cancel() self.timer.cancel()
return True return True
elif dlg == WidgetUtils.NO: elif dlg == widgetUtils.NO:
return False return False
class pocketBufferController(baseBufferController): class pocketBufferController(baseBufferController):

View File

@ -261,24 +261,24 @@ class accountSettingsController(globalSettingsController):
if change == True: if change == True:
self.dialog.buffers.change_selected_item() self.dialog.buffers.change_selected_item()
def manage_pocket(self, *args, **kwargs): # def manage_pocket(self, *args, **kwargs):
if self.dialog.services.get_pocket_status() == _(u"Connect your Pocket account"): # if self.dialog.services.get_pocket_status() == _(u"Connect your Pocket account"):
self.connect_pocket() # self.connect_pocket()
else: # else:
self.disconnect_pocket() # self.disconnect_pocket()
def connect_pocket(self): # def connect_pocket(self):
dlg = self.dialog.services.show_pocket_dialog() # dlg = self.dialog.services.show_pocket_dialog()
if dlg == widgetUtils.YES: # if dlg == widgetUtils.YES:
request_token = pocket.Pocket.get_request_token(consumer_key=keys.keyring.get("pocket_consumer_key"), redirect_uri="http://127.0.0.1:8080") # request_token = pocket.Pocket.get_request_token(consumer_key=keys.keyring.get("pocket_consumer_key"), redirect_uri="http://127.0.0.1:8080")
auth_url = pocket.Pocket.get_auth_url(code=request_token, redirect_uri="http://127.0.0.1:8080") # auth_url = pocket.Pocket.get_auth_url(code=request_token, redirect_uri="http://127.0.0.1:8080")
webbrowser.open_new_tab(auth_url) # webbrowser.open_new_tab(auth_url)
httpd = BaseHTTPServer.HTTPServer(('127.0.0.1', 8080), authorisationHandler.handler) # httpd = BaseHTTPServer.HTTPServer(('127.0.0.1', 8080), authorisationHandler.handler)
while authorisationHandler.logged == False: # while authorisationHandler.logged == False:
httpd.handle_request() # httpd.handle_request()
user_credentials = pocket.Pocket.get_credentials(consumer_key=keys.keyring.get("pocket_consumer_key"), code=request_token) # user_credentials = pocket.Pocket.get_credentials(consumer_key=keys.keyring.get("pocket_consumer_key"), code=request_token)
self.dialog.services.set_pocket(True) # self.dialog.services.set_pocket(True)
self.config["services"]["pocket_access_token"] = user_credentials["access_token"] # self.config["services"]["pocket_access_token"] = user_credentials["access_token"]
def disconnect_dropbox(self): def disconnect_dropbox(self):
self.config["services"]["pocket_access_token"] = "" self.config["services"]["pocket_access_token"] = ""

View File

@ -32,7 +32,7 @@ def load_library(library, x86_path='.', x64_path='.', *args, **kwargs):
loaded = _do_load(lib, *args, **kwargs) loaded = _do_load(lib, *args, **kwargs)
if loaded is not None: if loaded is not None:
return loaded return loaded
raise LibraryLoadError('unable to load %r. Provided library path: %r' % (library, path)) raise LibraryLoadError('unable to load %r. Provided library path: %r' % (library, lib))
def _do_load(file, *args, **kwargs): def _do_load(file, *args, **kwargs):
loader = TYPES[platform.system()]['loader'] loader = TYPES[platform.system()]['loader']

View File

@ -14,6 +14,9 @@ if system == "Windows":
sys.stderr = open(os.path.join(os.getenv("temp"), "stderr.log"), "w") sys.stderr = open(os.path.join(os.getenv("temp"), "stderr.log"), "w")
import languageHandler import languageHandler
import paths import paths
#check if TWBlue is installed (Windows only)
if os.path.exists(paths.app_path(u"Uninstall.exe")):
paths.mode="installed"
import commandline import commandline
import config import config
import sound import sound

View File

@ -7,7 +7,7 @@ from platform_utils import paths as paths_
from functools import wraps from functools import wraps
mode = None mode = "portable"
directory = None directory = None
log = logging.getLogger("paths") log = logging.getLogger("paths")

View File

@ -32,7 +32,7 @@ def load_library(library, x86_path='.', x64_path='.', *args, **kwargs):
loaded = _do_load(lib, *args, **kwargs) loaded = _do_load(lib, *args, **kwargs)
if loaded is not None: if loaded is not None:
return loaded return loaded
raise LibraryLoadError('unable to load %r. Provided library path: %r' % (library, path)) raise LibraryLoadError('unable to load %r. Provided library path: %r' % (library, lib))
def _do_load(file, *args, **kwargs): def _do_load(file, *args, **kwargs):
loader = TYPES[platform.system()]['loader'] loader = TYPES[platform.system()]['loader']

View File

@ -2,6 +2,7 @@
import shutil import shutil
import widgetUtils import widgetUtils
import platform import platform
import output
if platform.system() == "Windows": if platform.system() == "Windows":
import wxUI as view import wxUI as view
from controller import settings from controller import settings

View File

@ -14,6 +14,8 @@ system = platform.system()
from mysc.repeating_timer import RepeatingTimer from mysc.repeating_timer import RepeatingTimer
from mysc.thread_utils import call_threaded from mysc.thread_utils import call_threaded
import application import application
import tempfile
import glob
URLPlayer = None URLPlayer = None
def setup(): def setup():

View File

@ -5,14 +5,14 @@ from .channel import Channel
class Music(Channel): class Music(Channel):
def __init__(self, mem=False, file=None, offset=0, length=0, flags=0, freq=0): def __init__(self, mem=False, file=None, offset=0, length=0, flags=0, freq=0):
handle = BASS_MusicLoad(mem, file, offset, length, flags, freq) handle = pybass.BASS_MusicLoad(mem, file, offset, length, flags, freq)
super(Music, self).__init__(handle) super(Music, self).__init__(handle)
self.add_attributes_to_mapping( self.add_attributes_to_mapping(
music_amplify=pybass.BASS_ATTRIB_MUSIC_AMPLIFY, music_amplify=pybass.BASS_ATTRIB_MUSIC_AMPLIFY,
music_bpm = BASS_ATTRIB_MUSIC_BPM, music_bpm = pybass.BASS_ATTRIB_MUSIC_BPM,
music_pansep=BASS_ATTRIB_MUSIC_PANSEP, music_pansep=pybass.BASS_ATTRIB_MUSIC_PANSEP,
music_speed=BASS_ATTRIB_MUSIC_SPEED, music_speed=pybass.BASS_ATTRIB_MUSIC_SPEED,
music_vol_chan=BASS_ATTRIB_MUSIC_VOL_CHAN, music_vol_chan=pybass.BASS_ATTRIB_MUSIC_VOL_CHAN,
music_vol_global=BASS_ATTRIB_MUSIC_VOL_GLOBAL, music_vol_global=pybass.BASS_ATTRIB_MUSIC_VOL_GLOBAL,
music_vol_inst=BASS_ATTRIB_MUSIC_VOL_INST, music_vol_inst=pybass.BASS_ATTRIB_MUSIC_VOL_INST,
) )

@ -1 +1 @@
Subproject commit baa04ec845383aebe6aacb3931ed1bb01da53dee Subproject commit a8a89ce8c247a4455886a3567159d7ed3829740c