debug and refine fpdb.pyw changes for .exe version

This commit is contained in:
sqlcoder 2010-06-06 10:57:51 +01:00
parent 9421f045dd
commit da203fbe6c
2 changed files with 37 additions and 1 deletions

View File

@ -210,7 +210,12 @@ class GuiAutoImport (threading.Thread):
print "opening pipe to HUD" print "opening pipe to HUD"
self.pipe_to_hud = subprocess.Popen(command, bufsize=bs, self.pipe_to_hud = subprocess.Popen(command, bufsize=bs,
stdin=subprocess.PIPE, 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: except:
err = traceback.extract_tb(sys.exc_info()[2])[-1] 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])) #self.addText( "\n*** GuiAutoImport Error opening pipe: " + err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1]))

31
pyfpdb/fpdb.py Executable file
View File

@ -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 <http://www.gnu.org/licenses/>.
#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)