From da203fbe6cf8e69c491256e451f32269ae6a9316 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Sun, 6 Jun 2010 10:57:51 +0100 Subject: [PATCH] debug and refine fpdb.pyw changes for .exe version --- pyfpdb/GuiAutoImport.py | 7 ++++++- pyfpdb/fpdb.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 pyfpdb/fpdb.py diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index b55c9ec1..ab471fe5 100755 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -210,7 +210,12 @@ class GuiAutoImport (threading.Thread): print "opening pipe to HUD" self.pipe_to_hud = subprocess.Popen(command, bufsize=bs, stdin=subprocess.PIPE, - universal_newlines=True) + stdout=subprocess.PIPE, # only needed for py2exe + stderr=subprocess.PIPE, # only needed for py2exe + universal_newlines=True + ) + self.pipe_to_hud.stdout.close() + self.pipe_to_hud.stderr.close() except: err = traceback.extract_tb(sys.exc_info()[2])[-1] #self.addText( "\n*** GuiAutoImport Error opening pipe: " + err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1])) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py new file mode 100755 index 00000000..db9050c7 --- /dev/null +++ b/pyfpdb/fpdb.py @@ -0,0 +1,31 @@ +#!/usr/bin/python + +#Copyright 2008 Steffen Jobbagy-Felso +#This program is free software: you can redistribute it and/or modify +#it under the terms of the GNU Affero General Public License as published by +#the Free Software Foundation, version 3 of the License. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +# +#You should have received a copy of the GNU Affero General Public License +#along with this program. If not, see . +#In the "official" distribution you can find the license in +#agpl-3.0.txt in the docs folder of the package. + + +# Users should run fpdb.pyw now, this is included in case they still try to run fpdb.py + + +import os +import sys + + +#print "fpdb.py has now been renamed to fpdb.pyw - calling fpdb.pyw ...\n" +sys.stdout.write('fpdb.py has been renamed to fpdb.pyw - now calling fpdb.pyw ...\n\n') +sys.stdout.flush() + +os.execvpe('python.exe', ('python.exe', 'fpdb.pyw', '-r'), os.environ) +# first arg is ignored (name of program being run)