dbgpyapp.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # dbgpyapp.py - Debugger Python application class
  2. #
  3. import win32con
  4. import win32ui
  5. import sys
  6. import string
  7. import os
  8. from pywin.framework import intpyapp
  9. version = '0.3.0'
  10. class DebuggerPythonApp(intpyapp.InteractivePythonApp):
  11. def LoadMainFrame(self):
  12. " Create the main applications frame "
  13. self.frame = self.CreateMainFrame()
  14. self.SetMainFrame(self.frame)
  15. self.frame.LoadFrame(win32ui.IDR_DEBUGGER, win32con.WS_OVERLAPPEDWINDOW)
  16. self.frame.DragAcceptFiles() # we can accept these.
  17. self.frame.ShowWindow(win32con.SW_HIDE);
  18. self.frame.UpdateWindow();
  19. # but we do rehook, hooking the new code objects.
  20. self.HookCommands()
  21. def InitInstance(self):
  22. # Use a registry path of "Python\Pythonwin Debugger
  23. win32ui.SetAppName(win32ui.LoadString(win32ui.IDR_DEBUGGER))
  24. win32ui.SetRegistryKey("Python %s" % (sys.winver,))
  25. # We _need_ the Scintilla color editor.
  26. # (and we _always_ get it now :-)
  27. numMRU = win32ui.GetProfileVal("Settings","Recent File List Size", 10)
  28. win32ui.LoadStdProfileSettings(numMRU)
  29. self.LoadMainFrame()
  30. # Display the interactive window if the user wants it.
  31. from pywin.framework import interact
  32. interact.CreateInteractiveWindowUserPreference()
  33. # Load the modules we use internally.
  34. self.LoadSystemModules()
  35. # Load additional module the user may want.
  36. self.LoadUserModules()
  37. # win32ui.CreateDebuggerThread()
  38. win32ui.EnableControlContainer()