mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
Phoenix:
- Handle the `typedef` stuff as classes when the `docAsClass` attribute is set to ``True`` in the documentation building process (see `ScrolledWindow` and `ScrolledCanvas`). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71732 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1865,7 +1865,7 @@ class XMLDocString(object):
|
||||
self.kind = 'method'
|
||||
elif isinstance(xml_item, (extractors.FunctionDef, extractors.PyFunctionDef)):
|
||||
self.kind = 'function'
|
||||
elif isinstance(xml_item, (extractors.ClassDef, extractors.PyClassDef)):
|
||||
elif isinstance(xml_item, (extractors.ClassDef, extractors.PyClassDef, extractors.TypedefDef)):
|
||||
self.kind = 'class'
|
||||
self.appearance = FindControlImages(xml_item)
|
||||
self.class_name = RemoveWxPrefix(xml_item.name) or xml_item.pyName
|
||||
@@ -3196,7 +3196,39 @@ class SphinxGenerator(generators.DocsGeneratorBase):
|
||||
# -----------------------------------------------------------------------
|
||||
def generateTypedef(self, typedef):
|
||||
assert isinstance(typedef, extractors.TypedefDef)
|
||||
# write nothing for this one
|
||||
|
||||
if typedef.ignored or not typedef.docAsClass:
|
||||
return
|
||||
|
||||
name = RemoveWxPrefix(typedef.name) or typedef.pyName
|
||||
typedef.module = self.current_module
|
||||
|
||||
all_classes = {}
|
||||
nodename = fullname = name
|
||||
specials = [nodename]
|
||||
|
||||
baselist = [base for base in typedef.bases if base != 'object']
|
||||
all_classes[nodename] = (nodename, fullname, baselist)
|
||||
|
||||
self.UnIndent(typedef)
|
||||
|
||||
typedef.nodeBases = all_classes, specials
|
||||
typedef.subClasses = []
|
||||
typedef.method_list = typedef.property_list = []
|
||||
typedef.pyDocstring = typedef.briefDoc
|
||||
self.current_class = typedef
|
||||
|
||||
docstring = XMLDocString(typedef)
|
||||
docstring.kind = 'class'
|
||||
|
||||
filename = self.current_module + "%s.txt"%name
|
||||
docstring.output_file = filename
|
||||
docstring.current_module = self.current_module
|
||||
|
||||
docstring.Dump()
|
||||
|
||||
PickleClassInfo(self.current_module + name, self.current_class, docstring.short_description)
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
def generateWigCode(self, wig):
|
||||
|
||||
@@ -266,6 +266,11 @@ def FindInherited(input, class_summary, enum_base, text):
|
||||
if meth_name in methods:
|
||||
continue
|
||||
|
||||
if meth_name in class_summary:
|
||||
newtext = ':ref:`%s`'%meth_name
|
||||
text = text.replace(regs, newtext, 1)
|
||||
continue
|
||||
|
||||
newstr = ''
|
||||
|
||||
for cls in bases:
|
||||
|
||||
Reference in New Issue
Block a user