1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. module:: wx.lib.pubsub.utils.xmltopicdefnprovider
.. currentmodule:: wx.lib.pubsub.utils.xmltopicdefnprovider
.. highlight:: python
.. _wx.lib.pubsub.utils.xmltopicdefnprovider:
==========================================================================================================================================
|phoenix_title| **wx.lib.pubsub.utils.xmltopicdefnprovider**
==========================================================================================================================================
Contributed by Joshua R English, adapted by Oliver Schoenborn to be
consistent with pubsub API.
An extension for pubsub (http://pubsub.sourceforge.net) so topic tree
specification can be encoded in XML format rather than pubsub's default
Python nested class format.
To use:
xml = '''
<topicdefntree>
<description>Test showing topic hierarchy and inheritance</description>
<topic id="parent">
<description>Parent with a parameter and subtopics</description>
<listenerspec>
<arg id="name" optional="true">given name</arg>
<arg id="lastname">surname</arg>
</listenerspec>
<topic id="child">
<description>This is the first child</description>
<listenerspec>
<arg id="nick">A nickname</arg>
</listenerspec>
</topic>
</topic>
</topicdefntree>
'''
These topic definitions are loaded through an XmlTopicDefnProvider:
pub.addTopicDefnProvider( XmlTopicDefnProvider(xml) )
The XmlTopicDefnProvider also accepts a filename instead of XML string:
provider = XmlTopicDefnProvider("path/to/XMLfile.xml", TOPIC_TREE_FROM_FILE)
pub.addTopicDefnProvider( provider )
Topics can be exported to an XML file using the exportTopicTreeSpecXml function.
This will create a text file for the XML and return the string representation
of the XML tree.
:copyright: Copyright since 2013 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
|function_summary| Functions Summary
====================================
================================================================================ ================================================================================
:func:`~wx.lib.pubsub.utils.xmltopicdefnprovider.exportTopicTreeSpecXml` If rootTopic is None, then pub.getDefaultTopicTreeRoot() is assumed.
:func:`~wx.lib.pubsub.utils.xmltopicdefnprovider.indent`
================================================================================ ================================================================================
|
|class_summary| Classes Summary
===============================
=================================================================================================== ================================================================================
:ref:`~wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider`
:ref:`~wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider.UnrecognizedSourceFormatError`
:ref:`~wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider.XmlParserError`
:ref:`~wx.lib.pubsub.utils.xmltopicdefnprovider.XmlVisitor`
=================================================================================================== ================================================================================
|
.. toctree::
:maxdepth: 1
:hidden:
wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider
wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider.UnrecognizedSourceFormatError
wx.lib.pubsub.utils.xmltopicdefnprovider.XmlTopicDefnProvider.XmlParserError
wx.lib.pubsub.utils.xmltopicdefnprovider.XmlVisitor
Functions
------------
.. function:: exportTopicTreeSpecXml(moduleName=None, rootTopic=None, bak='bak', moduleDoc=None)
If rootTopic is None, then pub.getDefaultTopicTreeRoot() is assumed.
.. function:: indent(elem, level=0)
|