patch_modpython.py

changeset 2992
dbdf27746da5
parent 2965
d133c7edd88a
child 3036
30c81c9e88b8
child 3057
10516539f238
equal deleted inserted replaced
2991:226481ff40d1 2992:dbdf27746da5
29 29
30 print("Usage:") 30 print("Usage:")
31 print(" {0} [-h] [-d dir]".format(progName)) 31 print(" {0} [-h] [-d dir]".format(progName))
32 print("where:") 32 print("where:")
33 print(" -h display this help message") 33 print(" -h display this help message")
34 print(" -d dir where Mod_python files are installed [default {0}]".format( 34 print(" -d dir where Mod_python files are installed"
35 modDir)) 35 " [default {0}]".format(modDir))
36 print() 36 print()
37 print("This script patches the file apache.py of the Mod_python distribution") 37 print("This script patches the file apache.py of the Mod_python"
38 " distribution")
38 print("so that it will work with the eric5 debugger instead of pdb.") 39 print("so that it will work with the eric5 debugger instead of pdb.")
39 print("Please see mod_python.html for more details.") 40 print("Please see mod_python.html for more details.")
40 print() 41 print()
41 42
42 sys.exit(rcode) 43 sys.exit(rcode)
47 Module function to set the values of globals that need more than a 48 Module function to set the values of globals that need more than a
48 simple assignment. 49 simple assignment.
49 """ 50 """
50 global modDir 51 global modDir
51 52
52 modDir = os.path.join(distutils.sysconfig.get_python_lib(True), "mod_python") 53 modDir = os.path.join(distutils.sysconfig.get_python_lib(True),
54 "mod_python")
53 55
54 56
55 def main(argv): 57 def main(argv):
56 """ 58 """
57 The main function of the script. 59 The main function of the script.
104 106
105 if not ericFound: 107 if not ericFound:
106 s.write("\n") 108 s.write("\n")
107 s.write('def initDebugger(name):\n') 109 s.write('def initDebugger(name):\n')
108 s.write(' """\n') 110 s.write(' """\n')
109 s.write(' Initialize the debugger and set the script name to be reported \n') 111 s.write(' Initialize the debugger and set the script name to be'
112 ' reported \n')
110 s.write(' by the debugger. This is a patch for eric5.\n') 113 s.write(' by the debugger. This is a patch for eric5.\n')
111 s.write(' """\n') 114 s.write(' """\n')
112 s.write(' if not pdb.initDebugger("standard"):\n') 115 s.write(' if not pdb.initDebugger("standard"):\n')
113 s.write(' raise ImportError("Could not initialize debugger")\n') 116 s.write(' raise ImportError("Could not initialize debugger")\n')
114 s.write(' pdb.setScriptname(name)\n') 117 s.write(' pdb.setScriptname(name)\n')
152 try: 155 try:
153 main(sys.argv) 156 main(sys.argv)
154 except SystemExit: 157 except SystemExit:
155 raise 158 raise
156 except: 159 except:
157 print("""An internal error occured. Please report all the output of the program, 160 print(
161 """An internal error occured. Please report all the output of the program,
158 including the following traceback, to eric-bugs@die-offenbachs.de. 162 including the following traceback, to eric-bugs@die-offenbachs.de.
159 """) 163 """)
160 raise 164 raise

eric ide

mercurial