From cf2b91359209c7b412f8079619fe0d4dbe58f83f Mon Sep 17 00:00:00 2001 From: Worros Date: Mon, 21 Jun 2010 14:49:56 +0800 Subject: [PATCH] make CLI parameters to run_fpdb.py and fpdb.py work again Conflicts: pyfpdb/fpdb.py run_fpdb.py --- pyfpdb/fpdb.py | 5 ++++- run_fpdb.py | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index 37491505..806bef9c 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -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.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) diff --git a/run_fpdb.py b/run_fpdb.py index e77d789f..06581b9e 100755 --- a/run_fpdb.py +++ b/run_fpdb.py @@ -15,7 +15,6 @@ #In the "official" distribution you can find the license in #agpl-3.0.txt in the docs folder of the package. - import os import sys @@ -25,6 +24,8 @@ sys.path[0] = sys.path[0]+os.sep+"pyfpdb" os.chdir(sys.path[0]) #print "sys.path[0] =", sys.path[0], "cwd =", os.getcwd() - -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)