[wxPython] Removing wx imports from pythonwins module browser

For my wxPython programming I use Mark Hammonds fine Pythonwin.
The usual 'from wxPython.wx import *' clutters the module browser
(left side of the editor window) with so many wx* and EVT_* symbols
that I barely find my own classes and functions without scrolling.

The following small patch removes the wxPython imports from the module
browser. Open the file
Python22\Lib\site-packages\Pythonwin\pywin\framework\editor\ModuleBrowser.py
and insert this below the 'import pyclbr' statement.

----------------------- cut here --------------------------
def readmodule_ex_without_wx(module, *args, **kwargs):
    if module.startswith('wxPython.'):
        return {}
    return readmodule_ex_orig(module, *args, **kwargs)

readmodule_ex_orig = pyclbr.readmodule_ex
pyclbr.readmodule_ex = readmodule_ex_without_wx
----------------------- cut here --------------------------

Maybe you find this useful,
Michael

···

--
- Michael Krause
- Email michael@krause-software.de

Michael,

Greatly appreciated!!!

I pretty much stopped using the module browser when I began using wxPython
(In fact I practically forgot it existed : ) ). Now I can actually use it.

Take Care

Raul

···

----- Original Message -----
From: "Michael Krause" <michael@krause-software.de>
To: <wxpython-users@lists.wxwindows.org>
Sent: Wednesday, October 09, 2002 3:58 PM
Subject: [wxPython] Removing wx imports from pythonwins module browser

For my wxPython programming I use Mark Hammonds fine Pythonwin.
The usual 'from wxPython.wx import *' clutters the module browser
(left side of the editor window) with so many wx* and EVT_* symbols
that I barely find my own classes and functions without scrolling.

The following small patch removes the wxPython imports from the module
browser. Open the file

Python22\Lib\site-packages\Pythonwin\pywin\framework\editor\ModuleBrowser.py

and insert this below the 'import pyclbr' statement.

----------------------- cut here --------------------------
def readmodule_ex_without_wx(module, *args, **kwargs):
    if module.startswith('wxPython.'):
        return {}
    return readmodule_ex_orig(module, *args, **kwargs)

readmodule_ex_orig = pyclbr.readmodule_ex
pyclbr.readmodule_ex = readmodule_ex_without_wx
----------------------- cut here --------------------------

Maybe you find this useful,
Michael

--
- Michael Krause
- Email michael@krause-software.de

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users