From 56d8fa1cad30fae163e37097bb5f01748fa17a2f Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Sat, 22 Oct 2016 00:26:40 +0300 Subject: [PATCH] libtox.py update and updater improvements --- toxygen/libtox.py | 6 ++++++ toxygen/updater.py | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/toxygen/libtox.py b/toxygen/libtox.py index 1c30eee..752798f 100644 --- a/toxygen/libtox.py +++ b/toxygen/libtox.py @@ -8,6 +8,8 @@ class LibToxCore: def __init__(self): if system() == 'Windows': self._libtoxcore = CDLL(util.curr_directory() + '/libs/libtox.dll') + elif system() == 'Darwin': + self._libtoxcore = CDLL('libtoxcore.dylib') else: # libtoxcore and libsodium must be installed in your os try: @@ -25,6 +27,8 @@ class LibToxAV: if system() == 'Windows': # on Windows av api is in libtox.dll self._libtoxav = CDLL(util.curr_directory() + '/libs/libtox.dll') + elif system() == 'Darwin': + self._libtoxav = CDLL('libtoxav.dylib') else: # /usr/lib/libtoxav.so must exists try: @@ -42,6 +46,8 @@ class LibToxEncryptSave: if system() == 'Windows': # on Windows profile encryption api is in libtox.dll self._lib_tox_encrypt_save = CDLL(util.curr_directory() + '/libs/libtox.dll') + elif system() == 'Darwin': + self._lib_tox_encrypt_save = CDLL('libtoxencryptsave.dylib') else: # /usr/lib/libtoxencryptsave.so must exists try: diff --git a/toxygen/updater.py b/toxygen/updater.py index 2620562..7587b8b 100644 --- a/toxygen/updater.py +++ b/toxygen/updater.py @@ -44,19 +44,19 @@ def get_url(version): return 'https://github.com/toxygen-project/toxygen/releases/tag/v{}/{}'.format(version, name) -def get_params(url): +def get_params(url, version): if is_from_sources(): - return ['python3', 'toxygen_updater.py', url] + return ['python3', 'toxygen_updater.py', url, version] elif platform.system() == 'Windows': - return ['run', 'toxygen_updater.exe', url] + return ['run', 'toxygen_updater.exe', url, version] else: - return ['./toxygen_updater', url] + return ['./toxygen_updater', url, version] def download(version): os.chdir(util.curr_directory()) url = get_url(version) - params = get_params(url) + params = get_params(url, version) try: subprocess.Popen(params) except Exception as ex: