mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -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 -*-
|
# -*- 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 languageHandler
|
||||||
import wx
|
import wx
|
||||||
import paths
|
import paths
|
||||||
@ -14,6 +21,22 @@ import keys
|
|||||||
from mysc.thread_utils import call_threaded
|
from mysc.thread_utils import call_threaded
|
||||||
from update import updater
|
from update import updater
|
||||||
import fixes
|
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")
|
log = logging.getLogger("main")
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
import py2exe
|
import py2exe
|
||||||
import os
|
import os
|
||||||
import gettext, gettext_windows; gettext_windows.setup_env_windows()
|
import gettext
|
||||||
import application
|
import application
|
||||||
import platform
|
import platform
|
||||||
from glob import glob
|
from glob import glob
|
||||||
@ -43,7 +43,7 @@ def get_data():
|
|||||||
import sound_lib
|
import sound_lib
|
||||||
import enchant
|
import enchant
|
||||||
return [
|
return [
|
||||||
("", ["conf.defaults", "sessions.defaults", "icon.ico"]),
|
("", ["conf.defaults", "app-configuration.defaults", "icon.ico"]),
|
||||||
("dropbox", ["trusted-certs.crt"]),
|
("dropbox", ["trusted-certs.crt"]),
|
||||||
("requests", ["cacert.pem"]),
|
("requests", ["cacert.pem"]),
|
||||||
("accessible_output2/lib", glob("accessible_output2/lib/*.dll")),
|
("accessible_output2/lib", glob("accessible_output2/lib/*.dll")),
|
||||||
@ -85,11 +85,12 @@ if __name__ == '__main__':
|
|||||||
author_email = application.authorEmail,
|
author_email = application.authorEmail,
|
||||||
version = application.version,
|
version = application.version,
|
||||||
url = application.url,
|
url = application.url,
|
||||||
packages=find_packages(),
|
packages= find_packages(),
|
||||||
data_files = get_data(),
|
data_files = get_data(),
|
||||||
options = {
|
options = {
|
||||||
'py2exe': {
|
'py2exe': {
|
||||||
'optimize':2,
|
'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"],
|
'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
|
'skip_archive': True
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user