mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 09:40:07 +01:00
Phoenix stuff:
1) Fixes on the problems reported by Werner on wx.EvtHandler (and there were many others, hopefully they should be OK now); 2) Integration of Chris' samples on wx.GridBagSizer (see http://xoomer.virgilio.it/infinity77/Phoenix/GridBagSizer.html#gridbagsizer); 3) Start on the Documentation guidelines (see http://xoomer.virgilio.it/infinity77/Phoenix/DocstringsGuidelines.html); 4) Integration of Werner's patches on _core.py and app.py for the docstrings. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -144,7 +144,7 @@ HTML_REPLACE = ['module', 'function', 'method', 'class', 'classmethod', 'staticm
|
||||
|
||||
# The SVN revision of wxWidgets/Phoenix used to build the Sphinx docs.
|
||||
# There must be a more intelligent way to get this information automatically.
|
||||
SVN_REVISION = '71022'
|
||||
SVN_REVISION = '71066'
|
||||
|
||||
# Today's date representation for the Sphinx HTML docs
|
||||
TODAY = datetime.date.today().strftime('%d %B %Y')
|
||||
|
||||
@@ -145,7 +145,10 @@ def BuildEnumsAndMethods(sphinxDir):
|
||||
text = text.replace(':note:', '.. note::')
|
||||
text = text.replace(':see:', '.. seealso::')
|
||||
text = text.replace('`String`&', 'string')
|
||||
|
||||
text = text.replace('See also\n', '.. seealso:: ')
|
||||
# Avoid Sphinx warnings on wx.TreeCtrl
|
||||
text = text.replace('**( `', '** ( `')
|
||||
|
||||
if text != orig_text:
|
||||
fid = open(input, 'wt')
|
||||
fid.write(text)
|
||||
@@ -184,8 +187,14 @@ def BuildEnumsAndMethods(sphinxDir):
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
def FindInherited(input, class_summary, enum_base, text):
|
||||
|
||||
regex = re.findall(':meth:\S+', text)
|
||||
|
||||
# Malformed inter-links
|
||||
regex = re.findall(r'\S:meth:\S+', text)
|
||||
for regs in regex:
|
||||
newreg = regs[0] + ' ' + regs[1:]
|
||||
text = text.replace(regs, newreg)
|
||||
|
||||
regex = re.findall(r':meth:\S+', text)
|
||||
|
||||
for regs in regex:
|
||||
|
||||
@@ -304,20 +313,25 @@ def ReformatFunctions(file):
|
||||
label = local_file.split('.')[0:-2][0]
|
||||
|
||||
names = functions.keys()
|
||||
names = [name.lower() for name in names]
|
||||
names.sort()
|
||||
|
||||
text = templates.TEMPLATE_FUNCTION_SUMMARY % (label, label)
|
||||
|
||||
letters = []
|
||||
for fun in names:
|
||||
if fun[0] not in letters:
|
||||
letters.append(fun[0].upper())
|
||||
upper = fun[0].upper()
|
||||
if upper not in letters:
|
||||
letters.append(upper)
|
||||
|
||||
text += ' | '.join(['`%s`_'%letter for letter in letters])
|
||||
text += ' | '.join([':ref:`%s <%s %s>`'%(letter, label, letter) for letter in letters])
|
||||
text += '\n\n\n'
|
||||
|
||||
names = functions.keys()
|
||||
names = sorted(names, key=str.lower)
|
||||
|
||||
for letter in letters:
|
||||
text += '%s\n^\n\n'%letter
|
||||
text += '.. _%s %s:\n\n%s\n^\n\n'%(label, letter, letter)
|
||||
for fun in names:
|
||||
if fun[0].upper() != letter:
|
||||
continue
|
||||
|
||||
@@ -198,6 +198,12 @@ TEMPLATE_EVENTS = '''
|
||||
|
||||
'''
|
||||
|
||||
TEMPLATE_CONTRIB = '''
|
||||
|
||||
|user| Contributed Examples
|
||||
===========================
|
||||
|
||||
'''
|
||||
|
||||
# Template used to generate the widgets gallery (this needs some work)
|
||||
TEMPLATE_GALLERY = '''
|
||||
|
||||
@@ -19,6 +19,8 @@ import cPickle
|
||||
from UserDict import UserDict
|
||||
|
||||
# Phoenix-specific imports
|
||||
from templates import TEMPLATE_CONTRIB
|
||||
|
||||
from constants import IGNORE, PUNCTUATION
|
||||
from constants import CPP_ITEMS, VERSION, VALUE_MAP
|
||||
from constants import RE_KEEP_SPACES
|
||||
@@ -587,3 +589,31 @@ def Wx2Sphinx(name):
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
|
||||
def FormatContributedSnippets(kind, contrib_snippets):
|
||||
|
||||
spacer = ''
|
||||
if kind == 'function':
|
||||
spacer = 3*' '
|
||||
elif kind == 'method':
|
||||
spacer = 6*' '
|
||||
|
||||
if kind == 'class':
|
||||
text = TEMPLATE_CONTRIB
|
||||
else:
|
||||
text = spacer + '\n**Contributed Examples:**\n\n'
|
||||
|
||||
for indx, snippet in enumerate(contrib_snippets):
|
||||
fid = open(snippet, 'rt')
|
||||
lines = fid.readlines()
|
||||
fid.close()
|
||||
user = lines[0].replace('##', '').strip()
|
||||
|
||||
text += '\n' + spacer + 'Example %d (%s)::\n\n'%(indx+1, user)
|
||||
|
||||
for line in lines[1:]:
|
||||
text += 4*' '+ spacer + line
|
||||
|
||||
text += '\n'
|
||||
|
||||
return text
|
||||
|
||||
Reference in New Issue
Block a user