tox.py update

This commit is contained in:
ingvar1995 2016-02-16 23:30:43 +03:00
parent bd0c264fdd
commit fea142d60e

View File

@ -2,7 +2,7 @@
from ctypes import * from ctypes import *
from settings import Settings from settings import Settings
from platform import system from platform import system
import os
class ToxOptions(Structure): class ToxOptions(Structure):
_fields_ = [ _fields_ = [
@ -31,9 +31,12 @@ class Tox(object):
size = len(data) size = len(data)
print size print size
if system() == 'Linux': if system() == 'Linux':
self.libtoxcore = CDLL('libs/libtoxcore.so') temp = os.path.dirname(os.path.abspath(__file__)) + '/libs/'
os.chdir(temp)
print temp
self.libtoxcore = CDLL(temp + 'libtoxcore.so')
elif system() == 'Windows': elif system() == 'Windows':
self.libtoxcore = CDLL('libs/libtox.dll') self.libtoxcore = CDLL('/libs/libtox.dll')
print self.libtoxcore.__dict__ print self.libtoxcore.__dict__
self.libtoxcore.tox_options_new.restype = POINTER(ToxOptions) self.libtoxcore.tox_options_new.restype = POINTER(ToxOptions)
# TODO: load from settings # TODO: load from settings