os x and freebsd support (untested)

This commit is contained in:
ingvar1995 2016-07-26 19:09:57 +03:00
parent af5db43248
commit 08ef8294df
3 changed files with 23 additions and 15 deletions

View file

@ -7,10 +7,15 @@ from toxygen.util import program_version
version = program_version + '.0' version = program_version + '.0'
MODULES = ['PyAudio'] MODULES = []
if system() == 'Windows': if system() in ('Windows', 'Darwin'):
MODULES.append('PySide') MODULES = ['PyAudio', 'PySide']
else:
try:
import pyaudio
except ImportError:
MODULES = ['PyAudio']
class InstallScript(install): class InstallScript(install):
@ -18,11 +23,13 @@ class InstallScript(install):
def run(self): def run(self):
install.run(self) install.run(self)
OS = system() try:
if OS == 'Windows': if system() == 'Windows':
call(["toxygen", "--configure"]) call(["toxygen", "--configure"])
elif OS == 'Linux': else:
call(["toxygen", "--clean"]) call(["toxygen", "--clean"])
except:
pass
setup(name='Toxygen', setup(name='Toxygen',
version=version, version=version,

View file

@ -8,6 +8,7 @@ try:
from PySide import QtCore from PySide import QtCore
except ImportError: except ImportError:
from PyQt4 import QtCore from PyQt4 import QtCore
QtCore.Signal = QtCore.pyqtSignal
# TODO: threads! # TODO: threads!
@ -34,10 +35,8 @@ ALLOWED_FILES = ('toxygen_inline.png', 'utox-inline.png', 'sticker.png')
class StateSignal(QtCore.QObject): class StateSignal(QtCore.QObject):
try:
signal = QtCore.Signal(int, float, int) # state and progress signal = QtCore.Signal(int, float, int) # state and progress
except:
signal = QtCore.pyqtSignal(int, float, int) # state and progress - pyqt4
class FileTransfer(QtCore.QObject): class FileTransfer(QtCore.QObject):

View file

@ -204,10 +204,12 @@ class Settings(dict, Singleton):
@staticmethod @staticmethod
def get_default_path(): def get_default_path():
if system() == 'Linux': if system() == 'Windows':
return os.getenv('HOME') + '/.config/tox/'
elif system() == 'Windows':
return os.getenv('APPDATA') + '/Tox/' return os.getenv('APPDATA') + '/Tox/'
elif system() == 'Darwin':
return os.getenv('HOME') + '/Library/Application Support/Tox/'
else:
return os.getenv('HOME') + '/.config/tox/'
class ProfileHelper(Singleton): class ProfileHelper(Singleton):