mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
modified setup for compiling the new generation
This commit is contained in:
parent
c571a913c5
commit
1f64b80f9d
23
src/main.py
23
src/main.py
@ -1,4 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import sys
|
||||
import os
|
||||
#redirect the original stdout and stderr
|
||||
stdout=sys.stdout
|
||||
stderr=sys.stderr
|
||||
sys.stdout = open(os.path.join(os.getenv("temp"), "stdout.log"), "w")
|
||||
sys.stderr = open(os.path.join(os.getenv("temp"), "stderr.log"), "w")
|
||||
import languageHandler
|
||||
import wx
|
||||
import paths
|
||||
@ -14,6 +21,22 @@ import keys
|
||||
from mysc.thread_utils import call_threaded
|
||||
from update import updater
|
||||
import fixes
|
||||
#extra variables to control the temporal stdout and stderr, while the final files are opened. We understand that some errors could happen while all outputs are closed, so let's try to avoid it.
|
||||
stdout_temp=sys.stdout
|
||||
stderr_temp=sys.stderr
|
||||
#if it's a binary version
|
||||
if hasattr(sys, 'frozen'):
|
||||
sys.stderr = open(paths.logs_path("stderr.log"), 'w')
|
||||
sys.stdout = open(paths.logs_path("stdout.log"), 'w')
|
||||
else:
|
||||
sys.stdout=stdout
|
||||
sys.stderr=stderr
|
||||
#the final log files have been opened succesfully, let's close the temporal files
|
||||
stdout_temp.close()
|
||||
stderr_temp.close()
|
||||
#finally, remove the temporal files. TW Blue doesn't need them anymore, and we will get more free space on the harddrive
|
||||
os.remove(stdout_temp.name)
|
||||
os.remove(stderr_temp.name)
|
||||
log = logging.getLogger("main")
|
||||
|
||||
def setup():
|
||||
|
@ -21,7 +21,7 @@
|
||||
from setuptools import setup, find_packages
|
||||
import py2exe
|
||||
import os
|
||||
import gettext, gettext_windows; gettext_windows.setup_env_windows()
|
||||
import gettext
|
||||
import application
|
||||
import platform
|
||||
from glob import glob
|
||||
@ -43,7 +43,7 @@ def get_data():
|
||||
import sound_lib
|
||||
import enchant
|
||||
return [
|
||||
("", ["conf.defaults", "sessions.defaults", "icon.ico"]),
|
||||
("", ["conf.defaults", "app-configuration.defaults", "icon.ico"]),
|
||||
("dropbox", ["trusted-certs.crt"]),
|
||||
("requests", ["cacert.pem"]),
|
||||
("accessible_output2/lib", glob("accessible_output2/lib/*.dll")),
|
||||
@ -90,6 +90,7 @@ data_files = get_data(),
|
||||
options = {
|
||||
'py2exe': {
|
||||
'optimize':2,
|
||||
'packages': ["pubsub", "pubsub.core", "pubsub.core.kwargs"],
|
||||
'dll_excludes': ["MPR.dll", "api-ms-win-core-apiquery-l1-1-0.dll", "api-ms-win-core-console-l1-1-0.dll", "api-ms-win-core-delayload-l1-1-1.dll", "api-ms-win-core-errorhandling-l1-1-1.dll", "api-ms-win-core-file-l1-2-0.dll", "api-ms-win-core-handle-l1-1-0.dll", "api-ms-win-core-heap-obsolete-l1-1-0.dll", "api-ms-win-core-libraryloader-l1-1-1.dll", "api-ms-win-core-localization-l1-2-0.dll", "api-ms-win-core-processenvironment-l1-2-0.dll", "api-ms-win-core-processthreads-l1-1-1.dll", "api-ms-win-core-profile-l1-1-0.dll", "api-ms-win-core-registry-l1-1-0.dll", "api-ms-win-core-synch-l1-2-0.dll", "api-ms-win-core-sysinfo-l1-2-0.dll", "api-ms-win-security-base-l1-2-0.dll", "api-ms-win-core-heap-l1-2-0.dll", "api-ms-win-core-interlocked-l1-2-0.dll", "api-ms-win-core-localization-obsolete-l1-1-0.dll", "api-ms-win-core-string-l1-1-0.dll", "api-ms-win-core-string-obsolete-l1-1-0.dll", "WLDAP32.dll", "MSVCP90.dll"],
|
||||
'skip_archive': True
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user