From 5b29df3fee8df15257347a9df63a390128374b03 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 22 Apr 2004 23:25:20 +0000 Subject: [PATCH] Add __docfilter__ to modules so epydoc doesn't generate docs for all the SWIG crud in the modules it doesn't need to. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/activex/activex.i | 1 + wxPython/contrib/gizmos/gizmos.i | 1 + wxPython/contrib/glcanvas/glcanvas.i | 1 + wxPython/contrib/iewin/iewin.i | 1 + wxPython/contrib/ogl/ogl.i | 1 + wxPython/contrib/stc/stc.i | 1 + wxPython/contrib/xrc/xrc.i | 1 + wxPython/src/_core_ex.py | 18 ++++++++++++++++++ wxPython/src/calendar.i | 1 + wxPython/src/controls.i | 1 + wxPython/src/gdi.i | 1 + wxPython/src/grid.i | 1 + wxPython/src/html.i | 1 + wxPython/src/misc.i | 1 + wxPython/src/windows.i | 1 + 15 files changed, 32 insertions(+) diff --git a/wxPython/contrib/activex/activex.i b/wxPython/contrib/activex/activex.i index f77fead3ab..907207f60a 100644 --- a/wxPython/contrib/activex/activex.i +++ b/wxPython/contrib/activex/activex.i @@ -25,6 +25,7 @@ %import core.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } MAKE_CONST_WXSTRING_NOSWIG(PanelNameStr); diff --git a/wxPython/contrib/gizmos/gizmos.i b/wxPython/contrib/gizmos/gizmos.i index 89463e7978..30ad7813ec 100644 --- a/wxPython/contrib/gizmos/gizmos.i +++ b/wxPython/contrib/gizmos/gizmos.i @@ -36,6 +36,7 @@ %import windows.i %import controls.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } MAKE_CONST_WXSTRING2(DynamicSashNameStr, wxT("dynamicSashWindow")); diff --git a/wxPython/contrib/glcanvas/glcanvas.i b/wxPython/contrib/glcanvas/glcanvas.i index 6f6f3708fa..b403ce7854 100644 --- a/wxPython/contrib/glcanvas/glcanvas.i +++ b/wxPython/contrib/glcanvas/glcanvas.i @@ -25,6 +25,7 @@ %import core.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } MAKE_CONST_WXSTRING2(GLCanvasNameStr, wxT("GLCanvas")); diff --git a/wxPython/contrib/iewin/iewin.i b/wxPython/contrib/iewin/iewin.i index 01764566aa..cac700966c 100644 --- a/wxPython/contrib/iewin/iewin.i +++ b/wxPython/contrib/iewin/iewin.i @@ -25,6 +25,7 @@ %import core.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } MAKE_CONST_WXSTRING_NOSWIG(PanelNameStr); diff --git a/wxPython/contrib/ogl/ogl.i b/wxPython/contrib/ogl/ogl.i index 1e91d0af7e..eb27e0a041 100644 --- a/wxPython/contrib/ogl/ogl.i +++ b/wxPython/contrib/ogl/ogl.i @@ -24,6 +24,7 @@ %import windows.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } MAKE_CONST_WXSTRING_NOSWIG(EmptyString); diff --git a/wxPython/contrib/stc/stc.i b/wxPython/contrib/stc/stc.i index 64d98e6d3c..505e5c548d 100644 --- a/wxPython/contrib/stc/stc.i +++ b/wxPython/contrib/stc/stc.i @@ -25,6 +25,7 @@ %import core.i %import misc.i // for DnD %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } MAKE_CONST_WXSTRING(STCNameStr); diff --git a/wxPython/contrib/xrc/xrc.i b/wxPython/contrib/xrc/xrc.i index 59d26bf353..1ad4e71469 100644 --- a/wxPython/contrib/xrc/xrc.i +++ b/wxPython/contrib/xrc/xrc.i @@ -27,6 +27,7 @@ %import core.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } MAKE_CONST_WXSTRING_NOSWIG(EmptyString); diff --git a/wxPython/src/_core_ex.py b/wxPython/src/_core_ex.py index 0bb3c2e8b4..fb51c89d6f 100644 --- a/wxPython/src/_core_ex.py +++ b/wxPython/src/_core_ex.py @@ -213,6 +213,24 @@ class FutureCall: wx.CallAfter(self.Stop) + +#---------------------------------------------------------------------------- +# Control which items in this module should be documented by epydoc. +# We allow only classes and functions, which will help reduce the size +# of the docs by filtering out the zillions of constants, EVT objects, +# and etc that don't make much sense by themselves, but are instead +# documented (or will be) as part of the classes/functions/methods +# where they should be used. + +def __docfilter__(name): + import types + obj = globals().get(name, None) + if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: + return False + if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'): + return False + return True + #---------------------------------------------------------------------------- #---------------------------------------------------------------------------- diff --git a/wxPython/src/calendar.i b/wxPython/src/calendar.i index 2d21139061..96ba7d9e13 100644 --- a/wxPython/src/calendar.i +++ b/wxPython/src/calendar.i @@ -24,6 +24,7 @@ %import misc.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } %include _calendar_rename.i diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index db14465942..258bdbc095 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -23,6 +23,7 @@ %import core.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } %include _controls_rename.i diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i index 117e370581..93daf3fdb3 100644 --- a/wxPython/src/gdi.i +++ b/wxPython/src/gdi.i @@ -24,6 +24,7 @@ %import core.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } %include _gdi_rename.i diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 8abc7cc0a6..08ee4d60b6 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -27,6 +27,7 @@ %import windows.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } %include _grid_rename.i diff --git a/wxPython/src/html.i b/wxPython/src/html.i index 5a8992e0ea..535ff6aeee 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -30,6 +30,7 @@ %import windows.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } %include _html_rename.i diff --git a/wxPython/src/misc.i b/wxPython/src/misc.i index 37342395a0..1a1ed143fa 100644 --- a/wxPython/src/misc.i +++ b/wxPython/src/misc.i @@ -26,6 +26,7 @@ %import core.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } %include _misc_rename.i diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index 4510c4f996..570a95305f 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -25,6 +25,7 @@ %import core.i %pythoncode { wx = core } +%pythoncode { __docfilter__ = wx.__docfilter__ } %include _windows_rename.i