1. Add a substitution of the |SVN| string using subprocess;
2. Add the latest ArtProvider stuff (and replace `ArtID` and `ArtClient` parameter types with `string`). 

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Andrea Gavana
2012-04-08 11:13:07 +00:00
parent c08c2d64e2
commit e262cef61a
10 changed files with 81 additions and 21 deletions

View File

@@ -142,10 +142,6 @@ RE_KEEP_SPACES = re.compile(r'(\s+)')
# description
HTML_REPLACE = ['module', 'function', 'method', 'class', 'classmethod', 'staticmethod', 'attribute']
# 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 = '71140'
# Today's date representation for the Sphinx HTML docs
TODAY = datetime.date.today().strftime('%d %B %Y')

View File

@@ -77,8 +77,10 @@ def generic_summary(libraryItem, stream):
if item.is_redundant or item.GetShortName().startswith('__test') or '.extern.' in item.name:
continue
docs = ChopDescription(ReplaceWxDot(item.docs))
item_docs = ReplaceWxDot(item.docs)
item_docs = KillEpydoc(item, item_docs)
docs = ChopDescription(item_docs)
table.append((item.name, docs))
if item.kind != object_types.FUNCTION:
@@ -133,7 +135,7 @@ def ReplaceWxDot(text):
# Extract the section header
splitted = line.split()
header = ' '.join(line[2:])
header = ' '.join(splitted[2:])
header = header.strip()
newtext += header + '\n'
@@ -474,10 +476,10 @@ class Library(ParentBase):
stream.write(header)
newtext = ReplaceWxDot(self.docs)
stream.write(newtext + '\n\n')
newtext = KillEpydoc(self, newtext)
stream.write(newtext + '\n\n')
generic_summary(self, stream)
WriteSphinxOutput(stream, self.sphinx_file)
@@ -526,10 +528,10 @@ class Module(ParentBase):
stream.write(header)
newtext = ReplaceWxDot(self.docs)
stream.write(newtext + '\n\n')
newtext = KillEpydoc(self, newtext)
stream.write(newtext + '\n\n')
spacer = ' '*self.name.count('.')
if self.kind != object_types.PACKAGE:

View File

@@ -89,7 +89,7 @@ def format_method(method):
if "def " not in method:
return None, None
indx1, indx2, indx3 = method.index("def "), method.index("("), method.rindex(")")
name = method[indx1+4:indx2]
signature = method[indx2+1:indx3]
@@ -232,7 +232,7 @@ def describe_func(obj, parent_class, module_name):
except AttributeError:
# Funny comtypes...
return
if name.startswith("_") and "__init__" not in name:
return

View File

@@ -16,13 +16,14 @@ import re
import cPickle
import glob
import random
import subprocess
# Phoenix-specific imports
import templates
from buildtools.config import copyIfNewer, writeIfChanged, newer
from utilities import Wx2Sphinx
from constants import HTML_REPLACE, SVN_REVISION, TODAY, SPHINXROOT, SECTIONS_EXCLUDE
from constants import HTML_REPLACE, TODAY, SPHINXROOT, SECTIONS_EXCLUDE
from constants import CONSTANT_INSTANCES, WIDGETS_IMAGES_ROOT, SPHINX_IMAGES_ROOT
@@ -601,12 +602,11 @@ def PostProcess(folder):
orig_text = text = fid.read()
fid.close()
text = text.replace('|SVN|', SVN_REVISION)
text = text.replace('|TODAY|', TODAY)
split = os.path.split(files)[1]
if split not in ['index.html', 'main.html']:
if split in ['index.html', 'main.html']:
text = ChangeSVNRevision(text)
else:
text = text.replace(phoenix_image, '')
## text = AddPrettyTable(text)
@@ -658,3 +658,18 @@ def PostProcess(folder):
# ----------------------------------------------------------------------- #
def ChangeSVNRevision(text):
svn_result = subprocess.Popen(["svn", "info"], stdout=subprocess.PIPE).communicate()[0]
SVN_REVISION = ''
for line in svn_result.split("\n"):
if line.startswith("Revision"):
SVN_REVISION = line.split(":")[-1].strip()
break
if not SVN_REVISION:
text = text.replace('|TODAY|', TODAY)
return text
text = text.replace('|SVN|', SVN_REVISION)
return text

View File

@@ -253,7 +253,7 @@ def PythonizeType(ptype):
if plower == 'double':
ptype = 'float'
if plower in ['string', 'char']:
if plower in ['string', 'char', 'artid', 'artclient']:
ptype = 'string'
if plower in ['coord', 'byte', 'fileoffset', 'short', 'time_t', 'intptr', 'uintptr', 'windowid']: