Build main scripts optimized on Windows.

Partially reverts c36ce2a.
This commit is contained in:
Jonathan Harris committed 2015-12-18 05:20:31 +00:00
1 parent 0f2289288c
commit cc25e4da75
4 files changed
+10 -22

No files matched your search

+7 -1
View File
@@ -1,6 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from sys import platform
import json
from os import mkdir
@@ -17,6 +18,12 @@ from ttkHyperlinkLabel import HyperlinkLabel
if __debug__:
from traceback import print_exc
from config import appname, applongname, config
if platform == 'win32' and getattr(sys, 'frozen', False):
# By default py2exe tries to write log to dirname(sys.executable) which fails when installed
import tempfile
sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt')
import l10n
l10n.Translations().install()
@@ -31,7 +38,6 @@ import flightlog
import eddb
import stats
import prefs
from config import appname, applongname, config
from hotkey import hotkeymgr
from monitor import monitor
Executable
+2
View File
@@ -0,0 +1,2 @@
@REM http://www.py2exe.org/index.cgi/OptimizedBytecode
"C:\Program Files (x86)\Python27\python.exe" -OO setup.py py2exe
+1 -1
View File
@@ -114,7 +114,7 @@ setup(
version = VERSION,
app = [APP],
windows = [ {'dest_base': APPNAME,
'script': 'winlauncher.py',
'script': APP,
'icon_resources': [(0, '%s.ico' % APPNAME)],
'copyright': u'© 2015 Jonathan Harris',
'name': APPNAME, # WinSparkle
-20
View File
@@ -1,20 +0,0 @@
#!/usr/bin/python
#
# Launcher when running py2exe
import sys
getattr(sys, 'frozen') # Only intended to be run under py2exe
# By deault py2exe tries to write log to dirname(sys.executable) which fails when installed
from os.path import join
import tempfile
from config import appname
sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt')
import Tkinter as tk
from EDMarketConnector import AppWindow
# Run the app
root = tk.Tk()
app = AppWindow(root)
root.mainloop()