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

Delay opening logfile until after check for app already running

Addresses #286
This commit is contained in:
Jonathan Harris 2018-01-27 15:18:05 +00:00
parent 0666e30c1b
commit d014750e6d

View File

@ -27,11 +27,6 @@ if getattr(sys, 'frozen', False):
if 'TCL_LIBRARY' in environ:
environ.pop('TCL_LIBRARY')
# By default py2exe tries to write log to dirname(sys.executable) which fails when installed
import tempfile
sys.stdout = sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt', 0) # unbuffered
print '%s %s %s' % (applongname, appversion, strftime('%Y-%m-%dT%H:%M:%S', localtime()))
import Tkinter as tk
import ttk
import tkFileDialog
@ -863,6 +858,12 @@ if __name__ == "__main__":
EnumWindows(EnumWindowsProc(enumwindowsproc), 0)
if getattr(sys, 'frozen', False):
# By default py2exe tries to write log to dirname(sys.executable) which fails when installed
import tempfile
sys.stdout = sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt', 0) # unbuffered
print '%s %s %s' % (applongname, appversion, strftime('%Y-%m-%dT%H:%M:%S', localtime()))
root = tk.Tk()
app = AppWindow(root)
root.mainloop()