Menu

#116 docview.py & COM draw Framework into the machine

open
nobody
pythonwin (177)
5
2004-10-09
2004-06-03
kxroberto
No

docview.py draws the framework into the machine (e.g.
py2exe creates output +1MB in size). Software uses
unnecessary lots of memory.

and: now win32com/server/dispatcher.py also draws the
framework/debugger !

i patched it like this ( but not very elegant because i
don't overview the framework module design well; but
only 2 locations changing )

# docview.py

self.MakeView=MakeView
self._SetupSharedMenu_()
def _SetupSharedMenu_(self):
pass #to be replaced by framework!
### todo - _SetupSharedMenu_ should be moved to a
framework class.
## def _SetupSharedMenu_(self):
## sharedMenu = self.GetSharedMenu()
## from pywin.framework import toolmenu
## toolmenu.SetToolsMenu(sharedMenu)
## from pywin.framework import help
## help.SetHelpMenuOtherHelp(sharedMenu)

def _CreateDocTemplate(self, resourceId):
return win32ui.CreateDocTemplate(resourceId)
def __del__(self):

# intpyapp.py

import dbgcommands

lastLocateFileName = ".py" # used in the "File/Locate"
dialog...

# todo - _SetupSharedMenu should be moved to a
framework class.
def _SetupSharedMenu_(self):
sharedMenu = self.GetSharedMenu()
from pywin.framework import toolmenu
toolmenu.SetToolsMenu(sharedMenu)
from pywin.framework import help
help.SetHelpMenuOtherHelp(sharedMenu)
from pywin.mfc import docview
docview.DocTemplate._SetupSharedMenu_=_SetupSharedMenu_

class MainFrame(app.MainFrame):
def OnCreate(self, createStruct):
self.closing = 0

# dispatcher.py

def __init__(self, policyClass, ob):
exec "import pywin.debugger"
pywin.debugger.brk()

Discussion

  • Mark Hammond

    Mark Hammond - 2004-10-09
    • status: open --> pending
     
  • Mark Hammond

    Mark Hammond - 2004-10-09

    Logged In: YES
    user_id=14198

    You can tell py2exe to exclude them, but if you could turn
    your code into either a .patch or the complete files as
    "clean" as possible, I'd certainly consider it. Please
    reset the bug status to "open" when you do (or just create a
    new "patch")

    Thanks

     
  • kxroberto

    kxroberto - 2004-10-09
    • status: pending --> open
     
  • kxroberto

    kxroberto - 2004-10-09

    Logged In: YES
    user_id=972995

    The 2 files in attachment. Its a quick hack of the
    "SetShared..." hook solution. I didn't understand the
    structure and execution flow on the big picture.

    in win32com/server/dispatcher.py I didn't do anything.
    Thinke there should also be a "SetDebugger" interface to
    unravel.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.