mirror of
https://github.com/Syncplay/syncplay
synced 2025-03-25 04:18:30 +00:00
Fixed building py2exe with PySide
This commit is contained in:
parent
23d3e964e5
commit
18ea87a4e8
@ -519,12 +519,13 @@ common_info = dict(
|
||||
|
||||
info = dict(
|
||||
common_info,
|
||||
console=[{"script":"syncplayClient.py", "icon_resources":[(1, "resources\\icon.ico")], 'dest_base': "Syncplay"}, 'syncplayServer.py'],
|
||||
windows=[{"script":"syncplayClient.py", "icon_resources":[(1, "resources\\icon.ico")], 'dest_base': "Syncplay"}],
|
||||
console=['syncplayServer.py'],
|
||||
options={'py2exe': {
|
||||
'dist_dir': OUT_DIR,
|
||||
'packages': 'PySide.QtUiTools',
|
||||
'includes': 'twisted, sys, encodings, datetime, os, time, math, PySide',
|
||||
'excludes': 'venv, _ssl, doctest, pdb, unittest, win32clipboard, win32event, win32file, win32pdh, win32security, win32trace, win32ui, winxpgui, win32pipe, win32process',
|
||||
'excludes': 'venv, _ssl, doctest, pdb, unittest, win32clipboard, win32file, win32pdh, win32security, win32trace, win32ui, winxpgui, win32pipe, win32process',
|
||||
'dll_excludes': 'msvcr71.dll, MSVCP90.dll',
|
||||
'optimize': 2,
|
||||
'compressed': 1
|
||||
|
@ -91,3 +91,35 @@ def findWorkingDir():
|
||||
|
||||
def limitedPowerset(s, minLength):
|
||||
return itertools.chain.from_iterable(itertools.combinations(s, r) for r in xrange(len(s), minLength, -1))
|
||||
|
||||
def blackholeStdoutForFrozenWindow():
|
||||
if getattr(sys, 'frozen', '') == "windows_exe":
|
||||
class Stderr(object):
|
||||
softspace = 0
|
||||
_file = None
|
||||
_error = None
|
||||
def write(self, text, fname='.syncplay.log'):
|
||||
if self._file is None and self._error is None:
|
||||
if(os.name <> 'nt'):
|
||||
path = os.path.join(os.getenv('HOME', '.'), fname)
|
||||
else:
|
||||
path = os.path.join(os.getenv('APPDATA', '.'), fname)
|
||||
self._file = open(path, 'a')
|
||||
#TODO: Handle errors.
|
||||
if self._file is not None:
|
||||
self._file.write(text)
|
||||
self._file.flush()
|
||||
def flush(self):
|
||||
if self._file is not None:
|
||||
self._file.flush()
|
||||
sys.stderr = Stderr()
|
||||
del Stderr
|
||||
|
||||
class Blackhole(object):
|
||||
softspace = 0
|
||||
def write(self, text):
|
||||
pass
|
||||
def flush(self):
|
||||
pass
|
||||
sys.stdout = Blackhole()
|
||||
del Blackhole
|
||||
|
@ -1,5 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from syncplay.clientManager import SyncplayClientManager
|
||||
from syncplay.utils import blackholeStdoutForFrozenWindow
|
||||
if(__name__ == '__main__'):
|
||||
blackholeStdoutForFrozenWindow()
|
||||
SyncplayClientManager().run()
|
||||
|
Loading…
Reference in New Issue
Block a user