make CLI parameters to run_fpdb.py and fpdb.py work again

Conflicts:

	pyfpdb/fpdb.py
	run_fpdb.py
This commit is contained in:
Worros 2010-06-21 14:49:56 +08:00
parent 79a6aa8f48
commit cf2b913592
2 changed files with 8 additions and 4 deletions

View File

@ -27,5 +27,8 @@ import sys
sys.stdout.write('fpdb.py has been renamed to fpdb.pyw - now calling fpdb.pyw ...\n\n') sys.stdout.write('fpdb.py has been renamed to fpdb.pyw - now calling fpdb.pyw ...\n\n')
sys.stdout.flush() sys.stdout.flush()
os.execvpe('pythonw.exe', ('pythonw.exe', 'fpdb.pyw', '-r'), os.environ) if os.name=='nt':
os.execvpe('pythonw.exe', list(('pythonw.exe', 'fpdb.pyw', '-r'))+sys.argv[1:], os.environ)
else:
os.execvpe('python', list(('python', 'fpdb.pyw', '-r'))+sys.argv[1:], os.environ)
# first arg is ignored (name of program being run) # first arg is ignored (name of program being run)

View File

@ -15,7 +15,6 @@
#In the "official" distribution you can find the license in #In the "official" distribution you can find the license in
#agpl-3.0.txt in the docs folder of the package. #agpl-3.0.txt in the docs folder of the package.
import os import os
import sys import sys
@ -25,6 +24,8 @@ sys.path[0] = sys.path[0]+os.sep+"pyfpdb"
os.chdir(sys.path[0]) os.chdir(sys.path[0])
#print "sys.path[0] =", sys.path[0], "cwd =", os.getcwd() #print "sys.path[0] =", sys.path[0], "cwd =", os.getcwd()
if os.name=='nt':
os.execvpe('pythonw.exe', ('pythonw.exe', 'fpdb.pyw', '-r'), os.environ) os.execvpe('pythonw.exe', list(('pythonw.exe', 'fpdb.pyw', '-r'))+sys.argv[1:], os.environ)
else:
os.execvpe('python', list(('python', 'fpdb.pyw', '-r'))+sys.argv[1:], os.environ)
# first arg is ignored (name of program being run) # first arg is ignored (name of program being run)