1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 01:22:19 +03:00

Build main scripts optimized on Windows.

Partially reverts c36ce2a.
This commit is contained in:
Jonathan Harris 2015-12-09 17:49:15 +00:00
parent 0f2289288c
commit cc25e4da75
4 changed files with 10 additions and 22 deletions

@ -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

2
py2exe.cmd Executable file

@ -0,0 +1,2 @@
@REM http://www.py2exe.org/index.cgi/OptimizedBytecode
"C:\Program Files (x86)\Python27\python.exe" -OO setup.py py2exe

@ -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

@ -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()