- Update the `sphinx_generator.py` to handle the latest `sashwin.py` and `laywin.py`;
- Remove non-pertinent sections from the wxWidgets docs (stuff talking about cpp/h include files);
- Optimize the handling of enumeration stuff thus reducing the number of unreferenced classes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Andrea Gavana
2012-05-30 19:06:06 +00:00
parent 45ac7c4273
commit c56045244f
6 changed files with 70 additions and 22 deletions

View File

@@ -20,10 +20,11 @@ import buildtools.version as version
from buildtools.config import phoenixDir, wxDir
# List of strings that should be ignored when creating inline literals
# such as ``ID_ANY`` or ``HORIZONtAL``, with double backticks
# such as ``ID_ANY`` or ``HORIZONTAL``, with double backticks
IGNORE = ['wxPython', 'wxWidgets', 'wxOSX', 'wxMGL', 'wxDFB', 'wxMAC', 'wxGTK', 'wxGTK2', 'wxUniversal',
'OS', 'X', 'OSX', 'DFB', 'MAC', 'GTK', 'GTK2', 'MSW', 'wxMSW', 'X11', 'OS2', 'MS', 'XP', 'GTK+',
'UI', 'GUI', '--', 'OTOH', 'GDI+', 'API', 'NT', 'RTL', 'GDI', '3D', 'MDI']
'UI', 'GUI', '--', 'OTOH', 'GDI+', 'API', 'NT', 'RTL', 'GDI', '3D', 'MDI', 'SDI', 'TDI', 'URL',
'XPM', 'HTML', 'MIME', 'C++', 'XDG', 'A4', 'A5']
# C++ stuff to Python/ReST stuff
VALUE_MAP = {'true': '``True``',
@@ -72,8 +73,31 @@ MODULENAME_REPLACE = {'_core' : '',
'_adv' : 'adv.',
}
NO_MODULE = {'DatePickerCtrlGeneric': 'adv.',
'GenericCalendarCtrl': 'adv.'}
NO_MODULE = {
# -- wxAdvanced -- #
# Widgets
'DatePickerCtrlGeneric': 'adv.',
'GenericCalendarCtrl' : 'adv.',
# Enums/constants
'AnimationType' : 'adv.',
'CalendarDateBorder' : 'adv.',
'CalendarHitTestResult': 'adv.',
'LayoutAlignment' : 'adv.',
'LayoutOrientation' : 'adv.',
'SashDragStatus' : 'adv.',
'SashEdgePosition' : 'adv.',
'TaskBarIconType' : 'adv.',
# -- wxDataView -- #
# Widgets
# Enums/constants
'DataViewCellMode' : 'dataview.',
'DataViewCellRenderState': 'dataview.',
'DataViewColumnFlags' : 'dataview.',
}
# Other C++ specific things to strip away
CPP_ITEMS = ['*', '&', 'const', 'unsigned', '(size_t)', 'size_t', 'void']
@@ -136,7 +160,15 @@ MAGIC_METHODS = {
# TODO: add more
}
SECTIONS_EXCLUDE = {'TextCtrl': ('|phoenix_title| TextCtrl and ``C++`` Streams', '|phoenix_title| Event Handling')}
SECTIONS_EXCLUDE = {
'ConfigBase' : ('Related Include Files', '|phoenix_title| Example'),
'KeyboardState': ('This class is implemented ', '.. seealso::'),
'Menu' : ('|phoenix_title| Allocation strategy', '|phoenix_title| Event handling'),
'MouseState' : ('This class is implemented', '.. seealso::'),
'Panel' : ('Please see :ref:`/', 'if not all characters'),
'TextCtrl' : ('|phoenix_title| TextCtrl and ``C++`` Streams', '|phoenix_title| Event Handling'),
'TextEntry' : ('Notice that you need', 'Currently this method is only '),
}
# A regex to split a string keeping the whitespaces
RE_KEEP_SPACES = re.compile(r'(\s+)')
@@ -155,7 +187,7 @@ PYTHON_DOCS = 'http://docs.python.org/library/'
NUMPY_DOCS = 'http://docs.scipy.org/doc/numpy/reference/generated/'
EXTERN_INHERITANCE = {'UserDict.' : PYTHON_DOCS,
'ctypes.' : PYTHON_DOCS,
'ctypes.' : PYTHON_DOCS,
'code.' : PYTHON_DOCS,
'exceptions.': PYTHON_DOCS,
'threading.' : PYTHON_DOCS,

View File

@@ -302,13 +302,21 @@ def RemoveUnreferenced(input, class_summary, enum_base, unreferenced_classes, te
# Overview pages
continue
if '.' in reg:
# Sometimes in wxWidgets the enums and structures are reported as
# Class.Enum/Class.Structure, while we only have links to Enum and Structures
possible_enum = reg.split('.')[1]
if possible_enum in enum_base or possible_enum in class_summary:
text = text.replace(':ref:`%s`'%reg, ':ref:`%s`'%possible_enum, 1)
continue
if reg not in unreferenced_classes:
unreferenced_classes[reg] = []
split = os.path.split(input)[1]
if split not in unreferenced_classes[reg]:
unreferenced_classes[reg].append(split)
text = text.replace(':ref:`%s`'%reg, '`%s`'%reg, 1)
return text, unreferenced_classes