diff --git a/docs/sphinx/rest_substitutions/overviews/stock_items.rst b/docs/sphinx/rest_substitutions/overviews/stock_items.rst index ec2f5ab3..c2190b5a 100644 --- a/docs/sphinx/rest_substitutions/overviews/stock_items.rst +++ b/docs/sphinx/rest_substitutions/overviews/stock_items.rst @@ -2,6 +2,7 @@ .. _stock items: +.. _stock id list: =============================================== |phoenix_title| **Stock items** diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.1.py new file mode 100644 index 00000000..e4e1f0a4 --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.1.py @@ -0,0 +1,18 @@ + + class MyProvider(wx.ArtProvider): + + def CreateBitmap(self, id, client, size): + + # Your implementation of CreateBitmap here + pass + + + # optionally override this one as well + def CreateIconBundle(self, id, client): + + # Your implementation of CreateIconBundle here + pass + + + # Later on... + wx.ArtProvider.Push(MyProvider()) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.2.py new file mode 100644 index 00000000..a5492206 --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.2.py @@ -0,0 +1,4 @@ + + if wx.Platform == '__WXGTK__': + bmp = wx.ArtProvider.GetBitmap("gtk-cdrom", wx.ART_MENU) + diff --git a/docs/sphinx/rest_substitutions/tables/ArtProvider.1.rst b/docs/sphinx/rest_substitutions/tables/ArtProvider.1.rst new file mode 100644 index 00000000..d7b4d9a8 --- /dev/null +++ b/docs/sphinx/rest_substitutions/tables/ArtProvider.1.rst @@ -0,0 +1,23 @@ +============================================ ======================================= ================================== +- ``ART_ERROR`` - ``ART_GOTO_LAST`` (since 2.9.2) - ``ART_FILE_SAVE_AS`` +- ``ART_QUESTION`` - ``ART_PRINT`` - ``ART_DELETE`` +- ``ART_WARNING`` - ``ART_HELP`` - ``ART_COPY`` +- ``ART_INFORMATION`` - ``ART_TIP`` - ``ART_CUT`` +- ``ART_ADD_BOOKMARK`` - ``ART_REPORT_VIEW`` - ``ART_PASTE`` +- ``ART_DEL_BOOKMARK`` - ``ART_LIST_VIEW`` - ``ART_UNDO`` +- ``ART_HELP_SIDE_PANEL`` - ``ART_NEW_DIR`` - ``ART_REDO`` +- ``ART_HELP_SETTINGS`` - ``ART_FOLDER`` - ``ART_PLUS`` (since 2.9.2) +- ``ART_HELP_BOOK`` - ``ART_FOLDER_OPEN`` - ``ART_MINUS`` (since 2.9.2) +- ``ART_HELP_FOLDER`` - ``ART_GO_DIR_UP`` - ``ART_CLOSE`` +- ``ART_HELP_PAGE`` - ``ART_EXECUTABLE_FILE`` - ``ART_QUIT`` +- ``ART_GO_BACK`` - ``ART_NORMAL_FILE`` - ``ART_FIND`` +- ``ART_GO_FORWARD`` - ``ART_TICK_MARK`` - ``ART_FIND_AND_REPLACE`` +- ``ART_GO_UP`` - ``ART_CROSS_MARK`` - ``ART_HARDDISK`` +- ``ART_GO_DOWN`` - ``ART_MISSING_IMAGE`` - ``ART_FLOPPY`` +- ``ART_GO_TO_PARENT`` - ``ART_NEW`` - ``ART_CDROM`` +- ``ART_GO_HOME`` - ``ART_FILE_OPEN`` +- ``ART_GOTO_FIRST`` (since 2.9.2) - ``ART_FILE_SAVE`` +============================================ ======================================= ================================== + +| + diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index 13f8d453..deb00a3d 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -1143,11 +1143,12 @@ class Table(Node): .. note:: - There are 3 customized versions of 3 XML tables up to now, for various reasons: + There are 4 customized versions of 4 XML tables up to now, for various reasons: 1. The `wx.Sizer` flags table is a flexible grid table, very difficult to ReSTify automatically 2. The `wx.ColourDatabase` table of colour comes up all messy when ReSTified from XML 3. The "wxWidgets 2.8 Compatibility Functions" table for `wx.VScrolledWindow` + 4. The `wx.ArtProvider` IDs table """ diff --git a/sphinxtools/constants.py b/sphinxtools/constants.py index dd9f2125..1bf0baf5 100644 --- a/sphinxtools/constants.py +++ b/sphinxtools/constants.py @@ -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') diff --git a/sphinxtools/librarydescription.py b/sphinxtools/librarydescription.py index 04d783ed..59c1837f 100644 --- a/sphinxtools/librarydescription.py +++ b/sphinxtools/librarydescription.py @@ -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: diff --git a/sphinxtools/modulehunter.py b/sphinxtools/modulehunter.py index 036e38fa..198a6ae1 100644 --- a/sphinxtools/modulehunter.py +++ b/sphinxtools/modulehunter.py @@ -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 diff --git a/sphinxtools/postprocess.py b/sphinxtools/postprocess.py index d439fb32..1feb10d2 100644 --- a/sphinxtools/postprocess.py +++ b/sphinxtools/postprocess.py @@ -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 diff --git a/sphinxtools/utilities.py b/sphinxtools/utilities.py index aad58d07..0eb3758e 100644 --- a/sphinxtools/utilities.py +++ b/sphinxtools/utilities.py @@ -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']: