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

This commit is contained in:
Iván Novegil 2016-01-31 12:18:19 +01:00
commit 70169a2a4a
9 changed files with 67 additions and 64 deletions

View File

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

View File

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

View File

@ -32,7 +32,7 @@ def load_library(library, x86_path='.', x64_path='.', *args, **kwargs):
loaded = _do_load(lib, *args, **kwargs)
if loaded is not None:
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):
loader = TYPES[platform.system()]['loader']

View File

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

View File

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

View File

@ -5,14 +5,14 @@ from .channel import Channel
class Music(Channel):
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)
self.add_attributes_to_mapping(
music_amplify=pybass.BASS_ATTRIB_MUSIC_AMPLIFY,
music_bpm = BASS_ATTRIB_MUSIC_BPM,
music_pansep=BASS_ATTRIB_MUSIC_PANSEP,
music_speed=BASS_ATTRIB_MUSIC_SPEED,
music_vol_chan=BASS_ATTRIB_MUSIC_VOL_CHAN,
music_vol_global=BASS_ATTRIB_MUSIC_VOL_GLOBAL,
music_vol_inst=BASS_ATTRIB_MUSIC_VOL_INST,
music_bpm = pybass.BASS_ATTRIB_MUSIC_BPM,
music_pansep=pybass.BASS_ATTRIB_MUSIC_PANSEP,
music_speed=pybass.BASS_ATTRIB_MUSIC_SPEED,
music_vol_chan=pybass.BASS_ATTRIB_MUSIC_VOL_CHAN,
music_vol_global=pybass.BASS_ATTRIB_MUSIC_VOL_GLOBAL,
music_vol_inst=pybass.BASS_ATTRIB_MUSIC_VOL_INST,
)