Fixed building py2exe with PySide
This commit is contained in:
parent
23d3e964e5
commit
18ea87a4e8
@ -519,12 +519,13 @@ common_info = dict(
|
|||||||
|
|
||||||
info = dict(
|
info = dict(
|
||||||
common_info,
|
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': {
|
options={'py2exe': {
|
||||||
'dist_dir': OUT_DIR,
|
'dist_dir': OUT_DIR,
|
||||||
'packages': 'PySide.QtUiTools',
|
'packages': 'PySide.QtUiTools',
|
||||||
'includes': 'twisted, sys, encodings, datetime, os, time, math, PySide',
|
'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',
|
'dll_excludes': 'msvcr71.dll, MSVCP90.dll',
|
||||||
'optimize': 2,
|
'optimize': 2,
|
||||||
'compressed': 1
|
'compressed': 1
|
||||||
|
|||||||
@ -91,3 +91,35 @@ def findWorkingDir():
|
|||||||
|
|
||||||
def limitedPowerset(s, minLength):
|
def limitedPowerset(s, minLength):
|
||||||
return itertools.chain.from_iterable(itertools.combinations(s, r) for r in xrange(len(s), minLength, -1))
|
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
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from syncplay.clientManager import SyncplayClientManager
|
from syncplay.clientManager import SyncplayClientManager
|
||||||
|
from syncplay.utils import blackholeStdoutForFrozenWindow
|
||||||
if(__name__ == '__main__'):
|
if(__name__ == '__main__'):
|
||||||
|
blackholeStdoutForFrozenWindow()
|
||||||
SyncplayClientManager().run()
|
SyncplayClientManager().run()
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user