libtox.py update and updater improvements

This commit is contained in:
ingvar1995 2016-10-22 00:26:40 +03:00
parent 1e6201b3fa
commit 56d8fa1cad
2 changed files with 11 additions and 5 deletions

View file

@ -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:

View file

@ -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: