mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 01:30:07 +01:00
Phoenix:
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:
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
.. _stock items:
|
||||
.. _stock id list:
|
||||
|
||||
===============================================
|
||||
|phoenix_title| **Stock items**
|
||||
|
||||
@@ -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())
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
if wx.Platform == '__WXGTK__':
|
||||
bmp = wx.ArtProvider.GetBitmap("gtk-cdrom", wx.ART_MENU)
|
||||
|
||||
23
docs/sphinx/rest_substitutions/tables/ArtProvider.1.rst
Normal file
23
docs/sphinx/rest_substitutions/tables/ArtProvider.1.rst
Normal file
@@ -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``
|
||||
============================================ ======================================= ==================================
|
||||
|
||||
|
|
||||
|
||||
@@ -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
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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']:
|
||||
|
||||
Reference in New Issue
Block a user