34 print(" -d dir where Mod_python files are installed" |
34 print(" -d dir where Mod_python files are installed" |
35 " [default {0}]".format(modDir)) |
35 " [default {0}]".format(modDir)) |
36 print() |
36 print() |
37 print("This script patches the file apache.py of the Mod_python" |
37 print("This script patches the file apache.py of the Mod_python" |
38 " distribution") |
38 " distribution") |
39 print("so that it will work with the eric6 debugger instead of pdb.") |
39 print("so that it will work with the eric debugger instead of pdb.") |
40 print("Please see mod_python.html for more details.") |
40 print("Please see mod_python.html for more details.") |
41 print() |
41 print() |
42 |
42 |
43 sys.exit(rcode) |
43 sys.exit(rcode) |
44 |
44 |
107 s.write("\n") |
107 s.write("\n") |
108 s.write('def initDebugger(name):\n') |
108 s.write('def initDebugger(name):\n') |
109 s.write(' """\n') |
109 s.write(' """\n') |
110 s.write(' Initialize the debugger and set the script name to be' |
110 s.write(' Initialize the debugger and set the script name to be' |
111 ' reported \n') |
111 ' reported \n') |
112 s.write(' by the debugger. This is a patch for eric6.\n') |
112 s.write(' by the debugger. This is a patch for eric.\n') |
113 s.write(' """\n') |
113 s.write(' """\n') |
114 s.write(' if not pdb.initDebugger("standard"):\n') |
114 s.write(' if not pdb.initDebugger("standard"):\n') |
115 s.write(' raise ImportError("Could not initialize' |
115 s.write(' raise ImportError("Could not initialize' |
116 ' debugger")\n') |
116 ' debugger")\n') |
117 s.write(' pdb.setScriptname(name)\n') |
117 s.write(' pdb.setScriptname(name)\n') |
118 s.write("\n") |
118 s.write("\n") |
119 |
119 |
120 if ericFound: |
120 if ericFound: |
121 print("Mod_python is already patched for eric6.") |
121 print("Mod_python is already patched for eric.") |
122 os.remove(sn) |
122 os.remove(sn) |
123 else: |
123 else: |
124 try: |
124 try: |
125 py_compile.compile(sn) |
125 py_compile.compile(sn) |
126 except py_compile.PyCompileError as e: |
126 except py_compile.PyCompileError as e: |