pax_global_header 0000666 0000000 0000000 00000000064 14756414247 0014530 g ustar 00root root 0000000 0000000 52 comment=ea1f7537ae8d84a8d6612f9811596e0091291c90
breathe-doc-breathe-10a36f3/ 0000775 0000000 0000000 00000000000 14756414247 0015642 5 ustar 00root root 0000000 0000000 breathe-doc-breathe-10a36f3/.github/ 0000775 0000000 0000000 00000000000 14756414247 0017202 5 ustar 00root root 0000000 0000000 breathe-doc-breathe-10a36f3/.github/FUNDING.yml 0000664 0000000 0000000 00000001270 14756414247 0021017 0 ustar 00root root 0000000 0000000 # These are supported funding model platforms
github: breathe-doc
patreon: # Replace with a single Patreon username
open_collective: breathe
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
breathe-doc-breathe-10a36f3/.github/dependabot.yml 0000664 0000000 0000000 00000000273 14756414247 0022034 0 ustar 00root root 0000000 0000000 version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
breathe-doc-breathe-10a36f3/.github/workflows/ 0000775 0000000 0000000 00000000000 14756414247 0021237 5 ustar 00root root 0000000 0000000 breathe-doc-breathe-10a36f3/.github/workflows/create-release.yml 0000664 0000000 0000000 00000002255 14756414247 0024647 0 ustar 00root root 0000000 0000000 name: Create release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
FORCE_COLOR: "1"
UV_SYSTEM_PYTHON: "1" # make uv do global installs
jobs:
publish-pypi:
runs-on: ubuntu-latest
name: PyPI Release
environment: release
if: github.repository_owner == 'breathe-doc'
permissions:
id-token: write # for PyPI trusted publishing
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: latest
enable-cache: false
- name: Install build dependencies (pypa/build, twine)
run: uv pip install build "twine>=5.1"
- name: Build distribution
run: python -m build
- name: Check distribution
run: |
twine check --strict dist/*
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
breathe-doc-breathe-10a36f3/.github/workflows/documentation.yml 0000664 0000000 0000000 00000002567 14756414247 0024645 0 ustar 00root root 0000000 0000000 name: Build documentation
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
FORCE_COLOR: "1"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install graphviz
- name: Install Doxygen from GitHub releases
env:
DOXYGEN_VERSION: 1.9.4
run: |
mkdir doxygen-bin-arc && cd doxygen-bin-arc
curl -LsSf https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz > doxygen.tar.gz
gunzip doxygen.tar.gz
tar xf doxygen.tar
cd doxygen-$DOXYGEN_VERSION
sudo make install
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[docs]
- name: Build the documentation
run: |
make html
rm documentation/build/html/.buildinfo
- uses: actions/upload-artifact@v4
with:
name: docs build artifacts
path: |
documentation/build/html
examples/*/*/xml
breathe-doc-breathe-10a36f3/.github/workflows/lint.yml 0000664 0000000 0000000 00000002602 14756414247 0022730 0 ustar 00root root 0000000 0000000 name: Lint source code
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
FORCE_COLOR: "1"
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Ruff
uses: astral-sh/ruff-action@v3
with:
args: --version
version: 0.9.2
- name: Lint with Ruff
run: ruff check --output-format=github
- name: Format with Ruff
run: ruff format --diff
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[lint]"
- name: Type check with mypy
run: mypy
twine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade twine build
- name: Lint with twine
run: |
python -m build .
twine check dist/*
breathe-doc-breathe-10a36f3/.github/workflows/unit_tests.yml 0000664 0000000 0000000 00000004303 14756414247 0024163 0 ustar 00root root 0000000 0000000 name: Tests
on:
push:
paths:
- ".github/workflows/unit_tests.yml"
- "breathe/**"
- "tests/**"
pull_request:
paths:
- ".github/workflows/unit_tests.yml"
- "breathe/**"
- "tests/**"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
FORCE_COLOR: "1"
PYTHONDEVMODE: "1" # -X dev
PYTHONWARNDEFAULTENCODING: "1" # -X warn_default_encoding
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
sphinx-version:
- '7.2' # Ubuntu 24.04
- '7.4' # Ubuntu 24.10
- '8.1' # Ubuntu 25.04
exclude:
- python-version: '3.9'
sphinx-version: '8.0'
- python-version: '3.9'
sphinx-version: '8.1'
- python-version: '3.12'
sphinx-version: '6.2'
- python-version: '3.13'
sphinx-version: '6.2'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Install Sphinx ${{ matrix.sphinx-version }}
run: python -m pip install --upgrade "Sphinx~=${{ matrix.sphinx-version }}.0"
- name: Test with pytest
run: python -m pytest -vv
env:
PYTHONWARNINGS: "error" # treat all warnings as errors
test-latest-sphinx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Install Sphinx master
run: python -m pip install "Sphinx @ git+https://github.com/sphinx-doc/sphinx"
- name: Test with pytest
run: python -m pytest -vv
breathe-doc-breathe-10a36f3/.gitignore 0000664 0000000 0000000 00000001746 14756414247 0017642 0 ustar 00root root 0000000 0000000 *.pyc
/.project
/.pydevproject
build/
/dist
/breathe.egg-info
/.mypy_cache
# Folder for placing stuff to be ignored
/ignored
# My virtual env folder
/python-2.7.4
# Test folder for building simple examples of the documentation
/simple
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
## Directory-based project format
.idea/
# if you remove the above rule, at least ignore user-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# and these sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
## File-based project format
*.ipr
*.iws
*.iml
## Additional for IntelliJ
out/
# generated by mpeltonen/sbt-idea plugin
.idea_modules/
# generated by JIRA plugin
atlassian-ide-plugin.xml
# generated by Crashlytics plugin (for Android Studio and Intellij)
com_crashlytics_export_strings.xml
# modified by build process
examples/doxygen/example.tag
examples/specific/dot_graphs/xml/dotfile.dot
breathe-doc-breathe-10a36f3/.readthedocs.yaml 0000664 0000000 0000000 00000000267 14756414247 0021076 0 ustar 00root root 0000000 0000000 version: 2
python:
version: 3
sphinx:
builder: html
configuration: documentation/source/conf.py
fail_on_warning: false
conda:
environment: documentation/environment.yaml
breathe-doc-breathe-10a36f3/.ruff.toml 0000664 0000000 0000000 00000002621 14756414247 0017560 0 ustar 00root root 0000000 0000000 target-version = "py39" # Pin Ruff to Python 3.9
line-length = 100
output-format = "full"
[format]
preview = true
quote-style = "double"
[lint]
preview = true
ignore = [
"UP031", # Use format specifiers instead of percent format
]
select = [
"C4", # flake8-comprehensions
# "B", # flake8-bugbear
# "D", # pydocstyle
"E", # pycodestyle
"F", # pyflakes
"FA", # flake8-future-annotations
"FLY", # flynt
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"LOG", # flake8-logging
# "N", # pep8-naming
"PERF", # perflint
"PGH", # pygrep-hooks
"PT", # flake8-pytest-style
"TC", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle
]
[lint.per-file-ignores]
"breathe/parser/{compound,index}super.py" = [
"E266", # Too many leading `#` before block comment
]
"examples/doxygen/pyexample.py" = [
"E266", # Too many leading `#` before block comment
]
[lint.flake8-quotes]
inline-quotes = "double"
[lint.flake8-type-checking]
exempt-modules = []
strict = true
[lint.flake8-tidy-imports]
ban-relative-imports = "all"
[lint.isort]
forced-separate = [
"tests",
]
required-imports = [
"from __future__ import annotations",
]
[lint.pydocstyle]
convention = "pep257"
ignore-decorators = ["typing.overload"]
ignore-var-parameters = true
breathe-doc-breathe-10a36f3/CHANGELOG.rst 0000664 0000000 0000000 00000071700 14756414247 0017670 0 ustar 00root root 0000000 0000000 Change Log
----------
Inspired by `Keepachangelog.com `__.
- 2025-02-22 - **Breathe v4.36.0**
- Update `test_renderer` so that tests pass with Sphinx 7.2.
`#976 `__
- Fix PosixPath issue with Sphinx 7.2.
`#964 `__
- Avoid `RemovedInSphinx80Warning` in path-manipulation code.
`#977 `__
- Require Sphinx 7.2 or later, Python 3.9 or later,
and Doxygen 1.9.2 or later.
`#887 `__,
`#946 `__
`#955 `__
- Begin to use pathlib.
- Resolve full title for doxygenpage and doxygengroup
and allow for omitting the title all together
`#939 `__
- Insert signature name for use with Sphinx Table of Contents
`#959 `__
- Fix test failure with latest Sphinx master.
`#1010 `__
- Fix error in template specialization with qualified arguments
`#1010 `__
- 2023-02-28 - **Breathe v4.35.0**
- Pull lone literal blocks in paragraphs up to produce correct doctree.
`#833 `__
- Fix tests for changes in Sphinx 5.3.
`#865 `__
- Bump Python requirement to 3.7.
`#866 `__
- Support Sphinx 6.
`#885 `__
- Support ``:sort:`` option to sort sections by name.
`#879 `__
- 2022-06-20 - **Breathe v4.34.0**
- Treat .unparsed as plain text.
`#806 `__
- Remove unneeded type: ignore annotations.
`#813 `__
- Fix internal ``NodeFinder`` visitor for when non-Docutils nodes are
present in the content of a directive.
`#812 `__
- Rename lint workflow.
`#814 `__
- Type check pygments and limit docutils stub version.
`#819 `__
- Convert dot files' relative path to absolute.
`#821 `__
- CI, update Sphinx versions to test.
`#834 `__
- CI, update for Sphinx 5.0.1.
`#846 `__
- Fix inconsistency in example.
`#843 `__
- Fix C# enum rendering crash.
`#849 `__
- Drop Sphinx 3 support, add Sphinx 5 support.
`#850 `__
- CICD: Disable python 3.6 for Sphinx master tests.
`#853 `__
- Populate default include text-node's data field instead of raw-source.
`#828 `__
- 2022-02-14 - **Breathe v4.33.1**
- Avoid warning about multiple graphviz directives.
`#804 `__
- 2022-02-14 - **Breathe v4.33.0**
- Fix duplicate ``static`` in variable declarations.
`#794 `__
- Update CICD for Sphinx 4.4.0 series.
`#795 `__
- Pin version of black in CICD and reformat files.
`#792 `__
- Fix code block highlighting.
`#760 `__
- Refactoring, cleanup and typing improvements.
`#802 `__
- Doxygen dot graphs to Sphinx graphviz.
`#757 `__
- Support externally hosted images.
`#705 `__
- Address a peculiarity in Doxygen aliases in doc.
`#770 `__
- Add flag to doxygengroup, doxygennamespace to display only the description.
`#718 `__
- Add support for MD block quotes with attribution(s).
`#759 `__
- 2022-01-30 - **Breathe v4.32.0**
- Added ``breathe_doxygen_aliases`` config variable.
`#729 `__
- Render ``\remark``/``\remarks`` and ``\see``/``\sa`` using Sphinx/Docutils
admonition style nodes.
`#756 `__
- Render C++ scoped enums differently than unscoped enums, and with their
underlying type.
`#753 `__
- Render ``\retval`` lists using dedicated field list when Sphinx >= 4.3 is
used.
`#749 `__
- Make ``.. doxygenfunction`` handle function template specializations.
`#750 `__
- Properly handle field-lists and admonitions in the detailed description of
classes and functions.
`#764 `__
- Add ``:confval:`breathe_show_include``` to control whether ``#include``
lines are shown. Defaults to ``True``.
`#725 `__
- Fix sys.path adjustment in doc config.
`#734 `__
- Fix sphinx renderer variable and function visitors for C#.
`#737 `__
- Fix sphinx renderer class visitor for C#.
`#738 `__
- Auto-format python code with black.
`#743 `__
- Extend flake8 and address some style issues.
`#745 `__
- Fix black formatting warning.
`#747 `__
- Update Sphinx and Python versions tested against.
`#765 `__
- Fix friend functions for older Doxygen versions.
`#769 `__
- Doxygen >= 1.9.2 supports C++20 concepts, add support for them.
`#779 `__
- Change the way directives are added to adhere to the interface,
e.g., avoiding myst-parser to crash.
`#780 `__
- Improved list of included files (with cross-references for local includes).
`#763 `__
- Update flake8 and mypy related stuff.
`#781 `__
- Update readme with logo and sponsorship info.
`#784 `__
- Store version number in both setup.py and __init__.py.
`#789 `__
- CICD: lint: continue with other jobs if black fails.
`#791 `__
- 2021-09-14 - **Breathe v4.31.0**
- Collapse multiple retvals into a single bullet list. `#697 `__
- Fix mypy issues on CI. `#731 `__
- Print usage message from 'compare' doc script. `#727 `__
- Test against Sphinx 4.0.3, 4.1.2 and 4.1.x branch. `#721 `__
- Fix duplicate ``static`` in function declarations. `#717 `__ `#720 `__
- Directive refactoring. `#698 `__
- Handle parsing errors. `#711 `__
- Make doxygenfunction more robust when matching parameters. `#722 `__ `#723 `__
- Separate, link and style the changelog. `#735 `__
- Update changelog and readme ahead of release. `#739 `__
- CICD: Track Sphinx 4.2.x development series. `#741 `__
- 2021-05-06 - **Breathe v4.30.0**
- Fix retval rendering. `#687 `__
- Correctly label example as C. `#690 `__
- apidoc: add -m, --members option flag. `#694 `__
- 2021-04-30 - **Breathe v4.29.2**
- Remove stale six dep. `#682 `__
- Render fields with multiple names instead of crashing. `#685 `__
- Start pytest via module instead of exe. `#686 `__
- 2021-04-23 - **Breathe v4.29.1**
- Splice out parameter direction in field lists. `#675 `__
- Fixes for Sphinx v4. `#676 `__
- Fix paragraph in paragraph rendering. `#678 `__
- Strip names before lookup in doxygenfunction. `#679 `__
- When rendering template params, insert name by parsing. `#681 `__
- 2021-04-09 - **Breathe v4.29.0**
- Do not add inline modifier for C#. `#668 `__
- Use add_css_file instead of deprecated/removed add_stylesheet. `#669 `__
- Use native docutils for field lists, notes, and warnings. `#670 `__
- Handle directives returning no nodes on error. `#672 `__
- 2021-03-29 - **Breathe v4.28.0**
- Code and documentation for membergroups and members-only options. `#637 `__
- Add example.tag to gitignore as it gets modified during build process. `#644 `__
- Add support for content-only flag when rendering pages. `#645 `__
- When rendering a section, add target after title. `#647 `__
- Render pages content in order. `#651 `__
- Adds an ID to the rubric created for each section of a group. `#658 `__
- Add missing getter and setter for C#. `#661 `__
- Add support for rowspan/colspan to tables. `#642 `__
- 2021-02-16 - **Breathe v4.27.0**
- Add various specifiers to functions and variables. `#628 `__
- Add multiply inherited class for PHP objects. `#630 `__
- Initial support for table rendering. `#632 `__
- Add rendering of \section, \subsection and \subsubsection. `#635 `__
- Sphinx 3.5 compatibility. `#640 `__
- Fix linking to sections. `#639 `__
- Add table examples to documentation. `#638 `__
- 2021-01-21 - **Breathe v4.26.1**
- Fix doxygenfile causing duplicate IDs for unspecified sections. `#622 `__
- Fixes for doxygenfunction (friend keyword, friend class, arg checks). `#623 `__
- 2021-01-08 - **Breathe v4.26.0**
- Add test for ellipsis ('...') in args. `#610 `__
- Sphinx 3.4.x compatibility. `#617 `__
- Adapt friendclass to Doxygen 1.9. `#618 `__
- 2020-12-16 - **Breathe v4.25.1**
- Addendum to #606, for functions with '...'. `#609 `__
- 2020-12-15 - **Breathe v4.25.0**
- Add support for \parblock parsing and rendering. `#603 `__
- Allow lookup in doxygenfunction without writing param names. `#606 `__
- 2020-12-01 - **Breathe v4.24.1**
- Fix anchors on pages generated by Doxygen >= 1.8.17. `#602 `__
- 2020-11-15 - **Breathe v4.24.0**
- Update CI for Sphinx 3.3.x and fix test mock. `#597 `__
- Add support for xrefitem based page generation (doxygenpage). `#596 `__
- 2020-10-20 - **Breathe v4.23.0**
- Add initial xrefsect support. `#589 `__
- 2020-09-26 - **Breathe v4.22.1**
- Fix anonymous struct/union usage in C domain. `#585 `__
- 2020-09-19 - **Breathe v4.22.0**
- Fix Read the Docs build (again). `#576 `__
- New boolean `breathe_show_enumvalue_initializer` option specifying
whether value of enumvalue should be displayed. `#581 `__
- 2020-09-10 - **Breathe v4.21.0**
- Fix Read the Docs build. `#567 `__
- Document doxygenclass template specialisation spacing. `#570 `__
- Update upper Sphinx release to <3.4. `#571 `__
- Reuse breathe.__version__ in setup.py. `#572 `__
- Document :inner: for the doxygengroup section. `#573 `__
- Add support for verbatim inline elements. `#560 `__
- Fix wrong refid when Doxygen SEPARATE_MEMBER_PAGES is YES. `#566 `__
- 2020-08-19 - **Breathe v4.20.0**
- Allow Sphinx 3.2. `#561 `__
- Update CI scripts with new Sphinx versions. `#552 `__
- Add support for C# using sphinx-csharp. `#550 `__
- Doc, fix typo, :source: -> :project:. `#551 `__
- Add support for innergroup. `#556 `__
- Avoid duplicate doxygen targets when debug tracing. `#563 `__
- Remove Travis badge from README file. `#564 `__
- 2020-06-17 - **Breathe v4.19.2**
- Fix crash when visiting typedef. `#547 `__
- 2020-06-08 - **Breathe v4.19.1**
- Mark package as compatible with Sphinx 3.1.
- 2020-06-07 - **Breathe v4.19.0**
- Refactoring. `#528 `__
- Make debug config variables available in conf.py. `#533 `__
- Fix warning formatting for function lookup. `#535 `__
- Correctly reverse nested namespaces in get_qualification. `#540 `__
- 2020-05-10 - **Breathe v4.18.1**
- Fix friend class rendering and allow friend struct. `#522 `__
- Add extern examples to doc and remove variable hack. `#526 `__
- Render function candidates without using Sphinx directives. `#524 `__
- 2020-05-02 - **Breathe v4.18.0**
- Support tiles in verbatim blocks. `#517 `__
- 2020-05-01 - **Breathe v4.17.0**
- Scoped rendering, better integration with Sphinx, misc fixes. `#512 `__
- 2020-04-19 - **Breathe v4.16.0**
- Strictly depend on Sphinx's minor version. `#498 `__
- Simplifications and fixes, use more of modern Sphinx natively. `#503 `__
- Add section option to the doxygen(auto)file directive. `#501 `__
- Fix link generation when enum is inside a group (enum FQDN). `#508 `__
- Fix creation of LaTeX math formulas. `#506 `__
- Improve documentation for doxygen(auto)file section option. `#509 `__
- 2020-04-07 - **Breathe v4.15.0**
- Add license file to distribution. `#492 `__
- Update for Sphinx 3. `#491 `__
- 2020-04-07 - **Breathe v4.14.2**
- Add GitHub actions. `#474 `__
- Fixes to use Sphinx 2.4.4. `#486 `__
- Add nose to python development requirements. #484.
- Switch to pytest from nose. `#487 `__
- 2020-02-02 - **Breathe v4.14.1**
- Use sphinx core instead of mathbase ext. `#469 `__
- Fix test failure for Sphinx >= 2.2.2. `#472 `__
- Update travis to Sphinx 2.3.1. `#471 `__
- 2019-11-26 - **Breathe v4.14.0**
- Add events attribute to MockApp. `#452 `__
- Add bit field support for C/C++. `#454 `__
- Add alias and variable template support. `#461 `__
- 2019-08-01 - **Breathe v4.13.1**
- Fix for template method pointer parameter issue. `#449 `__
- 2019-04-23 - **Breathe v4.13.0**.post0
- Drop support for python 2, require Sphinx >= 2.0. `#432 `__
- 2019-04-21 - **Breathe v4.13.0**
- Adapt to upcoming Sphinx 2.0. `#411 `__
- Add support for rendering parameter direction information. `#428 `__
- 2019-03-15 - **Breathe v4.12.0**
- Adapt to Sphinx 1.8. `#410 `__
- Let Sphinx handle more things. `#412 `__
- Use standard windows EOL for batch file. `#417 `__
- Fix flake8 F632 warnings. `#418 `__
- Update dep versions in readme, setup, requirements. `#419 `__
- Add option to render function parameters after the description. `#421 `__
- Remove spurious "typedef" in type declaration when using "using". `#424 `__
- 2018-12-11 - **Breathe v4.11.1**
- Sphinxrenderer: handle typeless parameters gracefully. `#404 `__
- 2018-10-31 - **Breathe v4.11.0**
- Fix typo in quickstart. `#393 `__
- Add support for QtSignals. `#401 `__
- 2018-08-07 - **Breathe v4.10.0**
- Explicitly use Sphinx 1.7.5 for CI and dev. `#385 `__
- Print filename when printing ParserException. `#390 `__
- 2018-06-03 - **Breathe v4.9.1**
- Don't append separator for paragraph type. `#382 `__
- 2018-06-01 - **Breathe v4.9.0**
- Render newlines as separate paragraphs. `#380 `__
- 2018-05-26 - **Breathe v4.8.0**
- Add quiet option to apidoc. `#375 `__
- Add PHP domain. `#351 `__
- Keep templates on adjacent lines. `#300 `__
- Show reference qualification for methods. `#332 `__
- Adapt tests/CI to newest Sphinx version. `#377 `__
- More robust name regex in renderer. `#370 `__
- Show base classes using Sphinx's cpp domain. `#295 `__
- Fix domain detection when rendering groups. `#365 `__
- Return parallel_{read,write}_safe true for Sphinx's -j. `#376 `__
- 2017-10-09 - **Breathe v4.7.3**
- Support for enums in the cpp domain.
- Handle case where compoundref does not have a refid value associated.
- 2017-08-15 - **Breathe v4.7.2**
- Fix issue with packaging on Python 2.7 with wheels.
- 2017-08-13 - **Breathe v4.7.1**
- Fixed bug regarding code snippets inside Doxygen comments.
- 2017-08-09 - **Breathe v4.7.0**
- New `outtypes` option to prevent documenting namespace and files
- New boolean `breathe_show_define_initializer` option specifying whether
value of macros should be displayed.
- New boolean `breathe_use_project_refids` option controlling whether the
refids generated by breathe for doxygen elements contain the project name
or not.
- Fixed
- Support for Sphinx 1.6
- 2017-02-25 - **Breathe v4.6.0**
- Support for the Interface directive
- Display the contents of defines
- 2017-02-12 - **Breathe v4.5.0**
- Improve handling of c typedefs
- Support new `desc_signature_line` node
- Add `--project` flag to breathe-apidoc helper
- Dropped testing for Python 3.3 and added 3.6
- 2016-11-13 - **Breathe v4.4.0**
- Improve single line parameter documentation rendering
- 2016-11-05 - **Breathe v4.3.1**
- Version bump package confusion with wheel release
- 2016-11-05 - **Breathe v4.3.0**
- Rewritten rendering approach to use the visitor pattern
- Dropped support for 2.6 & added testing for 3.5
- Fixed
- Issue with running breathe-apidoc for the first time.
- Improved handling of qualifiers, eg. const & volatile.
- Supports functions in structs
- Supports auto-doxygen code path on Windows
- 2016-03-19 - **Breathe v4.2.0**
- Added
- Output links to a class' parents & children.
- Support for Sphinx's `needs_extensions` config option.
- breathe-apidoc script for generating ReStructuredText stub files with
Breathe directives from doxygen xml files.
- Fixed
- Handling default values in parameter declarations
- Output order not being reproducible due to iteration over Set.
- Handling of multiple pointers and references
- `SEVERE: Duplicate ID` warnings when using function overloads.
- Use project name for link references when using default project. So we use
the project name instead of 'project0'.
- 2015-08-27 - **Breathe v4.1.0**
- Added
- ``breathe_doxygen_config_options`` config variable which allows for adding
more config lines to the doxygen file used for the auto-directives.
- Fixed
- Display of array & array reference parameters for functions.
- Handling of links to classes with template arguments.
- Handling of unnamed enums in C.
- Naming of template parameter section.
- Finding functions that are within groups.
- Rendering of 'typename' and 'class' keywords for templates.
- 2015-04-02 - **Breathe v4.0.0**
- Significant work on the code base with miminal reStructureText interface
changes. To be documented.
- 2014-11-09 - **Breathe v3.2.0**
- Nothing Added, Deprecated or Removed
- Fixed
- Changed docutils/Sphinx node usage to fix latex/pdf output.
- When checking for path separators check for both ``/`` and ``\``
regardless of the platform.
- ``KeyError`` when using ``auto`` directives without specifying the
``:project:`` option even though the default project config setting was
set.
- Use of ``doxygenfunction`` no longer inappropriately triggers the
duplicate target check and fails to output link targets.
- Support for inline urls in the doxygen comments.
- Support for array notation in function parameters.
- Reduced intention by changing ``section-defs`` to use ``container`` &
``rubric`` nodes rather than ``desc`` nodes with signatures & content. Now
headings like 'Public Functions' appear inline with their subject matter.
- 2014-09-07 - **Breathe v3.1.0**
- Nothing Deprecated or Removed
- Added
- The ``doxygenclass`` directive can now reference template specialisations
by specifying the specialisation in the argument name.
- Fixed
- Displaying function parameters for Qt slots output. Previously they were
missing even though Qt Slots are essentially just functions.
- Displaying headings from doxygen comments as emphasized text.
- Crash when generating warning about being unable to find a define,
variable, enum, typedef or union.
- Only output the definition name for a function parameter if the declartion
name is not available. Previously, where they were both available we were
getting two names next to each other for no good reason.
- 2014-08-04 - **Breathe v3.0.0**
- Improve output of const, volatile, virtual and pure-virtual keywords.
- Fix css class output for HTML so that object types rather than names are
output as the css classes. eg. 'function' instead of 'myFunction'.
- Fix issue with Breathe getting confused over functions appearing in header
and implementation files.
- Improve matching for overloaded functions when using ``doxygenfunction``
directive. Also, provide a list of potential matches when no match is found.
- Improved ``:members:`` implementation to handle inner classes properly.
- Updated ``doxygenstruct`` to share the ``doxygenclass`` implementation path
which grants it the options from ``doxygenclass`` directive.
- Added ``:outline:`` option support to ``doxygengroup`` &
``doxygennamespace`` directives.
- Added ``doxygennamespace`` directive.
- Added ``:undoc-members:`` option to ``doxygenclass`` & ``doxygengroup``
directives.
- **Breaking change**: Removed ``:sections:`` option for ``doxygenclass`` &
``doxygengroup`` directives and replaced it with ``:members:``,
``:protected-members:`` and ``:private-members:``, and changed
``breathe_default_sections`` config variable to ``breathe_default_members``.
This is designed to more closely match the Sphinx autodoc functionality and
interface.
- 2014-06-15 - **Breathe v2.0.0**
- Add compare script for checking changes to documentation caused by changes
in the implementation.
- Switched to ``https`` reference for MathJax Javascript.
- **Breaking change**: Change ``autodoxygen*`` directives to require
explicitly declared source files in the ``conf.py`` rather than attempting
to detect them from the directive arguments.
- Switch documentation hosting to ReadTheDocs.org.
- **Breaking change**: Switch to assuming all relative paths are relative to
the directory holding the ``conf.py`` file. Previously, it would assume they
were relative to the user's current working directory. This breaks projects
which use separate build & source directories.
- Add ``doxygenunion`` directive.
- Add ``doxygengroup`` directive.
- Add support for lists in the output. They were previously ignored.
- Updated implementation to use the docutils nodes that Sphinx does where
possible.
- 2014-06-01 - **Breathe v1.2.0**
- Change log not recorded.
breathe-doc-breathe-10a36f3/CONTRIBUTING.rst 0000664 0000000 0000000 00000001232 14756414247 0020301 0 ustar 00root root 0000000 0000000
Contributing
============
Firstly, thank you for making it this far. We really appreciate anyone who even
thinks about reporting an issue or helping out with the code or docs. It is kind
of you to take the time.
Please Provide an Example
-------------------------
If you're having trouble with how the contents of a particular Doxygen comment
or a particular set of code is being processed then please provide an example of
the in question.
Ideally as a pull-request with additions to the `examples/specific` folder but
feel free to provide the comment content in your issue instead.
It really helps to accelerate development if we have examples to work from.
breathe-doc-breathe-10a36f3/CONTRIBUTORS.rst 0000664 0000000 0000000 00000002650 14756414247 0020334 0 ustar 00root root 0000000 0000000 Contributors
============
Many thanks to everyone that has contributed to the project.
- `Andne `_
- `arximboldi `_
- `D4N `_
- `dean0x7d `_
- `dg-dboehi `_
- `eric-wieser `_
- `fetzerch `_
- `gmarull `_
- `hidmic `_
- `ishitatsuyuki `_
- `jakobandersen `_
- `mattip `_
- `michaeljones `_
- `nijel `_
- `olitheolix `_
- `pczerkas `_
- `queezythegreat `_
- `remyleone `_
- `rhssk `_
- `rogerbarton `_
- `ropg `_
- `rscohn2 `_
- `rweickelt `_
- `SylvainCorlay `_
- `t-b `_
- `Tiwalun `_
- `utzig `_
- `vermeeren `_
- `vitaut `_
- `xuhongxu96 `_
And many more via issues and suggestions.
breathe-doc-breathe-10a36f3/LICENSE 0000664 0000000 0000000 00000003002 14756414247 0016642 0 ustar 00root root 0000000 0000000 // BSD license, modified to remove the organisation as there isn't one.
Copyright (c) 2009, Michael Jones
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
breathe-doc-breathe-10a36f3/Makefile 0000664 0000000 0000000 00000001245 14756414247 0017304 0 ustar 00root root 0000000 0000000
.PHONY: all
all: html pdf
.PHONY: html
html: data
$(MAKE) -C documentation html
.PHONY: pdf
pdf: data
$(MAKE) -C documentation latexpdf
.PHONY: data
data:
$(MAKE) -C examples/doxygen all
$(MAKE) -C examples/tinyxml all
$(MAKE) -C examples/specific all
.PHONY: distclean
distclean: clean
$(MAKE) -C documentation clean
.PHONY: clean
clean:
$(MAKE) -C examples/doxygen $@
$(MAKE) -C examples/tinyxml $@
$(MAKE) -C examples/specific $@
.PHONY: test
test:
cd tests && python3 -m pytest -v
.PHONY: dev-test
dev-test:
cd tests && PYTHONPATH=../:$(PYTHONPATH) python3 -m pytest -v
.PHONY: ruff
ruff:
ruff check
ruff format
.PHONY: type-check
type-check:
mypy
breathe-doc-breathe-10a36f3/README.rst 0000664 0000000 0000000 00000012401 14756414247 0017327 0 ustar 00root root 0000000 0000000 .. image:: https://www.breathe-doc.org/img/logo.svg
:align: center
:alt: Breathe logo
:width: 200
:height: 200
:target: https://www.breathe-doc.org
Breathe
=======
**Your technical docs, beautifully integrated**
.. image:: https://github.com/breathe-doc/breathe/actions/workflows/unit_tests.yml/badge.svg
:target: https://github.com/breathe-doc/breathe/actions/workflows/unit_tests.yml
:alt: Build Status
Website_ • Documentation_ • Sponsor_
**Sponsor**: If you benefit from using Breathe as a company or an individual, you
can financially support the Breathe project with recurring or one off
contributions via `Open Collective `_.
.. _Website: https://www.breathe-doc.org/
.. _Documentation: https://breathe.readthedocs.io/en/latest/
.. _Sponsor: https://opencollective.com/breathe
----
Breathe is a Sphinx plugin providing beautifully integrated Doxygen output in
your user-facing documentation. It allows you to combine Doxygen's excellent
technical understanding of your code base with the superb long form
documentation output of the Sphinx system.
For Packagers
-------------
- Breathe packages on PyPI are PGP signed for Breathe >= v4.28.0.
- Breathe tarballs on GitHub are PGP signed for Breathe >= v4.29.0.
Download
--------
Breathe is available from github and `PyPI, the Python Package Index
`_. It can be installed with::
pip install breathe
Documentation
-------------
The documentation is available `here `__. Thank
you to the people running `Read the Docs `_ for such an
excellent service.
The source for the documentation is in the ``documentation`` folder if you want
to built it and read it locally.
Testing
-------
The testsuite can be run with::
make dev-test
The documentation also does a good effort of covering the available
functionality with different examples. To build the documentation, run::
make
This will run doxygen over the example code and then run the Breathe
documentation. View the results at::
documentation/build/html/index.html
Further to this if you want to compare the current documentation output against
a previous state in order to check for regressions there is a ``compare`` script
in the ``documentation`` folder. It takes two arguments which are two commit
references that you'd like to compare. This means that all your changes have to
be committed first. Also the script does not resolve state dependent references
like ``HEAD`` so provide concrete commit references like sha1s or branch names.
A typical example is to compare your current branch output to master::
# Make sure all your changes are committed first
cd documentation
./compare master my-branch
This will do a checkout and build at each commit and then run ``meld`` against
the resulting directories so you can see the differences introduced by your
branch.
Requirements
------------
Breathe requires Python 3.9+, Sphinx 7.2+, and Doxygen 1.9.2+.
Mailing List Archives
---------------------
The archive for the Google groups list can be found
`here `__.
The previous mailing list was on `librelist.com `__ and the
archives are available `here `__.
Please post new questions as GitHub issues.
Projects Using Breathe
----------------------
Examples of projects that use Breathe:
- `PyTorch `_
- `OpenPilot `_
- `XGBoost `_
- `NumPy `_
- `Mozilla's DeepSpeech `_
- `Microsoft's LightGBM `_
- `PyBind11 `_
- `Ceph `_
- `Apache Arrow `_
- `LVGL `_
- `Espressif IoT Development Framework `_
- `Zephyr Project `_
- `Plaid ML `_
- `Sony's Neural Network Libraries `_
- `fmt `_
Release
-------
1. Update `CHANGELOG.rst` and create the git tag (`vX.Y.Z`).
2. Push the tag to GitHub.
3. The `create-release.yml` workflow will publish the release to PyPI.
4. Go to https://github.com/breathe-doc/breathe/tags, select the new tag,
and click the "Create release from tag" button to publish a GitHub release.
Maintainers
-----------
Breathe is currently maintained by `vermeeren `_ & `jakobandersen `_
and was formerly maintained by `michaeljones `_
& `vitaut `_.
See `CONTRIBUTORS `_ for the full list.
Acknowledgements
----------------
- Dimitri van Heesch for `Doxygen `_.
- Georg Brandl for `Sphinx `_.
- David Goodger for `Docutils `_ and reStructuredText.
Changelog
---------
See the `CHANGELOG.rst
`_
breathe-doc-breathe-10a36f3/breathe-apidoc.py 0000775 0000000 0000000 00000000233 14756414247 0021064 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
from __future__ import annotations
import sys
if __name__ == "__main__":
from breathe.apidoc import main
sys.exit(main())
breathe-doc-breathe-10a36f3/breathe/ 0000775 0000000 0000000 00000000000 14756414247 0017254 5 ustar 00root root 0000000 0000000 breathe-doc-breathe-10a36f3/breathe/README.rst 0000664 0000000 0000000 00000002747 14756414247 0020755 0 ustar 00root root 0000000 0000000
breathe
=======
- **Subpackages**
- **directive** - Contains some rst directive definitions. These were split out
of `directives.py` when it started to become too large.
- **parser** - Contains code for parsing the doxygen xml into a tree of Python
objects. The vast majority of the code is autogenerated but there are now
small but significant tweaks which means we don't regenerate it.
- **finder** - Provides classes for finding nodes within the set of xml
files generated by doxygen. Finders are generally used in the `run` methods of
the directives to find the xml node which is then passed to the renderer to
create the output.
- **renderer** - Provides classes for rendering an xml node from the doxygen xml
into docutils rst nodes which can be used by Sphinx. Breathe should ideally
only produce rst nodes and not concern itself with the final output (html,
latex, etc.)
- **Submodules**
- **directives** - Contains the definitions of some of the directives. The rest
are in the files in the `directive` folder. It also contains all the set up
code which registers with Sphinx and wires together all the various factories.
- **process** - Contains the code responsible for running the `doxygen` process
when using the `autodoxygen` directives.
- **project** - Handles the concept of a `Project` which is the breathe term for
a folder full of doxygen xml files.
- **exception** - Contains the base class for all custom exceptions.
breathe-doc-breathe-10a36f3/breathe/__init__.py 0000664 0000000 0000000 00000001053 14756414247 0021364 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from typing import TYPE_CHECKING
from breathe.directives.setup import setup as directive_setup
from breathe.file_state_cache import setup as file_state_cache_setup
from breathe.renderer.sphinxrenderer import setup as renderer_setup
if TYPE_CHECKING:
from sphinx.application import Sphinx
__version__ = "4.36.0"
def setup(app: Sphinx):
directive_setup(app)
file_state_cache_setup(app)
renderer_setup(app)
return {"version": __version__, "parallel_read_safe": True, "parallel_write_safe": True}
breathe-doc-breathe-10a36f3/breathe/apidoc.py 0000664 0000000 0000000 00000015643 14756414247 0021076 0 ustar 00root root 0000000 0000000 """
breathe.apidoc
~~~~~~~~~~~~~~
Parses doxygen XML tree looking for C/C++ modules and creates ReST files
appropriately to create code documentation with Sphinx. It also creates a
modules index (See TYPEDICT below.).
This is derived from the "sphinx-autopackage" script, which is:
Copyright 2008 Société des arts technologiques (SAT),
http://www.sat.qc.ca/
:copyright: Originally by Sphinx Team, C++ modifications by Tatsuyuki Ishi
:license: BSD, see LICENSE for details.
"""
from __future__ import annotations
import argparse
import os
import sys
import xml.etree.ElementTree
from pathlib import Path
from breathe import __version__
# Reference: Doxygen XSD schema file, CompoundKind only
# Only what breathe supports are included
# Translates identifier to English
TYPEDICT = {
"class": "Class",
"interface": "Interface",
"struct": "Struct",
"union": "Union",
"file": "File",
"namespace": "Namespace",
"group": "Group",
}
# Types that accept the :members: option.
MEMBERS_TYPES = ["class", "group", "interface", "namespace", "struct"]
def print_info(msg, args):
if not args.quiet:
print(msg)
def write_file(name, text, args):
"""Write the output file for module/package ."""
fname = Path(args.destdir, f"{name}.{args.suffix}")
if args.dryrun:
print_info("Would create file %s." % fname, args)
return
if not args.force and fname.is_file():
print_info("File %s already exists, skipping." % fname, args)
else:
print_info("Creating file %s." % fname, args)
fname.parent.mkdir(parents=True, exist_ok=True)
try:
orig = fname.read_text()
if orig == text:
print_info("File %s up to date, skipping." % fname, args)
return
except FileNotFoundError:
# Don't mind if it isn't there
pass
fname.write_text(text)
def format_heading(level, text):
"""Create a heading of [1, 2 or 3 supported]."""
underlining = ["=", "-", "~"][level - 1] * len(text)
return "%s\n%s\n\n" % (text, underlining)
def format_directive(package_type, package, args):
"""Create the breathe directive and add the options."""
directive = ".. doxygen%s:: %s\n" % (package_type, package)
if args.project:
directive += " :project: %s\n" % args.project
if args.members and package_type in MEMBERS_TYPES:
directive += " :members:\n"
return directive
def create_package_file(package, package_type, package_id, args):
"""Build the text of the file and write the file."""
# Skip over types that weren't requested
if package_type not in args.outtypes:
return
text = format_heading(1, "%s %s" % (TYPEDICT[package_type], package))
text += format_directive(package_type, package, args)
write_file(Path(package_type, package_id), text, args)
def create_modules_toc_file(key, value, args):
"""Create the module's index."""
if not Path(args.destdir, key).is_dir():
return
text = format_heading(1, "%s list" % value)
text += ".. toctree::\n"
text += " :glob:\n\n"
text += " %s/*\n" % key
write_file("%slist" % key, text, args)
def recurse_tree(args):
"""
Look for every file in the directory tree and create the corresponding
ReST files.
"""
index = xml.etree.ElementTree.parse(Path(args.rootpath, "index.xml"))
# Assuming this is a valid Doxygen XML
for compound in index.getroot():
create_package_file(
compound.findtext("name"), compound.get("kind"), compound.get("refid"), args
)
class TypeAction(argparse.Action):
def __init__(self, option_strings, dest, **kwargs):
super().__init__(option_strings, dest, **kwargs)
self.default = TYPEDICT.keys()
self.metavar = ",".join(TYPEDICT.keys())
def __call__(self, parser, namespace, values, option_string=None):
value_list = values.split(",")
for value in value_list:
if value not in TYPEDICT:
raise ValueError("%s not a valid option" % value)
setattr(namespace, self.dest, value_list)
def main():
"""Parse and check the command line arguments."""
parser = argparse.ArgumentParser(
description="""\
Parse XML created by Doxygen in and create one reST file with
breathe generation directives per definition in the .
Note: By default this script will not overwrite already created files.""",
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument(
"-o",
"--output-dir",
action="store",
dest="destdir",
help="Directory to place all output",
required=True,
)
parser.add_argument(
"-f", "--force", action="store_true", dest="force", help="Overwrite existing files"
)
parser.add_argument(
"-m",
"--members",
action="store_true",
dest="members",
help="Include members for types: %s" % MEMBERS_TYPES,
)
parser.add_argument(
"-n",
"--dry-run",
action="store_true",
dest="dryrun",
help="Run the script without creating files",
)
parser.add_argument(
"-T",
"--no-toc",
action="store_true",
dest="notoc",
help="Don't create a table of contents file",
)
parser.add_argument(
"-s",
"--suffix",
action="store",
dest="suffix",
help="file suffix (default: rst)",
default="rst",
)
parser.add_argument(
"-p",
"--project",
action="store",
dest="project",
help="project to add to generated directives",
)
parser.add_argument(
"-g",
"--generate",
action=TypeAction,
dest="outtypes",
help="types of output to generate, comma-separated list",
)
parser.add_argument(
"-q", "--quiet", action="store_true", dest="quiet", help="suppress informational messages"
)
parser.add_argument(
"--version", action="version", version="Breathe (breathe-apidoc) %s" % __version__
)
parser.add_argument("rootpath", type=str, help="The directory contains index.xml")
args = parser.parse_args()
args.suffix = args.suffix.removeprefix(".")
if not os.path.isdir(args.rootpath):
print("%s is not a directory." % args.rootpath, file=sys.stderr)
sys.exit(1)
if "index.xml" not in os.listdir(args.rootpath):
print("%s does not contain a index.xml" % args.rootpath, file=sys.stderr)
sys.exit(1)
if not os.path.isdir(args.destdir):
if not args.dryrun:
os.makedirs(args.destdir)
args.rootpath = os.path.abspath(args.rootpath)
recurse_tree(args)
if not args.notoc:
for key in args.outtypes:
create_modules_toc_file(key, TYPEDICT[key], args)
# So program can be started with "python -m breathe.apidoc ..."
if __name__ == "__main__":
main()
breathe-doc-breathe-10a36f3/breathe/directives/ 0000775 0000000 0000000 00000000000 14756414247 0021415 5 ustar 00root root 0000000 0000000 breathe-doc-breathe-10a36f3/breathe/directives/__init__.py 0000664 0000000 0000000 00000010102 14756414247 0023520 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from typing import TYPE_CHECKING
from docutils import nodes
from sphinx.directives import SphinxDirective
from breathe.finder.factory import FinderFactory
from breathe.parser import FileIOError, ParserError
from breathe.renderer import RenderContext, format_parser_error
from breathe.renderer.filter import FilterFactory
from breathe.renderer.sphinxrenderer import SphinxRenderer
if TYPE_CHECKING:
from collections.abc import Sequence
from typing import Any
from breathe.parser import DoxygenParserFactory
from breathe.project import ProjectInfo, ProjectInfoFactory
from breathe.renderer.filter import Filter
from breathe.renderer.mask import MaskFactoryBase
from breathe.renderer.target import TargetHandler
class _WarningHandler:
def __init__(self, state, context: dict[str, Any]) -> None:
self.state = state
self.context = context
def warn(
self,
raw_text: str,
*,
rendered_nodes: Sequence[nodes.Node] | None = None,
unformatted_suffix: str = "",
) -> list[nodes.Node]:
raw_text = self.format(raw_text) + unformatted_suffix
if rendered_nodes is None:
rendered_nodes = [nodes.paragraph("", "", nodes.Text(raw_text))]
return [
nodes.warning("", *rendered_nodes),
self.state.document.reporter.warning(raw_text, line=self.context["lineno"]),
]
def format(self, text: str) -> str:
return text.format(**self.context)
class BaseDirective(SphinxDirective):
@property
def directive_args(self) -> list:
# the order must be the same as in docutils.parsers.rst.Directive.__init__
return [
self.name,
self.arguments,
self.options,
self.content,
self.lineno,
self.content_offset,
self.block_text,
self.state,
self.state_machine,
]
@property
def project_info_factory(self) -> ProjectInfoFactory:
return self.env.temp_data["breathe_project_info_factory"]
@property
def parser_factory(self) -> DoxygenParserFactory:
return self.env.temp_data["breathe_parser_factory"]
@property
def finder_factory(self) -> FinderFactory:
return FinderFactory(self.env.app, self.parser_factory)
@property
def filter_factory(self) -> FilterFactory:
return FilterFactory(self.env.app)
@property
def kind(self) -> str:
raise NotImplementedError
def create_warning(self, project_info: ProjectInfo | None, **kwargs) -> _WarningHandler:
if project_info:
proj_name = project_info.name()
proj_path = project_info.project_path()
tail = f'in doxygen xml output for project "{proj_name}" from directory: {proj_path}'
else:
tail = ""
context = dict(lineno=self.lineno, tail=tail, **kwargs)
return _WarningHandler(self.state, context)
def render(
self,
node_stack,
project_info: ProjectInfo,
filter_: Filter,
target_handler: TargetHandler,
mask_factory: MaskFactoryBase,
directive_args,
) -> list[nodes.Node]:
"Standard render process used by subclasses"
try:
object_renderer = SphinxRenderer(
self.parser_factory.app,
project_info,
node_stack,
self.state,
self.state.document,
target_handler,
self.parser_factory.create_compound_parser(project_info),
filter_,
)
except ParserError as e:
return format_parser_error(
"doxygenclass", e.error, e.filename, self.state, self.lineno, True
)
except FileIOError as e:
return format_parser_error(
"doxygenclass", e.error, e.filename, self.state, self.lineno, True
)
context = RenderContext(node_stack, mask_factory, directive_args)
return object_renderer.render(node_stack[0], context)
breathe-doc-breathe-10a36f3/breathe/directives/class_like.py 0000664 0000000 0000000 00000005137 14756414247 0024106 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from typing import TYPE_CHECKING
from docutils.parsers.rst.directives import flag, unchanged, unchanged_required
from breathe.directives import BaseDirective
from breathe.file_state_cache import MTimeError
from breathe.project import ProjectError
from breathe.renderer.mask import NullMaskFactory
from breathe.renderer.target import create_target_handler
if TYPE_CHECKING:
from typing import Any
from docutils.nodes import Node
class _DoxygenClassLikeDirective(BaseDirective):
required_arguments = 1
optional_arguments = 0
final_argument_whitespace = True
option_spec = {
"path": unchanged_required,
"project": unchanged_required,
"members": unchanged,
"membergroups": unchanged_required,
"members-only": flag,
"protected-members": flag,
"private-members": flag,
"undoc-members": flag,
"show": unchanged_required,
"outline": flag,
"no-link": flag,
"allow-dot-graphs": flag,
}
has_content = False
def run(self) -> list[Node]:
name = self.arguments[0]
try:
project_info = self.project_info_factory.create_project_info(self.options)
except ProjectError as e:
warning = self.create_warning(None, kind=self.kind)
return warning.warn("doxygen{kind}: %s" % e)
try:
finder = self.finder_factory.create_finder(project_info)
except MTimeError as e:
warning = self.create_warning(None, kind=self.kind)
return warning.warn("doxygen{kind}: %s" % e)
finder_filter = self.filter_factory.create_compound_finder_filter(name, self.kind)
# TODO: find a more specific type for the Doxygen nodes
matches: list[Any] = []
finder.filter_(finder_filter, matches)
if len(matches) == 0:
warning = self.create_warning(project_info, name=name, kind=self.kind)
return warning.warn('doxygen{kind}: Cannot find class "{name}" {tail}')
target_handler = create_target_handler(self.options, project_info, self.state.document)
filter_ = self.filter_factory.create_class_filter(name, self.options)
mask_factory = NullMaskFactory()
return self.render(
matches[0], project_info, filter_, target_handler, mask_factory, self.directive_args
)
class DoxygenClassDirective(_DoxygenClassLikeDirective):
kind = "class"
class DoxygenStructDirective(_DoxygenClassLikeDirective):
kind = "struct"
class DoxygenInterfaceDirective(_DoxygenClassLikeDirective):
kind = "interface"
breathe-doc-breathe-10a36f3/breathe/directives/content_block.py 0000664 0000000 0000000 00000010644 14756414247 0024620 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from typing import TYPE_CHECKING
from docutils.parsers.rst.directives import flag, unchanged_required
from breathe.directives import BaseDirective
from breathe.file_state_cache import MTimeError
from breathe.project import ProjectError
from breathe.renderer import RenderContext
from breathe.renderer.mask import NullMaskFactory
from breathe.renderer.sphinxrenderer import SphinxRenderer
from breathe.renderer.target import create_target_handler
if TYPE_CHECKING:
from typing import Any
from docutils.nodes import Node
class _DoxygenContentBlockDirective(BaseDirective):
"""Base class for namespace and group directives which have very similar behaviours"""
required_arguments = 1
optional_arguments = 1
option_spec = {
"path": unchanged_required,
"project": unchanged_required,
"content-only": flag,
"outline": flag,
"members": flag,
"protected-members": flag,
"private-members": flag,
"undoc-members": flag,
"no-link": flag,
"desc-only": flag,
"sort": flag,
}
has_content = False
def run(self) -> list[Node]:
name = self.arguments[0]
try:
project_info = self.project_info_factory.create_project_info(self.options)
except ProjectError as e:
warning = self.create_warning(None, kind=self.kind)
return warning.warn("doxygen{kind}: %s" % e)
try:
finder = self.finder_factory.create_finder(project_info)
except MTimeError as e:
warning = self.create_warning(None, kind=self.kind)
return warning.warn("doxygen{kind}: %s" % e)
finder_filter = self.filter_factory.create_finder_filter(self.kind, name)
# TODO: find a more specific type for the Doxygen nodes
matches: list[Any] = []
finder.filter_(finder_filter, matches)
# It shouldn't be possible to have too many matches as namespaces & groups in their nature
# are merged together if there are multiple declarations, so we only check for no matches
if not matches:
warning = self.create_warning(project_info, name=name, kind=self.kind)
return warning.warn('doxygen{kind}: Cannot find {kind} "{name}" {tail}')
if "content-only" in self.options and self.kind != "page":
# Unpack the single entry in the matches list
(node_stack,) = matches
filter_ = self.filter_factory.create_content_filter(self.kind, self.options)
# Having found the compound node for the namespace or group in the index we want to grab
# the contents of it which match the filter
contents_finder = self.finder_factory.create_finder_from_root(
node_stack[0], project_info
)
# TODO: find a more specific type for the Doxygen nodes
contents: list[Any] = []
contents_finder.filter_(filter_, contents)
# Replaces matches with our new starting points
matches = contents
target_handler = create_target_handler(self.options, project_info, self.state.document)
filter_ = self.filter_factory.create_render_filter(self.kind, self.options)
node_list: list[Node] = []
for node_stack in matches:
object_renderer = SphinxRenderer(
self.parser_factory.app,
project_info,
node_stack,
self.state,
self.state.document,
target_handler,
self.parser_factory.create_compound_parser(project_info),
filter_,
)
mask_factory = NullMaskFactory()
context = RenderContext(node_stack, mask_factory, self.directive_args)
node_list.extend(object_renderer.render(context.node_stack[0], context))
return node_list
class DoxygenNamespaceDirective(_DoxygenContentBlockDirective):
kind = "namespace"
class DoxygenGroupDirective(_DoxygenContentBlockDirective):
kind = "group"
option_spec = _DoxygenContentBlockDirective.option_spec.copy()
option_spec.update({
"inner": flag,
"no-title": flag,
})
class DoxygenPageDirective(_DoxygenContentBlockDirective):
kind = "page"
option_spec = {
"path": unchanged_required,
"project": unchanged_required,
"content-only": flag,
"no-title": flag,
}
breathe-doc-breathe-10a36f3/breathe/directives/file.py 0000664 0000000 0000000 00000007654 14756414247 0022722 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from docutils.parsers.rst.directives import flag, unchanged_required
from breathe.directives import BaseDirective
from breathe.project import ProjectError
from breathe.renderer import RenderContext
from breathe.renderer.mask import NullMaskFactory
from breathe.renderer.sphinxrenderer import SphinxRenderer
from breathe.renderer.target import create_target_handler
class _BaseFileDirective(BaseDirective):
"""Base class handle the main work when given the appropriate file and project info to work
from.
"""
# We use inheritance here rather than a separate object and composition, because so much
# information is present in the Directive class from the docutils framework that we'd have to
# pass way too much stuff to a helper object to be reasonable.
def handle_contents(self, file_, project_info):
finder = self.finder_factory.create_finder(project_info)
finder_filter = self.filter_factory.create_file_finder_filter(file_)
matches = []
finder.filter_(finder_filter, matches)
if len(matches) > 1:
warning = self.create_warning(None, file=file_, directivename=self.directive_name)
return warning.warn('{directivename}: Found multiple matches for file "{file} {tail}')
elif not matches:
warning = self.create_warning(None, file=file_, directivename=self.directive_name)
return warning.warn('{directivename}: Cannot find file "{file} {tail}')
target_handler = create_target_handler(self.options, project_info, self.state.document)
filter_ = self.filter_factory.create_file_filter(file_, self.options)
node_list = []
for node_stack in matches:
object_renderer = SphinxRenderer(
self.parser_factory.app,
project_info,
node_stack,
self.state,
self.state.document,
target_handler,
self.parser_factory.create_compound_parser(project_info),
filter_,
)
mask_factory = NullMaskFactory()
context = RenderContext(node_stack, mask_factory, self.directive_args)
node_list.extend(object_renderer.render(node_stack[0], context))
return node_list
class DoxygenFileDirective(_BaseFileDirective):
directive_name = "doxygenfile"
required_arguments = 0
optional_arguments = 3
option_spec = {
"path": unchanged_required,
"project": unchanged_required,
"outline": flag,
"no-link": flag,
"allow-dot-graphs": flag,
"sections": unchanged_required,
}
has_content = False
def run(self):
"""Get the file from the argument and the project info from the factory."""
file_ = self.arguments[0]
try:
project_info = self.project_info_factory.create_project_info(self.options)
except ProjectError as e:
warning = self.create_warning(None)
return warning.warn("doxygenfile: %s" % e)
return self.handle_contents(file_, project_info)
class AutoDoxygenFileDirective(_BaseFileDirective):
directive_name = "autodoxygenfile"
required_arguments = 1
option_spec = {
"project": unchanged_required,
"outline": flag,
"no-link": flag,
"allow-dot-graphs": flag,
"sections": unchanged_required,
}
has_content = False
def run(self):
"""Get the file from the argument and extract the associated project info for the named
project given that it is an auto-project.
"""
file_ = self.arguments[0]
try:
project_info = self.project_info_factory.retrieve_project_info_for_auto(self.options)
except ProjectError as e:
warning = self.create_warning(None)
return warning.warn("autodoxygenfile: %s" % e)
return self.handle_contents(file_, project_info)
breathe-doc-breathe-10a36f3/breathe/directives/function.py 0000664 0000000 0000000 00000026511 14756414247 0023621 0 ustar 00root root 0000000 0000000 from __future__ import annotations
import re
from typing import TYPE_CHECKING
from docutils import nodes
from docutils.parsers.rst.directives import flag, unchanged_required
from sphinx.domains import cpp
from breathe.directives import BaseDirective
from breathe.exception import BreatheError
from breathe.file_state_cache import MTimeError
from breathe.parser import FileIOError, ParserError
from breathe.project import ProjectError
from breathe.renderer import RenderContext, format_parser_error
from breathe.renderer.mask import MaskFactory, NoParameterNamesMask, NullMaskFactory
from breathe.renderer.sphinxrenderer import SphinxRenderer, WithContext
from breathe.renderer.target import create_target_handler
if TYPE_CHECKING:
from typing import Any
from docutils.nodes import Node
class _NoMatchingFunctionError(BreatheError):
pass
class _UnableToResolveFunctionError(BreatheError):
def __init__(self, signatures: list[str]) -> None:
self.signatures = signatures
class DoxygenFunctionDirective(BaseDirective):
required_arguments = 1
option_spec = {
"path": unchanged_required,
"project": unchanged_required,
"outline": flag,
"no-link": flag,
}
has_content = False
final_argument_whitespace = True
def run(self) -> list[Node]:
# Extract namespace, function name, and parameters
# Regex explanation:
# 1. (?:::)?
# Optional namespace prefix, including template arguments if a specialization.
# The is group 1:
# 1. [^:(<]+, basically an identifier
# definitely not a scope operator, ::, or template argument list, <
# 2. (?:::[^:(<]+)*, (?:) for anon match group,
# so a namespace delimiter and then another identifier
# 3. ::, another namespace delimiter before the function name
# 2. ([^(]+), group 2, the function name, whatever remains after the optional prefix,
# until a (.
# 3. (.*), group 3, the parameters.
# Note: for template argument lists, the spacing is important for the Doxygen lookup.
# TODO: we should really do this parsing differently, e.g., using the Sphinx C++ domain.
# TODO: the Doxygen lookup should not be whitespace sensitive.
match = re.match(r"(?:([^:(<]+(?:::[^:(<]+)*)::)?([^(]+)(.*)", self.arguments[0])
assert match is not None # TODO: this is probably not appropriate, for now it fixes typing
namespace = (match.group(1) or "").strip()
function_name = match.group(2).strip()
argsStr = match.group(3)
try:
project_info = self.project_info_factory.create_project_info(self.options)
except ProjectError as e:
warning = self.create_warning(None)
return warning.warn("doxygenfunction: %s" % e)
try:
finder = self.finder_factory.create_finder(project_info)
except MTimeError as e:
warning = self.create_warning(None)
return warning.warn("doxygenfunction: %s" % e)
# Extract arguments from the function name.
try:
args = self._parse_args(argsStr)
except cpp.DefinitionError as e:
return self.create_warning(
project_info,
namespace="%s::" % namespace if namespace else "",
function=function_name,
args=argsStr,
cpperror=str(e),
).warn(
"doxygenfunction: Unable to resolve function "
'"{namespace}{function}" with arguments "{args}".\n'
"Could not parse arguments. Parsing error is\n{cpperror}"
)
finder_filter = self.filter_factory.create_function_and_all_friend_finder_filter(
namespace, function_name
)
# TODO: find a more specific type for the Doxygen nodes
matchesAll: list[Any] = []
finder.filter_(finder_filter, matchesAll)
matches = []
for m in matchesAll:
# only take functions and friend functions
# ignore friend classes
node = m[0]
if node.kind == "friend" and not node.argsstring:
continue
matches.append(m)
# Create it ahead of time as it is cheap and it is ugly to declare it for both exception
# clauses below
warning = self.create_warning(
project_info,
namespace="%s::" % namespace if namespace else "",
function=function_name,
args=str(args),
)
try:
node_stack = self._resolve_function(matches, args, project_info)
except _NoMatchingFunctionError:
return warning.warn(
'doxygenfunction: Cannot find function "{namespace}{function}" {tail}'
)
except _UnableToResolveFunctionError as error:
message = (
"doxygenfunction: Unable to resolve function "
'"{namespace}{function}" with arguments {args} {tail}.\n'
"Potential matches:\n"
)
text = ""
for i, entry in enumerate(sorted(error.signatures)):
text += "- %s\n" % entry
block = nodes.literal_block("", "", nodes.Text(text))
formatted_message = warning.format(message)
warning_nodes = [nodes.paragraph("", "", nodes.Text(formatted_message)), block]
result = warning.warn(message, rendered_nodes=warning_nodes, unformatted_suffix=text)
return result
except cpp.DefinitionError as error:
warning.context["cpperror"] = str(error)
return warning.warn(
"doxygenfunction: Unable to resolve function "
'"{namespace}{function}" with arguments "{args}".\n'
"Candidate function could not be parsed. Parsing error is\n{cpperror}"
)
target_handler = create_target_handler(self.options, project_info, self.state.document)
filter_ = self.filter_factory.create_outline_filter(self.options)
return self.render(
node_stack,
project_info,
filter_,
target_handler,
NullMaskFactory(),
self.directive_args,
)
def _parse_args(self, function_description: str) -> cpp.ASTParametersQualifiers | None:
# Note: the caller must catch cpp.DefinitionError
if function_description == "":
return None
parser = cpp.DefinitionParser(
function_description, location=self.get_source_info(), config=self.config
)
paramQual = parser._parse_parameters_and_qualifiers("function")
# strip everything that doesn't contribute to overloading
def stripParamQual(paramQual):
paramQual.exceptionSpec = None
paramQual.final = None
paramQual.override = None
# TODO: strip attrs when Doxygen handles them
paramQual.initializer = None
paramQual.trailingReturn = None
for p in paramQual.args:
if p.arg is None:
assert p.ellipsis
continue
p.arg.init = None
declarator = p.arg.type.decl
def stripDeclarator(declarator):
if hasattr(declarator, "next"):
stripDeclarator(declarator.next)
if isinstance(declarator, cpp.ASTDeclaratorParen):
assert hasattr(declarator, "inner")
stripDeclarator(declarator.inner)
else:
assert isinstance(declarator, cpp.ASTDeclaratorNameParamQual)
assert hasattr(declarator, "declId")
declarator.declId = None
if declarator.paramQual is not None:
stripParamQual(declarator.paramQual)
stripDeclarator(declarator)
stripParamQual(paramQual)
return paramQual
def _create_function_signature(
self, node_stack, project_info, filter_, target_handler, mask_factory, directive_args
) -> str:
"Standard render process used by subclasses"
try:
object_renderer = SphinxRenderer(
self.parser_factory.app,
project_info,
node_stack,
self.state,
self.state.document,
target_handler,
self.parser_factory.create_compound_parser(project_info),
filter_,
)
except ParserError as e:
return format_parser_error(
"doxygenclass", e.error, e.filename, self.state, self.lineno, True
)
except FileIOError as e:
return format_parser_error(
"doxygenclass", e.error, e.filename, self.state, self.lineno, False
)
context = RenderContext(node_stack, mask_factory, directive_args)
node = node_stack[0]
with WithContext(object_renderer, context):
# this part should be kept in sync with visit_function in sphinxrenderer
name = node.get_name()
# assume we are only doing this for C++ declarations
declaration = " ".join([
object_renderer.create_template_prefix(node),
"".join(n.astext() for n in object_renderer.render(node.get_type())),
name,
node.get_argsstring(),
])
parser = cpp.DefinitionParser(
declaration, location=self.get_source_info(), config=self.config
)
ast = parser.parse_declaration("function", "function")
return str(ast)
def _resolve_function(self, matches, args: cpp.ASTParametersQualifiers | None, project_info):
if not matches:
raise _NoMatchingFunctionError()
res = []
candSignatures = []
for entry in matches:
text_options = {"no-link": "", "outline": ""}
# Render the matches to docutils nodes
target_handler = create_target_handler(
{"no-link": ""}, project_info, self.state.document
)
filter_ = self.filter_factory.create_outline_filter(text_options)
mask_factory = MaskFactory({"param": NoParameterNamesMask})
# Override the directive args for this render
directive_args = self.directive_args[:]
directive_args[2] = text_options
signature = self._create_function_signature(
entry, project_info, filter_, target_handler, mask_factory, directive_args
)
candSignatures.append(signature)
if args is not None:
match = re.match(r"([^(]*)(.*)", signature)
assert match
_match_args = match.group(2)
# Parse the text to find the arguments
# This one should succeed as it came from _create_function_signature
match_args = self._parse_args(_match_args)
# Match them against the arg spec
if args != match_args:
continue
res.append((entry, signature))
if len(res) == 1:
return res[0][0]
else:
raise _UnableToResolveFunctionError(candSignatures)
breathe-doc-breathe-10a36f3/breathe/directives/index.py 0000664 0000000 0000000 00000007574 14756414247 0023113 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from typing import TYPE_CHECKING
from docutils.parsers.rst.directives import flag, unchanged_required
from breathe.directives import BaseDirective
from breathe.parser import FileIOError, ParserError
from breathe.project import ProjectError
from breathe.renderer import RenderContext, format_parser_error
from breathe.renderer.mask import NullMaskFactory
from breathe.renderer.sphinxrenderer import SphinxRenderer
from breathe.renderer.target import create_target_handler
if TYPE_CHECKING:
from docutils.nodes import Node
class RootDataObject:
node_type = "root"
class _BaseIndexDirective(BaseDirective):
"""Base class handle the main work when given the appropriate project info to work from."""
# We use inheritance here rather than a separate object and composition, because so much
# information is present in the Directive class from the docutils framework that we'd have to
# pass way too much stuff to a helper object to be reasonable.
def handle_contents(self, project_info):
try:
finder = self.finder_factory.create_finder(project_info)
except ParserError as e:
return format_parser_error(
self.name, e.error, e.filename, self.state, self.lineno, True
)
except FileIOError as e:
return format_parser_error(self.name, e.error, e.filename, self.state, self.lineno)
data_object = finder.root()
target_handler = create_target_handler(self.options, project_info, self.state.document)
filter_ = self.filter_factory.create_index_filter(self.options)
object_renderer = SphinxRenderer(
self.parser_factory.app,
project_info,
[data_object],
self.state,
self.state.document,
target_handler,
self.parser_factory.create_compound_parser(project_info),
filter_,
)
mask_factory = NullMaskFactory()
context = RenderContext([data_object, RootDataObject()], mask_factory, self.directive_args)
try:
node_list = object_renderer.render(context.node_stack[0], context)
except ParserError as e:
return format_parser_error(
self.name, e.error, e.filename, self.state, self.lineno, True
)
except FileIOError as e:
return format_parser_error(self.name, e.error, e.filename, self.state, self.lineno)
return node_list
class DoxygenIndexDirective(_BaseIndexDirective):
required_arguments = 0
optional_arguments = 2
option_spec = {
"path": unchanged_required,
"project": unchanged_required,
"outline": flag,
"no-link": flag,
"allow-dot-graphs": flag,
}
has_content = False
def run(self):
"""Extract the project info and pass it to the helper method"""
try:
project_info = self.project_info_factory.create_project_info(self.options)
except ProjectError as e:
warning = self.create_warning(None)
return warning.warn("doxygenindex: %s" % e)
return self.handle_contents(project_info)
class AutoDoxygenIndexDirective(_BaseIndexDirective):
required_arguments = 0
final_argument_whitespace = True
option_spec = {
"project": unchanged_required,
"outline": flag,
"no-link": flag,
"allow-dot-graphs": flag,
}
has_content = False
def run(self) -> list[Node]:
"""Extract the project info from the auto project info store and pass it to the helper
method.
"""
try:
project_info = self.project_info_factory.retrieve_project_info_for_auto(self.options)
except ProjectError as e:
warning = self.create_warning(None)
return warning.warn("autodoxygenindex: %s" % e)
return self.handle_contents(project_info)
breathe-doc-breathe-10a36f3/breathe/directives/item.py 0000664 0000000 0000000 00000010075 14756414247 0022730 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from typing import TYPE_CHECKING
from docutils.parsers.rst.directives import flag, unchanged_required
from breathe.directives import BaseDirective
from breathe.file_state_cache import MTimeError
from breathe.project import ProjectError
from breathe.renderer.mask import NullMaskFactory
from breathe.renderer.target import create_target_handler
if TYPE_CHECKING:
from typing import Any
from docutils.nodes import Node
from breathe.renderer.filter import Filter
class _DoxygenBaseItemDirective(BaseDirective):
required_arguments = 1
optional_arguments = 1
option_spec = {
"path": unchanged_required,
"project": unchanged_required,
"outline": flag,
"no-link": flag,
}
has_content = False
def create_finder_filter(self, namespace: str, name: str) -> Filter:
"""Creates a filter to find the node corresponding to this item."""
return self.filter_factory.create_member_finder_filter(namespace, name, self.kind)
def run(self) -> list[Node]:
try:
namespace, name = self.arguments[0].rsplit("::", 1)
except ValueError:
namespace, name = "", self.arguments[0]
try:
project_info = self.project_info_factory.create_project_info(self.options)
except ProjectError as e:
warning = self.create_warning(None, kind=self.kind)
return warning.warn("doxygen{kind}: %s" % e)
try:
finder = self.finder_factory.create_finder(project_info)
except MTimeError as e:
warning = self.create_warning(None, kind=self.kind)
return warning.warn("doxygen{kind}: %s" % e)
finder_filter = self.create_finder_filter(namespace, name)
# TODO: find a more specific type for the Doxygen nodes
matches: list[Any] = []
finder.filter_(finder_filter, matches)
if len(matches) == 0:
display_name = "%s::%s" % (namespace, name) if namespace else name
warning = self.create_warning(project_info, kind=self.kind, display_name=display_name)
return warning.warn('doxygen{kind}: Cannot find {kind} "{display_name}" {tail}')
target_handler = create_target_handler(self.options, project_info, self.state.document)
filter_ = self.filter_factory.create_outline_filter(self.options)
node_stack = matches[0]
mask_factory = NullMaskFactory()
return self.render(
node_stack, project_info, filter_, target_handler, mask_factory, self.directive_args
)
class DoxygenVariableDirective(_DoxygenBaseItemDirective):
kind = "variable"
class DoxygenDefineDirective(_DoxygenBaseItemDirective):
kind = "define"
class DoxygenConceptDirective(_DoxygenBaseItemDirective):
kind = "concept"
def create_finder_filter(self, namespace: str, name: str) -> Filter:
# Unions are stored in the xml file with their fully namespaced name
# We're using C++ namespaces here, it might be best to make this file
# type dependent
#
xml_name = "%s::%s" % (namespace, name) if namespace else name
return self.filter_factory.create_compound_finder_filter(xml_name, "concept")
class DoxygenEnumDirective(_DoxygenBaseItemDirective):
kind = "enum"
class DoxygenEnumValueDirective(_DoxygenBaseItemDirective):
kind = "enumvalue"
def create_finder_filter(self, namespace: str, name: str) -> Filter:
return self.filter_factory.create_enumvalue_finder_filter(name)
class DoxygenTypedefDirective(_DoxygenBaseItemDirective):
kind = "typedef"
class DoxygenUnionDirective(_DoxygenBaseItemDirective):
kind = "union"
def create_finder_filter(self, namespace: str, name: str) -> Filter:
# Unions are stored in the xml file with their fully namespaced name
# We're using C++ namespaces here, it might be best to make this file
# type dependent
#
xml_name = "%s::%s" % (namespace, name) if namespace else name
return self.filter_factory.create_compound_finder_filter(xml_name, "union")
breathe-doc-breathe-10a36f3/breathe/directives/setup.py 0000664 0000000 0000000 00000012011 14756414247 0023122 0 ustar 00root root 0000000 0000000 from __future__ import annotations
import subprocess
from pathlib import Path
from typing import TYPE_CHECKING
from breathe.directives.class_like import (
DoxygenClassDirective,
DoxygenInterfaceDirective,
DoxygenStructDirective,
)
from breathe.directives.content_block import (
DoxygenGroupDirective,
DoxygenNamespaceDirective,
DoxygenPageDirective,
)
from breathe.directives.file import AutoDoxygenFileDirective, DoxygenFileDirective
from breathe.directives.function import DoxygenFunctionDirective
from breathe.directives.index import AutoDoxygenIndexDirective, DoxygenIndexDirective
from breathe.directives.item import (
DoxygenConceptDirective,
DoxygenDefineDirective,
DoxygenEnumDirective,
DoxygenEnumValueDirective,
DoxygenTypedefDirective,
DoxygenUnionDirective,
DoxygenVariableDirective,
)
from breathe.parser import DoxygenParserFactory
from breathe.process import AutoDoxygenProcessHandle
from breathe.project import ProjectInfoFactory
if TYPE_CHECKING:
from sphinx.application import Sphinx
def setup(app: Sphinx) -> None:
directives = {
"doxygenindex": DoxygenIndexDirective,
"autodoxygenindex": AutoDoxygenIndexDirective,
"doxygenfunction": DoxygenFunctionDirective,
"doxygenstruct": DoxygenStructDirective,
"doxygenclass": DoxygenClassDirective,
"doxygeninterface": DoxygenInterfaceDirective,
"doxygenvariable": DoxygenVariableDirective,
"doxygendefine": DoxygenDefineDirective,
"doxygenconcept": DoxygenConceptDirective,
"doxygenenum": DoxygenEnumDirective,
"doxygenenumvalue": DoxygenEnumValueDirective,
"doxygentypedef": DoxygenTypedefDirective,
"doxygenunion": DoxygenUnionDirective,
"doxygennamespace": DoxygenNamespaceDirective,
"doxygengroup": DoxygenGroupDirective,
"doxygenfile": DoxygenFileDirective,
"autodoxygenfile": AutoDoxygenFileDirective,
"doxygenpage": DoxygenPageDirective,
}
# The directives need these global objects, so in order to smuggle
# them in, we use env.temp_data. But it is cleared after each document
# has been read, we use the source-read event to set them.
# note: the parser factory contains a cache of the parsed XML
# note: the project_info_factory also contains some caching stuff
# TODO: is that actually safe for when reading in parallel?
project_info_factory = ProjectInfoFactory(app)
parser_factory = DoxygenParserFactory(app)
def set_temp_data(
app: Sphinx, project_info_factory=project_info_factory, parser_factory=parser_factory
):
assert app.env is not None
app.env.temp_data["breathe_project_info_factory"] = project_info_factory
app.env.temp_data["breathe_parser_factory"] = parser_factory
app.connect("source-read", lambda app, docname, source: set_temp_data(app))
for name, directive in directives.items():
app.add_directive(name, directive)
app.add_config_value("breathe_projects", {}, "env") # Dict[str, str]
app.add_config_value("breathe_default_project", "", "env") # str
# Provide reasonable defaults for domain_by_extension mapping. Can be overridden by users.
app.add_config_value(
"breathe_domain_by_extension", {"py": "py", "cs": "cs"}, "env"
) # Dict[str, str]
app.add_config_value("breathe_domain_by_file_pattern", {}, "env") # Dict[str, str]
app.add_config_value("breathe_projects_source", {}, "env")
app.add_config_value("breathe_build_directory", "", "env")
app.add_config_value("breathe_default_members", (), "env")
app.add_config_value("breathe_show_define_initializer", False, "env")
app.add_config_value("breathe_show_enumvalue_initializer", False, "env")
app.add_config_value("breathe_show_include", True, "env")
app.add_config_value("breathe_implementation_filename_extensions", [".c", ".cc", ".cpp"], "env")
app.add_config_value("breathe_doxygen_config_options", {}, "env")
app.add_config_value("breathe_doxygen_aliases", {}, "env")
app.add_config_value("breathe_use_project_refids", False, "env")
app.add_config_value("breathe_order_parameters_first", False, "env")
app.add_config_value("breathe_separate_member_pages", False, "env")
breathe_css = "breathe.css"
if Path(app.confdir, "_static", breathe_css).exists():
app.add_css_file(breathe_css)
def write_file(directory, filename, content):
# Ensure that the directory exists
directory = Path(directory)
directory.mkdir(parents=True, exist_ok=True)
# Write the file with the provided contents
(directory / filename).write_text(content)
doxygen_handle = AutoDoxygenProcessHandle(
subprocess.check_call, write_file, project_info_factory
)
def doxygen_hook(app: Sphinx):
doxygen_handle.generate_xml(
app.config.breathe_projects_source,
app.config.breathe_doxygen_config_options,
app.config.breathe_doxygen_aliases,
)
app.connect("builder-inited", doxygen_hook)
breathe-doc-breathe-10a36f3/breathe/exception.py 0000664 0000000 0000000 00000000115 14756414247 0021621 0 ustar 00root root 0000000 0000000 from __future__ import annotations
class BreatheError(Exception):
pass
breathe-doc-breathe-10a36f3/breathe/file_state_cache.py 0000664 0000000 0000000 00000004712 14756414247 0023074 0 ustar 00root root 0000000 0000000 from __future__ import annotations
import os
from pathlib import Path
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from sphinx.application import Sphinx
from sphinx.environment import BuildEnvironment
"""
Store the modified time of the various doxygen xml files against the
reStructuredText file that they are referenced from so that we know which
reStructuredText files to rebuild if the doxygen xml is modified.
We store the information in the environment object as 'breathe_file_state'
so that it is pickled down and stored between builds as Sphinx is designed to do.
(mypy doesn't like dynamically added attributes, hence all references to it are ignored)
"""
class MTimeError(Exception):
pass
def _getmtime(filename: str):
try:
return os.path.getmtime(filename)
except OSError:
raise MTimeError("Cannot find file: %s" % os.path.realpath(filename))
def update(app: Sphinx, source_file: str | os.PathLike[str]) -> None:
if not hasattr(app.env, "breathe_file_state"):
app.env.breathe_file_state = {} # type: ignore[attr-defined]
norm_source_file = Path(source_file).resolve().as_posix()
new_mtime = _getmtime(norm_source_file)
_mtime, docnames = app.env.breathe_file_state.setdefault( # type: ignore[attr-defined]
norm_source_file, (new_mtime, set())
)
assert app.env is not None
docnames.add(app.env.docname)
app.env.breathe_file_state[norm_source_file] = (new_mtime, docnames) # type: ignore[attr-defined]
def _get_outdated(
app: Sphinx, env: BuildEnvironment, added: set[str], changed: set[str], removed: set[str]
) -> list[str]:
if not hasattr(app.env, "breathe_file_state"):
return []
stale = []
for filename, info in app.env.breathe_file_state.items():
old_mtime, docnames = info
if _getmtime(filename) > old_mtime:
stale.extend(docnames)
return list(set(stale).difference(removed))
def _purge_doc(app: Sphinx, env: BuildEnvironment, docname: str) -> None:
if not hasattr(app.env, "breathe_file_state"):
return
toremove = []
for filename, info in app.env.breathe_file_state.items():
_, docnames = info
docnames.discard(docname)
if not docnames:
toremove.append(filename)
for filename in toremove:
del app.env.breathe_file_state[filename]
def setup(app: Sphinx):
app.connect("env-get-outdated", _get_outdated)
app.connect("env-purge-doc", _purge_doc)
breathe-doc-breathe-10a36f3/breathe/filetypes.py 0000664 0000000 0000000 00000001771 14756414247 0021640 0 ustar 00root root 0000000 0000000 """
A module to house the methods for resolving a code-blocks language based on filename
(and extension).
"""
from __future__ import annotations
import os.path
from pygments.lexers import get_lexer_for_filename
from pygments.util import ClassNotFound
def get_pygments_alias(filename: str) -> str | None:
"Find first pygments alias from filename"
try:
lexer_cls = get_lexer_for_filename(filename)
return lexer_cls.aliases[0] # type: ignore[attr-defined]
except ClassNotFound:
return None
def get_extension(filename: str) -> str:
"Get extension from filename"
# If the filename is just '.ext' then we get ('.ext', '') so we fall back to first part if
# the second isn't there
(first, second) = os.path.splitext(filename)
# Doxygen allows users to specify the file extension ".unparsed" to disable syntax highlighting.
# We translate it into the pygments un-highlighted 'text' type
return (second or first).lstrip(".").replace("unparsed", "text")
breathe-doc-breathe-10a36f3/breathe/finder/ 0000775 0000000 0000000 00000000000 14756414247 0020523 5 ustar 00root root 0000000 0000000 breathe-doc-breathe-10a36f3/breathe/finder/__init__.py 0000664 0000000 0000000 00000001522 14756414247 0022634 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from breathe.project import ProjectInfo
from breathe.renderer.filter import Filter
def stack(element, list_):
"""Stack an element on to the start of a list and return as a new list"""
# Copy list first so we have a new list to insert into
output = list_[:]
output.insert(0, element)
return output
class ItemFinder:
def __init__(self, project_info: ProjectInfo, data_object, item_finder_factory):
self.data_object = data_object
# DoxygenItemFinderFactory, but actually typing it would introduce an import cycle
self.item_finder_factory = item_finder_factory
self.project_info = project_info
def filter_(self, ancestors, filter_: Filter, matches) -> None:
raise NotImplementedError
breathe-doc-breathe-10a36f3/breathe/finder/compound.py 0000664 0000000 0000000 00000005041 14756414247 0022721 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from typing import TYPE_CHECKING
from breathe.finder import ItemFinder, stack
if TYPE_CHECKING:
from breathe.renderer.filter import Filter
class DoxygenTypeSubItemFinder(ItemFinder):
def filter_(self, ancestors, filter_: Filter, matches) -> None:
"""Find nodes which match the filter. Doesn't test this node, only its children"""
node_stack = stack(self.data_object, ancestors)
compound_finder = self.item_finder_factory.create_finder(self.data_object.compounddef)
compound_finder.filter_(node_stack, filter_, matches)
class CompoundDefTypeSubItemFinder(ItemFinder):
def filter_(self, ancestors, filter_: Filter, matches) -> None:
"""Finds nodes which match the filter and continues checks to children"""
node_stack = stack(self.data_object, ancestors)
if filter_.allow(node_stack):
matches.append(node_stack)
for sectiondef in self.data_object.sectiondef:
finder = self.item_finder_factory.create_finder(sectiondef)
finder.filter_(node_stack, filter_, matches)
for innerclass in self.data_object.innerclass:
finder = self.item_finder_factory.create_finder(innerclass)
finder.filter_(node_stack, filter_, matches)
class SectionDefTypeSubItemFinder(ItemFinder):
def filter_(self, ancestors, filter_: Filter, matches) -> None:
"""Find nodes which match the filter. Doesn't test this node, only its children"""
node_stack = stack(self.data_object, ancestors)
if filter_.allow(node_stack):
matches.append(node_stack)
for memberdef in self.data_object.memberdef:
finder = self.item_finder_factory.create_finder(memberdef)
finder.filter_(node_stack, filter_, matches)
class MemberDefTypeSubItemFinder(ItemFinder):
def filter_(self, ancestors, filter_: Filter, matches) -> None:
data_object = self.data_object
node_stack = stack(data_object, ancestors)
if filter_.allow(node_stack):
matches.append(node_stack)
if data_object.kind == "enum":
for value in data_object.enumvalue:
value_stack = stack(value, node_stack)
if filter_.allow(value_stack):
matches.append(value_stack)
class RefTypeSubItemFinder(ItemFinder):
def filter_(self, ancestors, filter_: Filter, matches) -> None:
node_stack = stack(self.data_object, ancestors)
if filter_.allow(node_stack):
matches.append(node_stack)
breathe-doc-breathe-10a36f3/breathe/finder/factory.py 0000664 0000000 0000000 00000005641 14756414247 0022552 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from typing import TYPE_CHECKING
from breathe.finder import compound as compoundfinder
from breathe.finder import index as indexfinder
if TYPE_CHECKING:
from sphinx.application import Sphinx
from breathe.finder import ItemFinder
from breathe.parser import DoxygenParserFactory
from breathe.project import ProjectInfo
from breathe.renderer.filter import Filter
class _CreateCompoundTypeSubFinder:
def __init__(self, app: Sphinx, parser_factory: DoxygenParserFactory):
self.app = app
self.parser_factory = parser_factory
def __call__(self, project_info: ProjectInfo, *args):
compound_parser = self.parser_factory.create_compound_parser(project_info)
return indexfinder.CompoundTypeSubItemFinder(self.app, compound_parser, project_info, *args)
class DoxygenItemFinderFactory:
def __init__(self, finders: dict[str, type[ItemFinder]], project_info: ProjectInfo):
self.finders = finders
self.project_info = project_info
def create_finder(self, data_object) -> ItemFinder:
return self.finders[data_object.node_type](self.project_info, data_object, self)
class _FakeParentNode:
node_type = "fakeparent"
class Finder:
def __init__(self, root, item_finder_factory: DoxygenItemFinderFactory) -> None:
self._root = root
self.item_finder_factory = item_finder_factory
def filter_(self, filter_: Filter, matches) -> None:
"""Adds all nodes which match the filter into the matches list"""
item_finder = self.item_finder_factory.create_finder(self._root)
item_finder.filter_([_FakeParentNode()], filter_, matches)
def root(self):
return self._root
class FinderFactory:
def __init__(self, app: Sphinx, parser_factory: DoxygenParserFactory):
self.app = app
self.parser_factory = parser_factory
self.parser = parser_factory.create_index_parser()
def create_finder(self, project_info: ProjectInfo) -> Finder:
root = self.parser.parse(project_info)
return self.create_finder_from_root(root, project_info)
def create_finder_from_root(self, root, project_info: ProjectInfo) -> Finder:
finders: dict[str, type[ItemFinder]] = {
"doxygen": indexfinder.DoxygenTypeSubItemFinder,
"compound": _CreateCompoundTypeSubFinder(self.app, self.parser_factory), # type: ignore[dict-item]
"member": indexfinder.MemberTypeSubItemFinder,
"doxygendef": compoundfinder.DoxygenTypeSubItemFinder,
"compounddef": compoundfinder.CompoundDefTypeSubItemFinder,
"sectiondef": compoundfinder.SectionDefTypeSubItemFinder,
"memberdef": compoundfinder.MemberDefTypeSubItemFinder,
"ref": compoundfinder.RefTypeSubItemFinder,
}
item_finder_factory = DoxygenItemFinderFactory(finders, project_info)
return Finder(root, item_finder_factory)
breathe-doc-breathe-10a36f3/breathe/finder/index.py 0000664 0000000 0000000 00000006232 14756414247 0022207 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from typing import TYPE_CHECKING
from breathe.finder import ItemFinder, stack
from breathe.renderer.filter import FilterFactory
if TYPE_CHECKING:
from typing import Any
from sphinx.application import Sphinx
from breathe.parser import DoxygenCompoundParser
from breathe.renderer.filter import Filter
class DoxygenTypeSubItemFinder(ItemFinder):
def filter_(self, ancestors, filter_: Filter, matches) -> None:
"""Find nodes which match the filter. Doesn't test this node, only its children"""
compounds = self.data_object.get_compound()
node_stack = stack(self.data_object, ancestors)
for compound in compounds:
compound_finder = self.item_finder_factory.create_finder(compound)
compound_finder.filter_(node_stack, filter_, matches)
class CompoundTypeSubItemFinder(ItemFinder):
def __init__(self, app: Sphinx, compound_parser: DoxygenCompoundParser, *args):
super().__init__(*args)
self.filter_factory = FilterFactory(app)
self.compound_parser = compound_parser
def filter_(self, ancestors, filter_: Filter, matches) -> None:
"""Finds nodes which match the filter and continues checks to children
Requires parsing the xml files referenced by the children for which we use the compound
parser and continue at the top level of that pretending that this node is the parent of the
top level node of the compound file.
"""
node_stack = stack(self.data_object, ancestors)
# Match against compound object
if filter_.allow(node_stack):
matches.append(node_stack)
# Descend to member children
members = self.data_object.get_member()
# TODO: find a more precise type for the Doxygen nodes
member_matches: list[Any] = []
for member in members:
member_finder = self.item_finder_factory.create_finder(member)
member_finder.filter_(node_stack, filter_, member_matches)
# If there are members in this compound that match the criteria
# then load up the file for this compound and get the member data objects
if member_matches:
file_data = self.compound_parser.parse(self.data_object.refid)
finder = self.item_finder_factory.create_finder(file_data)
for member_stack in member_matches:
ref_filter = self.filter_factory.create_id_filter(
"memberdef", member_stack[0].refid
)
finder.filter_(node_stack, ref_filter, matches)
else:
# Read in the xml file referenced by the compound and descend into that as well
file_data = self.compound_parser.parse(self.data_object.refid)
finder = self.item_finder_factory.create_finder(file_data)
finder.filter_(node_stack, filter_, matches)
class MemberTypeSubItemFinder(ItemFinder):
def filter_(self, ancestors, filter_: Filter, matches) -> None:
node_stack = stack(self.data_object, ancestors)
# Match against member object
if filter_.allow(node_stack):
matches.append(node_stack)
breathe-doc-breathe-10a36f3/breathe/parser/ 0000775 0000000 0000000 00000000000 14756414247 0020550 5 ustar 00root root 0000000 0000000 breathe-doc-breathe-10a36f3/breathe/parser/__init__.py 0000664 0000000 0000000 00000005673 14756414247 0022674 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from breathe import file_state_cache
from breathe.parser import compound, index
if TYPE_CHECKING:
from sphinx.application import Sphinx
from breathe.project import ProjectInfo
class ParserError(Exception):
def __init__(self, error: Exception, filename: Path):
super().__init__(error)
self.error = error
self.filename = filename
def __str__(self):
return "file %s: %s" % (self.filename, self.error)
class FileIOError(Exception):
def __init__(self, error: Exception, filename: Path):
super().__init__(error)
self.error = error
self.filename = filename
class Parser:
def __init__(self, app: Sphinx, cache):
self.app = app
self.cache = cache
class DoxygenIndexParser(Parser):
def parse(self, project_info: ProjectInfo):
filename = Path(self.app.confdir, project_info.project_path(), "index.xml").resolve()
file_state_cache.update(self.app, filename)
try:
# Try to get from our cache
return self.cache[filename]
except KeyError:
# If that fails, parse it afresh
try:
result = index.parse(filename)
self.cache[filename] = result
return result
except index.ParseError as e:
raise ParserError(e, filename)
except index.FileIOError as e:
raise FileIOError(e, filename)
class DoxygenCompoundParser(Parser):
def __init__(self, app: Sphinx, cache, project_info: ProjectInfo) -> None:
super().__init__(app, cache)
self.project_info = project_info
def parse(self, refid: str):
filename = Path(
self.app.confdir, self.project_info.project_path(), f"{refid}.xml"
).resolve()
file_state_cache.update(self.app, filename)
try:
# Try to get from our cache
return self.cache[filename]
except KeyError:
# If that fails, parse it afresh
try:
result = compound.parse(filename)
self.cache[filename] = result
return result
except compound.ParseError as e:
raise ParserError(e, filename)
except compound.FileIOError as e:
raise FileIOError(e, filename)
class DoxygenParserFactory:
def __init__(self, app: Sphinx) -> None:
self.app = app
# TODO: do we have a base class for all the Doxygen XML node types
# that we can use for typing?
self.cache = {} # type: ignore[var-annotated]
def create_index_parser(self) -> DoxygenIndexParser:
return DoxygenIndexParser(self.app, self.cache)
def create_compound_parser(self, project_info: ProjectInfo) -> DoxygenCompoundParser:
return DoxygenCompoundParser(self.app, self.cache, project_info)
breathe-doc-breathe-10a36f3/breathe/parser/compound.py 0000664 0000000 0000000 00000114602 14756414247 0022752 0 ustar 00root root 0000000 0000000 """
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
This file contains manual modifications.
"""
from __future__ import annotations
from xml.dom import Node, minidom
from xml.parsers.expat import ExpatError
from breathe.parser import compoundsuper as supermod
from breathe.parser.compoundsuper import MixedContainer
class DoxygenTypeSub(supermod.DoxygenType):
node_type = "doxygendef"
def __init__(self, version=None, compounddef=None):
supermod.DoxygenType.__init__(self, version, compounddef)
supermod.DoxygenType.subclass = DoxygenTypeSub
# end class DoxygenTypeSub
class compounddefTypeSub(supermod.compounddefType):
node_type = "compounddef"
def __init__(
self,
kind=None,
prot=None,
id=None,
compoundname="",
title="",
basecompoundref=None,
derivedcompoundref=None,
includes=None,
includedby=None,
incdepgraph=None,
invincdepgraph=None,
innerdir=None,
innerfile=None,
innerclass=None,
innernamespace=None,
innerpage=None,
innergroup=None,
templateparamlist=None,
sectiondef=None,
briefdescription=None,
detaileddescription=None,
inheritancegraph=None,
collaborationgraph=None,
programlisting=None,
location=None,
listofallmembers=None,
language=None,
):
supermod.compounddefType.__init__(
self,
kind,
prot,
id,
compoundname,
title,
basecompoundref,
derivedcompoundref,
includes,
includedby,
incdepgraph,
invincdepgraph,
innerdir,
innerfile,
innerclass,
innernamespace,
innerpage,
innergroup,
templateparamlist,
sectiondef,
briefdescription,
detaileddescription,
inheritancegraph,
collaborationgraph,
programlisting,
location,
listofallmembers,
language,
)
supermod.compounddefType.subclass = compounddefTypeSub
# end class compounddefTypeSub
class listofallmembersTypeSub(supermod.listofallmembersType):
node_type = "listofallmembers"
def __init__(self, member=None):
supermod.listofallmembersType.__init__(self, member)
supermod.listofallmembersType.subclass = listofallmembersTypeSub
# end class listofallmembersTypeSub
class memberRefTypeSub(supermod.memberRefType):
node_type = "memberref"
def __init__(self, virt=None, prot=None, refid=None, ambiguityscope=None, scope="", name=""):
supermod.memberRefType.__init__(self, virt, prot, refid, ambiguityscope, scope, name)
supermod.memberRefType.subclass = memberRefTypeSub
# end class memberRefTypeSub
class compoundRefTypeSub(supermod.compoundRefType):
node_type = "compoundref"
def __init__(
self, virt=None, prot=None, refid=None, valueOf_="", mixedclass_=None, content_=None
):
supermod.compoundRefType.__init__(self, mixedclass_, content_)
supermod.compoundRefType.subclass = compoundRefTypeSub
# end class compoundRefTypeSub
class reimplementTypeSub(supermod.reimplementType):
node_type = "reimplement"
def __init__(self, refid=None, valueOf_="", mixedclass_=None, content_=None):
supermod.reimplementType.__init__(self, mixedclass_, content_)
supermod.reimplementType.subclass = reimplementTypeSub
# end class reimplementTypeSub
class incTypeSub(supermod.incType):
node_type = "inc"
def __init__(self, local=None, refid=None, valueOf_="", mixedclass_=None, content_=None):
supermod.incType.__init__(self, mixedclass_, content_)
supermod.incType.subclass = incTypeSub
# end class incTypeSub
class refTypeSub(supermod.refType):
node_type = "ref"
def __init__(
self, node_name, prot=None, refid=None, valueOf_="", mixedclass_=None, content_=None
):
supermod.refType.__init__(self, mixedclass_, content_)
self.node_name = node_name
supermod.refType.subclass = refTypeSub
class refTextTypeSub(supermod.refTextType):
node_type = "reftex"
def __init__(
self, refid=None, kindref=None, external=None, valueOf_="", mixedclass_=None, content_=None
):
supermod.refTextType.__init__(self, mixedclass_, content_)
supermod.refTextType.subclass = refTextTypeSub
# end class refTextTypeSub
class sectiondefTypeSub(supermod.sectiondefType):
node_type = "sectiondef"
def __init__(self, kind=None, header="", description=None, memberdef=None):
supermod.sectiondefType.__init__(self, kind, header, description, memberdef)
supermod.sectiondefType.subclass = sectiondefTypeSub
# end class sectiondefTypeSub
class memberdefTypeSub(supermod.memberdefType):
node_type = "memberdef"
def __init__(
self,
initonly=None,
kind=None,
volatile=None,
const=None,
raise_=None,
virt=None,
readable=None,
prot=None,
explicit=None,
new=None,
final=None,
writable=None,
add=None,
static=None,
strong=None,
remove=None,
sealed=None,
mutable=None,
gettable=None,
inline=None,
settable=None,
id=None,
templateparamlist=None,
type_=None,
definition="",
argsstring="",
name="",
read="",
write="",
bitfield="",
reimplements=None,
reimplementedby=None,
param=None,
enumvalue=None,
initializer=None,
exceptions=None,
briefdescription=None,
detaileddescription=None,
inbodydescription=None,
location=None,
references=None,
referencedby=None,
refqual=None,
):
supermod.memberdefType.__init__(
self,
initonly,
kind,
volatile,
const,
raise_,
virt,
readable,
prot,
explicit,
new,
final,
writable,
add,
static,
strong,
remove,
sealed,
mutable,
gettable,
inline,
settable,
id,
templateparamlist,
type_,
definition,
argsstring,
name,
read,
write,
bitfield,
reimplements,
reimplementedby,
param,
enumvalue,
initializer,
exceptions,
briefdescription,
detaileddescription,
inbodydescription,
location,
references,
referencedby,
refqual,
)
self.parameterlist = supermod.docParamListType.factory()
self.parameterlist.kind = "param"
def buildChildren(self, child_, nodeName_):
supermod.memberdefType.buildChildren(self, child_, nodeName_)
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "param":
# Get latest param
param = self.param[-1]
# If it doesn't have a description we're done
if not param.briefdescription:
return
# Construct our own param list from the descriptions stored inline
# with the parameters
paramdescription = param.briefdescription
paramname = supermod.docParamName.factory()
# Add parameter name
obj_ = paramname.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", param.declname
)
paramname.content_.append(obj_)
paramnamelist = supermod.docParamNameList.factory()
paramnamelist.parametername.append(paramname)
paramlistitem = supermod.docParamListItem.factory()
paramlistitem.parameternamelist.append(paramnamelist)
# Add parameter description
paramlistitem.parameterdescription = paramdescription
self.parameterlist.parameteritem.append(paramlistitem)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "detaileddescription":
if not self.parameterlist.parameteritem:
# No items in our list
return
# Assume supermod.memberdefType.buildChildren has already built the
# description object, we just want to slot our parameterlist in at
# a reasonable point
if not self.detaileddescription:
# Create one if it doesn't exist
self.detaileddescription = supermod.descriptionType.factory()
detaileddescription = self.detaileddescription
para = supermod.docParaType.factory()
para.parameterlist.append(self.parameterlist)
obj_ = detaileddescription.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", para
)
index = 0
detaileddescription.content_.insert(index, obj_)
supermod.memberdefType.subclass = memberdefTypeSub
# end class memberdefTypeSub
class descriptionTypeSub(supermod.descriptionType):
node_type = "description"
def __init__(
self, title="", para=None, sect1=None, internal=None, mixedclass_=None, content_=None
):
supermod.descriptionType.__init__(self, mixedclass_, content_)
supermod.descriptionType.subclass = descriptionTypeSub
# end class descriptionTypeSub
class enumvalueTypeSub(supermod.enumvalueType):
node_type = "enumvalue"
def __init__(
self,
prot=None,
id=None,
name="",
initializer=None,
briefdescription=None,
detaileddescription=None,
mixedclass_=None,
content_=None,
):
supermod.enumvalueType.__init__(self, mixedclass_, content_)
self.initializer = None
def buildChildren(self, child_, nodeName_):
# Get text from child and put it in self.name
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name":
valuestr_ = "".join(text_.nodeValue for text_ in child_.childNodes)
self.name = valuestr_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "briefdescription":
obj_ = supermod.descriptionType.factory()
obj_.build(child_)
self.set_briefdescription(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "detaileddescription":
obj_ = supermod.descriptionType.factory()
obj_.build(child_)
self.set_detaileddescription(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "initializer":
childobj_ = supermod.linkedTextType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "initializer", childobj_
)
self.set_initializer(obj_)
self.content_.append(obj_)
supermod.enumvalueType.subclass = enumvalueTypeSub
# end class enumvalueTypeSub
class templateparamlistTypeSub(supermod.templateparamlistType):
node_type = "templateparamlist"
def __init__(self, param=None):
supermod.templateparamlistType.__init__(self, param)
supermod.templateparamlistType.subclass = templateparamlistTypeSub
# end class templateparamlistTypeSub
class paramTypeSub(supermod.paramType):
node_type = "param"
def __init__(
self, type_=None, declname="", defname="", array="", defval=None, briefdescription=None
):
supermod.paramType.__init__(self, type_, declname, defname, array, defval, briefdescription)
supermod.paramType.subclass = paramTypeSub
# end class paramTypeSub
class linkedTextTypeSub(supermod.linkedTextType):
node_type = "linkedtext"
def __init__(self, ref=None, mixedclass_=None, content_=None):
supermod.linkedTextType.__init__(self, mixedclass_, content_)
supermod.linkedTextType.subclass = linkedTextTypeSub
# end class linkedTextTypeSub
class graphTypeSub(supermod.graphType):
node_type = "graph"
def __init__(self, node=None, direction="forward", caption=""):
supermod.graphType.__init__(self, node, direction, caption)
supermod.graphType.subclass = graphTypeSub
# end class graphTypeSub
class nodeTypeSub(supermod.nodeType):
node_type = "node"
def __init__(self, id=None, label="", link=None, childnode=None):
supermod.nodeType.__init__(self, id, label, link, childnode)
supermod.nodeType.subclass = nodeTypeSub
# end class nodeTypeSub
class childnodeTypeSub(supermod.childnodeType):
node_type = "childnode"
def __init__(self, relation=None, refid=None, edgelabel=None):
supermod.childnodeType.__init__(self, relation, refid, edgelabel)
supermod.childnodeType.subclass = childnodeTypeSub
# end class childnodeTypeSub
class linkTypeSub(supermod.linkType):
node_type = "link"
def __init__(self, refid=None, external=None, valueOf_=""):
supermod.linkType.__init__(self, refid, external)
supermod.linkType.subclass = linkTypeSub
# end class linkTypeSub
class listingTypeSub(supermod.listingType):
node_type = "listing"
def __init__(self, codeline=None, domain=None):
supermod.listingType.__init__(self, codeline, domain)
supermod.listingType.subclass = listingTypeSub
# end class listingTypeSub
class codelineTypeSub(supermod.codelineType):
node_type = "codeline"
def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None):
supermod.codelineType.__init__(self, external, lineno, refkind, refid, highlight)
supermod.codelineType.subclass = codelineTypeSub
# end class codelineTypeSub
class highlightTypeSub(supermod.highlightType):
node_type = "highlight"
def __init__(self, class_=None, sp=None, ref=None, mixedclass_=None, content_=None):
supermod.highlightType.__init__(self, mixedclass_, content_)
supermod.highlightType.subclass = highlightTypeSub
# end class highlightTypeSub
class referenceTypeSub(supermod.referenceType):
node_type = "reference"
def __init__(
self,
endline=None,
startline=None,
refid=None,
compoundref=None,
valueOf_="",
mixedclass_=None,
content_=None,
):
supermod.referenceType.__init__(self, mixedclass_, content_)
supermod.referenceType.subclass = referenceTypeSub
# end class referenceTypeSub
class locationTypeSub(supermod.locationType):
node_type = "location"
def __init__(
self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_=""
):
supermod.locationType.__init__(self, bodystart, line, bodyend, bodyfile, file)
supermod.locationType.subclass = locationTypeSub
# end class locationTypeSub
class docSect1TypeSub(supermod.docSect1Type):
node_type = "docsect1"
def __init__(
self,
id=None,
title="",
para=None,
sect2=None,
internal=None,
mixedclass_=None,
content_=None,
):
supermod.docSect1Type.__init__(self, mixedclass_, content_)
supermod.docSect1Type.subclass = docSect1TypeSub
# end class docSect1TypeSub
class docSect2TypeSub(supermod.docSect2Type):
node_type = "docsect2"
def __init__(
self,
id=None,
title="",
para=None,
sect3=None,
internal=None,
mixedclass_=None,
content_=None,
):
supermod.docSect2Type.__init__(self, mixedclass_, content_)
supermod.docSect2Type.subclass = docSect2TypeSub
# end class docSect2TypeSub
class docSect3TypeSub(supermod.docSect3Type):
node_type = "docsect3"
def __init__(
self,
id=None,
title="",
para=None,
sect4=None,
internal=None,
mixedclass_=None,
content_=None,
):
supermod.docSect3Type.__init__(self, mixedclass_, content_)
supermod.docSect3Type.subclass = docSect3TypeSub
# end class docSect3TypeSub
class docSect4TypeSub(supermod.docSect4Type):
node_type = "docsect4"
def __init__(
self, id=None, title="", para=None, internal=None, mixedclass_=None, content_=None
):
supermod.docSect4Type.__init__(self, mixedclass_, content_)
supermod.docSect4Type.subclass = docSect4TypeSub
# end class docSect4TypeSub
class docInternalTypeSub(supermod.docInternalType):
node_type = "docinternal"
def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None):
supermod.docInternalType.__init__(self, mixedclass_, content_)
supermod.docInternalType.subclass = docInternalTypeSub
# end class docInternalTypeSub
class docInternalS1TypeSub(supermod.docInternalS1Type):
node_type = "docinternals1"
def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None):
supermod.docInternalS1Type.__init__(self, mixedclass_, content_)
supermod.docInternalS1Type.subclass = docInternalS1TypeSub
# end class docInternalS1TypeSub
class docInternalS2TypeSub(supermod.docInternalS2Type):
node_type = "docinternals2"
def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):
supermod.docInternalS2Type.__init__(self, mixedclass_, content_)
supermod.docInternalS2Type.subclass = docInternalS2TypeSub
# end class docInternalS2TypeSub
class docInternalS3TypeSub(supermod.docInternalS3Type):
node_type = "docinternals3"
def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):
supermod.docInternalS3Type.__init__(self, mixedclass_, content_)
supermod.docInternalS3Type.subclass = docInternalS3TypeSub
# end class docInternalS3TypeSub
class docInternalS4TypeSub(supermod.docInternalS4Type):
node_type = "docinternals4"
def __init__(self, para=None, mixedclass_=None, content_=None):
supermod.docInternalS4Type.__init__(self, mixedclass_, content_)
supermod.docInternalS4Type.subclass = docInternalS4TypeSub
# end class docInternalS4TypeSub
class docURLLinkSub(supermod.docURLLink):
node_type = "docurllink"
def __init__(self, url=None, valueOf_="", mixedclass_=None, content_=None):
supermod.docURLLink.__init__(self, mixedclass_, content_)
supermod.docURLLink.subclass = docURLLinkSub
# end class docURLLinkSub
class docAnchorTypeSub(supermod.docAnchorType):
node_type = "docanchor"
def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None):
supermod.docAnchorType.__init__(self, mixedclass_, content_)
supermod.docAnchorType.subclass = docAnchorTypeSub
# end class docAnchorTypeSub
class docFormulaTypeSub(supermod.docFormulaType):
node_type = "docformula"
def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None):
supermod.docFormulaType.__init__(self, mixedclass_, content_)
supermod.docFormulaType.subclass = docFormulaTypeSub
# end class docFormulaTypeSub
class docIndexEntryTypeSub(supermod.docIndexEntryType):
node_type = "docindexentry"
def __init__(self, primaryie="", secondaryie=""):
supermod.docIndexEntryType.__init__(self, primaryie, secondaryie)
supermod.docIndexEntryType.subclass = docIndexEntryTypeSub
# end class docIndexEntryTypeSub
class docListTypeSub(supermod.docListType):
node_type = "doclist"
def __init__(self, listitem=None, subtype=""):
self.node_subtype = "itemized"
if subtype != "":
self.node_subtype = subtype
supermod.docListType.__init__(self, listitem)
supermod.docListType.subclass = docListTypeSub
# end class docListTypeSub
class docListItemTypeSub(supermod.docListItemType):
node_type = "doclistitem"
def __init__(self, para=None):
supermod.docListItemType.__init__(self, para)
supermod.docListItemType.subclass = docListItemTypeSub
# end class docListItemTypeSub
class docSimpleSectTypeSub(supermod.docSimpleSectType):
node_type = "docsimplesect"
def __init__(self, kind=None, title=None, para=None):
supermod.docSimpleSectType.__init__(self, kind, title, para)
supermod.docSimpleSectType.subclass = docSimpleSectTypeSub
# end class docSimpleSectTypeSub
class docVarListEntryTypeSub(supermod.docVarListEntryType):
node_type = "docvarlistentry"
def __init__(self, term=None):
supermod.docVarListEntryType.__init__(self, term)
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "term":
obj_ = supermod.docTitleType.factory()
obj_.build(child_)
self.set_term(obj_)
supermod.docVarListEntryType.subclass = docVarListEntryTypeSub
# end class docVarListEntryTypeSub
class docRefTextTypeSub(supermod.docRefTextType):
node_type = "docreftext"
def __init__(
self, refid=None, kindref=None, external=None, valueOf_="", mixedclass_=None, content_=None
):
supermod.docRefTextType.__init__(self, mixedclass_, content_)
self.para = []
def buildChildren(self, child_, nodeName_):
supermod.docRefTextType.buildChildren(self, child_, nodeName_)
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
obj_ = supermod.docParaType.factory()
obj_.build(child_)
self.para.append(obj_)
supermod.docRefTextType.subclass = docRefTextTypeSub
# end class docRefTextTypeSub
class docTableTypeSub(supermod.docTableType):
node_type = "doctable"
def __init__(self, rows=None, cols=None, row=None, caption=None):
supermod.docTableType.__init__(self, rows, cols, row, caption)
supermod.docTableType.subclass = docTableTypeSub
# end class docTableTypeSub
class docRowTypeSub(supermod.docRowType):
node_type = "docrow"
def __init__(self, entry=None):
supermod.docRowType.__init__(self, entry)
supermod.docRowType.subclass = docRowTypeSub
# end class docRowTypeSub
class docEntryTypeSub(supermod.docEntryType):
node_type = "docentry"
def __init__(self, thead=None, align=None, rowspan=None, colspan=None, para=None):
supermod.docEntryType.__init__(self, thead, align, rowspan, colspan, para)
supermod.docEntryType.subclass = docEntryTypeSub
# end class docEntryTypeSub
class docHeadingTypeSub(supermod.docHeadingType):
node_type = "docheading"
def __init__(self, level=None, valueOf_="", mixedclass_=None, content_=None):
supermod.docHeadingType.__init__(self, mixedclass_, content_)
def buildChildren(self, child_, nodeName_):
supermod.docHeadingType.buildChildren(self, child_, nodeName_)
# Account for styled content in the heading. This might need to be expanded to include other
# nodes as it seems from the xsd that headings can have a lot of different children but we
# really don't expect most of them to come up.
if child_.nodeType == Node.ELEMENT_NODE and (
nodeName_ == "bold"
or nodeName_ == "emphasis"
or nodeName_ == "computeroutput"
or nodeName_ == "subscript"
or nodeName_ == "superscript"
or nodeName_ == "center"
or nodeName_ == "small"
):
obj_ = supermod.docMarkupType.factory()
obj_.build(child_)
obj_.type_ = nodeName_
self.content_.append(obj_)
supermod.docHeadingType.subclass = docHeadingTypeSub
# end class docHeadingTypeSub
class docImageTypeSub(supermod.docImageType):
node_type = "docimage"
def __init__(
self,
width=None,
type_=None,
name=None,
height=None,
valueOf_="",
mixedclass_=None,
content_=None,
):
supermod.docImageType.__init__(self, mixedclass_, content_)
supermod.docImageType.subclass = docImageTypeSub
# end class docImageTypeSub
class docDotFileTypeSub(supermod.docDotFileType):
node_type = "docdotfile"
def __init__(self, name=None, valueOf_="", mixedclass_=None, content_=None):
supermod.docDotFileType.__init__(self, mixedclass_, content_)
supermod.docDotFileType.subclass = docDotFileTypeSub
# end class docDotFileTypeSub
class docDotTypeSub(supermod.docDotType):
node_type = "docdot"
def __init__(self, name=None, valueOf_="", mixedclass_=None, content_=None):
supermod.docDotType.__init__(self, mixedclass_, content_)
supermod.docDotType.subclass = docDotTypeSub
# end class docDotTypeSub
class docTocItemTypeSub(supermod.docTocItemType):
node_type = "doctocitem"
def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None):
supermod.docTocItemType.__init__(self, mixedclass_, content_)
supermod.docTocItemType.subclass = docTocItemTypeSub
# end class docTocItemTypeSub
class docTocListTypeSub(supermod.docTocListType):
node_type = "doctoclist"
def __init__(self, tocitem=None):
supermod.docTocListType.__init__(self, tocitem)
supermod.docTocListType.subclass = docTocListTypeSub
# end class docTocListTypeSub
class docLanguageTypeSub(supermod.docLanguageType):
node_type = "doclanguage"
def __init__(self, langid=None, para=None):
supermod.docLanguageType.__init__(self, langid, para)
supermod.docLanguageType.subclass = docLanguageTypeSub
# end class docLanguageTypeSub
class docParamListTypeSub(supermod.docParamListType):
node_type = "docparamlist"
def __init__(self, kind=None, parameteritem=None):
supermod.docParamListType.__init__(self, kind, parameteritem)
supermod.docParamListType.subclass = docParamListTypeSub
# end class docParamListTypeSub
class docParamListItemSub(supermod.docParamListItem):
node_type = "docparamlistitem"
def __init__(self, parameternamelist=None, parameterdescription=None):
supermod.docParamListItem.__init__(self, parameternamelist, parameterdescription)
supermod.docParamListItem.subclass = docParamListItemSub
# end class docParamListItemSub
class docParamNameListSub(supermod.docParamNameList):
node_type = "docparamnamelist"
def __init__(self, parametername=None):
supermod.docParamNameList.__init__(self, parametername)
supermod.docParamNameList.subclass = docParamNameListSub
# end class docParamNameListSub
class docParamNameSub(supermod.docParamName):
node_type = "docparamname"
def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None):
supermod.docParamName.__init__(self, mixedclass_, content_)
supermod.docParamName.subclass = docParamNameSub
# end class docParamNameSub
class docXRefSectTypeSub(supermod.docXRefSectType):
node_type = "docxrefsect"
def __init__(self, id=None, xreftitle=None, xrefdescription=None):
supermod.docXRefSectType.__init__(self, id, xreftitle, xrefdescription)
supermod.docXRefSectType.subclass = docXRefSectTypeSub
# end class docXRefSectTypeSub
class docVariableListTypeSub(supermod.docVariableListType):
node_type = "docvariablelist"
def __init__(self, valueOf_=""):
supermod.docVariableListType.__init__(self, valueOf_)
self.varlistentries = []
self.listitems = []
def buildChildren(self, child_, nodeName_):
supermod.docVariableListType.buildChildren(self, child_, nodeName_)
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "varlistentry":
obj_ = supermod.docVarListEntryType.factory()
obj_.build(child_)
self.varlistentries.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "listitem":
obj_ = supermod.docListItemType.factory()
obj_.build(child_)
self.listitems.append(obj_)
supermod.docVariableListType.subclass = docVariableListTypeSub
# end class docVariableListTypeSub
class docCopyTypeSub(supermod.docCopyType):
node_type = "doccopy"
def __init__(self, link=None, para=None, sect1=None, internal=None):
supermod.docCopyType.__init__(self, link, para, sect1, internal)
supermod.docCopyType.subclass = docCopyTypeSub
# end class docCopyTypeSub
class docCharTypeSub(supermod.docCharType):
node_type = "docchar"
def __init__(self, char=None, valueOf_=""):
supermod.docCharType.__init__(self, char)
supermod.docCharType.subclass = docCharTypeSub
# end class docCharTypeSub
class verbatimTypeSub:
"""
New node type. Structure is largely pillaged from other nodes in order to
match the set.
"""
node_type = "verbatim"
def __init__(self, valueOf_="", mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
self.text = ""
def factory(*args, **kwargs):
return verbatimTypeSub(*args, **kwargs)
factory = staticmethod(factory)
def buildAttributes(self, attrs):
pass
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.text += child_.nodeValue
class docBlockQuoteTypeSub(supermod.docBlockQuoteType):
node_type = "docblockquote"
def __init__(self, para=None):
supermod.docBlockQuoteType.__init__(self, para)
def buildChildren(self, child_, nodeName_):
supermod.docBlockQuoteType.buildChildren(self, child_, nodeName_)
supermod.docBlockQuoteType.subclass = docBlockQuoteTypeSub
# end class docBlockQuoteTypeSub
class docParaTypeSub(supermod.docParaType):
node_type = "docpara"
def __init__(self, char=None, valueOf_=""):
supermod.docParaType.__init__(self, char)
self.parameterlist = []
self.simplesects = []
self.content = []
self.programlisting = []
self.images = []
self.ordered_children = []
def buildChildren(self, child_, nodeName_):
supermod.docParaType.buildChildren(self, child_, nodeName_)
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref":
obj_ = supermod.docRefTextType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parameterlist":
obj_ = supermod.docParamListType.factory()
obj_.build(child_)
self.parameterlist.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "simplesect":
obj_ = supermod.docSimpleSectType.factory()
obj_.build(child_)
self.simplesects.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "programlisting":
obj_ = supermod.listingType.factory()
obj_.build(child_)
# Add programlisting nodes to self.content rather than self.programlisting,
# because programlisting and content nodes can interleave as shown in
# https://www.stack.nl/~dimitri/doxygen/manual/examples/include/html/example.html.
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "image":
obj_ = supermod.docImageType.factory()
obj_.build(child_)
self.images.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and (
nodeName_ == "bold"
or nodeName_ == "emphasis"
or nodeName_ == "computeroutput"
or nodeName_ == "subscript"
or nodeName_ == "superscript"
or nodeName_ == "center"
or nodeName_ == "small"
):
obj_ = supermod.docMarkupType.factory()
obj_.build(child_)
obj_.type_ = nodeName_
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "verbatim":
childobj_ = verbatimTypeSub.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "verbatim", childobj_
)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "formula":
childobj_ = docFormulaTypeSub.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "formula", childobj_
)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "itemizedlist":
obj_ = supermod.docListType.factory(subtype="itemized")
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "orderedlist":
obj_ = supermod.docListType.factory(subtype="ordered")
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "heading":
obj_ = supermod.docHeadingType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ulink":
obj_ = supermod.docURLLink.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "xrefsect":
obj_ = supermod.docXRefSectType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "variablelist":
obj_ = supermod.docVariableListType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "anchor":
obj_ = supermod.docAnchorType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parblock":
obj_ = supermod.docParBlockType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "blockquote":
obj_ = supermod.docBlockQuoteType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "table":
obj_ = supermod.docTableType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "dotfile":
obj_ = supermod.docDotFileType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "dot":
obj_ = supermod.docDotType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and (
nodeName_ == "ndash" or nodeName_ == "mdash"
):
# inject a emphasized dash unicode char as a placeholder/flag for rendering
# later. See visit_docblockquote()
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeText, "", "—"
)
self.content.append(obj_)
else:
obj_ = None
if obj_:
self.ordered_children.append(obj_)
supermod.docParaType.subclass = docParaTypeSub
# end class docParaTypeSub
class docParBlockTypeSub(supermod.docParBlockType):
node_type = "docparblock"
def __init__(self, para=None):
supermod.docParBlockType.__init__(self, para)
def buildChildren(self, child_, nodeName_):
supermod.docParBlockType.buildChildren(self, child_, nodeName_)
supermod.docParBlockType.subclass = docParBlockTypeSub
# end class docParBlockTypeSub
class docMarkupTypeSub(supermod.docMarkupType):
node_type = "docmarkup"
def __init__(self, valueOf_="", mixedclass_=None, content_=None):
supermod.docMarkupType.__init__(self, valueOf_, mixedclass_, content_)
self.type_ = None
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref":
childobj_ = supermod.docRefTextType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "ref", childobj_
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
supermod.docMarkupType.subclass = docMarkupTypeSub
# end class docMarkupTypeSub
class docTitleTypeSub(supermod.docTitleType):
node_type = "doctitle"
def __init__(self, valueOf_="", mixedclass_=None, content_=None):
supermod.docTitleType.__init__(self, valueOf_, mixedclass_, content_)
self.type_ = None
def buildChildren(self, child_, nodeName_):
supermod.docTitleType.buildChildren(self, child_, nodeName_)
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref":
obj_ = supermod.docRefTextType.factory()
obj_.build(child_)
self.content_.append(obj_)
self.valueOf_ += obj_.valueOf_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "anchor":
obj_ = supermod.docAnchorType.factory()
obj_.build(child_)
self.content_.append(obj_)
supermod.docTitleType.subclass = docTitleTypeSub
# end class docTitleTypeSub
class ParseError(Exception):
pass
class FileIOError(Exception):
pass
def parse(inFilename):
try:
doc = minidom.parse(str(inFilename))
except OSError as e:
raise FileIOError(e)
except ExpatError as e:
raise ParseError(e)
rootNode = doc.documentElement
rootObj = supermod.DoxygenType.factory()
rootObj.build(rootNode)
return rootObj
breathe-doc-breathe-10a36f3/breathe/parser/compoundsuper.py 0000664 0000000 0000000 00001002103 14756414247 0024022 0 ustar 00root root 0000000 0000000 #
# Generated Thu Jun 11 18:44:25 2009 by generateDS.py.
#
from __future__ import annotations
import sys
from xml.dom import Node, minidom
from breathe import filetypes
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
# in a module named generatedssuper.py.
try:
from generatedssuper import GeneratedsSuper
except ImportError:
class GeneratedsSuper:
def format_string(self, input_data, input_name=""):
return input_data
def format_integer(self, input_data, input_name=""):
return "%d" % input_data
def format_float(self, input_data, input_name=""):
return "%f" % input_data
def format_double(self, input_data, input_name=""):
return "%e" % input_data
def format_boolean(self, input_data, input_name=""):
return "%s" % input_data
#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from https://ipython.org/.
#
## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
## banner = 'Dropping into IPython',
## exit_msg = 'Leaving Interpreter, back to program.')
# Then use the following line where and when you want to drop into the
# IPython shell:
# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit')
#
# Globals
#
ExternalEncoding = "ascii"
#
# Support/utility functions.
#
def showIndent(outfile, level):
for idx in range(level):
outfile.write(" ")
def quote_xml(inStr):
s1 = isinstance(inStr, str) and inStr or "%s" % inStr
s1 = s1.replace("&", "&")
s1 = s1.replace("<", "<")
s1 = s1.replace(">", ">")
return s1
def quote_attrib(inStr):
s1 = isinstance(inStr, str) and inStr or "%s" % inStr
s1 = s1.replace("&", "&")
s1 = s1.replace("<", "<")
s1 = s1.replace(">", ">")
if '"' in s1:
if "'" in s1:
s1 = '"%s"' % s1.replace('"', """)
else:
s1 = "'%s'" % s1
else:
s1 = '"%s"' % s1
return s1
def quote_python(inStr):
s1 = inStr
if s1.find("'") == -1:
if s1.find("\n") == -1:
return "'%s'" % s1
else:
return "'''%s'''" % s1
else:
if s1.find('"') != -1:
s1 = s1.replace('"', '\\"')
if s1.find("\n") == -1:
return '"%s"' % s1
else:
return '"""%s"""' % s1
class MixedContainer:
node_type = "mixedcontainer"
# Constants for category:
CategoryNone = 0
CategoryText = 1
CategorySimple = 2
CategoryComplex = 3
# Constants for content_type:
TypeNone = 0
TypeText = 1
TypeString = 2
TypeInteger = 3
TypeFloat = 4
TypeDecimal = 5
TypeDouble = 6
TypeBoolean = 7
def __init__(self, category, content_type, name, value):
self.category = category
self.content_type = content_type
self.name = name
self.value = value
def getCategory(self):
return self.category
def getContenttype(self, content_type):
return self.content_type
def getValue(self):
return self.value
def getName(self):
return self.name
class _MemberSpec:
def __init__(self, name="", data_type="", container=0):
self.name = name
self.data_type = data_type
self.container = container
def set_name(self, name):
self.name = name
def get_name(self):
return self.name
def set_data_type(self, data_type):
self.data_type = data_type
def get_data_type(self):
return self.data_type
def set_container(self, container):
self.container = container
def get_container(self):
return self.container
#
# Data representation classes.
#
class DoxygenType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, version=None, compounddef=None):
self.version = version
self.compounddef = compounddef
def factory(*args_, **kwargs_):
if DoxygenType.subclass:
return DoxygenType.subclass(*args_, **kwargs_)
else:
return DoxygenType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_compounddef(self):
return self.compounddef
def set_compounddef(self, compounddef):
self.compounddef = compounddef
def get_version(self):
return self.version
def set_version(self, version):
self.version = version
def hasContent_(self):
if self.compounddef is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("version"):
self.version = attrs.get("version").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "compounddef":
obj_ = compounddefType.factory()
obj_.build(child_)
self.set_compounddef(obj_)
# end class DoxygenType
class compounddefType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self,
kind=None,
prot=None,
id=None,
compoundname=None,
title=None,
basecompoundref=None,
derivedcompoundref=None,
includes=None,
includedby=None,
incdepgraph=None,
invincdepgraph=None,
innerdir=None,
innerfile=None,
innerclass=None,
innernamespace=None,
innerpage=None,
innergroup=None,
templateparamlist=None,
sectiondef=None,
briefdescription=None,
detaileddescription=None,
inheritancegraph=None,
collaborationgraph=None,
programlisting=None,
location=None,
listofallmembers=None,
language=None,
):
self.kind = kind
self.prot = prot
self.id = id
self.language = language
self.compoundname = compoundname
self.title = title
if basecompoundref is None:
self.basecompoundref = []
else:
self.basecompoundref = basecompoundref
if derivedcompoundref is None:
self.derivedcompoundref = []
else:
self.derivedcompoundref = derivedcompoundref
if includes is None:
self.includes = []
else:
self.includes = includes
if includedby is None:
self.includedby = []
else:
self.includedby = includedby
self.incdepgraph = incdepgraph
self.invincdepgraph = invincdepgraph
if innerdir is None:
self.innerdir = []
else:
self.innerdir = innerdir
if innerfile is None:
self.innerfile = []
else:
self.innerfile = innerfile
if innerclass is None:
self.innerclass = []
else:
self.innerclass = innerclass
if innernamespace is None:
self.innernamespace = []
else:
self.innernamespace = innernamespace
if innerpage is None:
self.innerpage = []
else:
self.innerpage = innerpage
if innergroup is None:
self.innergroup = []
else:
self.innergroup = innergroup
self.templateparamlist = templateparamlist
if sectiondef is None:
self.sectiondef = []
else:
self.sectiondef = sectiondef
self.briefdescription = briefdescription
self.detaileddescription = detaileddescription
self.inheritancegraph = inheritancegraph
self.collaborationgraph = collaborationgraph
self.programlisting = programlisting
self.location = location
self.listofallmembers = listofallmembers
self.namespaces = []
def factory(*args_, **kwargs_):
if compounddefType.subclass:
return compounddefType.subclass(*args_, **kwargs_)
else:
return compounddefType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_compoundname(self):
return self.compoundname
def set_compoundname(self, compoundname):
self.compoundname = compoundname
def get_title(self):
return self.title
def set_title(self, title):
self.title = title
def get_basecompoundref(self):
return self.basecompoundref
def set_basecompoundref(self, basecompoundref):
self.basecompoundref = basecompoundref
def add_basecompoundref(self, value):
self.basecompoundref.append(value)
def insert_basecompoundref(self, index, value):
self.basecompoundref[index] = value
def get_derivedcompoundref(self):
return self.derivedcompoundref
def set_derivedcompoundref(self, derivedcompoundref):
self.derivedcompoundref = derivedcompoundref
def add_derivedcompoundref(self, value):
self.derivedcompoundref.append(value)
def insert_derivedcompoundref(self, index, value):
self.derivedcompoundref[index] = value
def get_includes(self):
return self.includes
def set_includes(self, includes):
self.includes = includes
def add_includes(self, value):
self.includes.append(value)
def insert_includes(self, index, value):
self.includes[index] = value
def get_includedby(self):
return self.includedby
def set_includedby(self, includedby):
self.includedby = includedby
def add_includedby(self, value):
self.includedby.append(value)
def insert_includedby(self, index, value):
self.includedby[index] = value
def get_incdepgraph(self):
return self.incdepgraph
def set_incdepgraph(self, incdepgraph):
self.incdepgraph = incdepgraph
def get_invincdepgraph(self):
return self.invincdepgraph
def set_invincdepgraph(self, invincdepgraph):
self.invincdepgraph = invincdepgraph
def get_innerdir(self):
return self.innerdir
def set_innerdir(self, innerdir):
self.innerdir = innerdir
def add_innerdir(self, value):
self.innerdir.append(value)
def insert_innerdir(self, index, value):
self.innerdir[index] = value
def get_innerfile(self):
return self.innerfile
def set_innerfile(self, innerfile):
self.innerfile = innerfile
def add_innerfile(self, value):
self.innerfile.append(value)
def insert_innerfile(self, index, value):
self.innerfile[index] = value
def get_innerclass(self):
return self.innerclass
def set_innerclass(self, innerclass):
self.innerclass = innerclass
def add_innerclass(self, value):
self.innerclass.append(value)
def insert_innerclass(self, index, value):
self.innerclass[index] = value
def get_innernamespace(self):
return self.innernamespace
def set_innernamespace(self, innernamespace):
self.innernamespace = innernamespace
def add_innernamespace(self, value):
self.innernamespace.append(value)
def insert_innernamespace(self, index, value):
self.innernamespace[index] = value
def get_innerpage(self):
return self.innerpage
def set_innerpage(self, innerpage):
self.innerpage = innerpage
def add_innerpage(self, value):
self.innerpage.append(value)
def insert_innerpage(self, index, value):
self.innerpage[index] = value
def get_innergroup(self):
return self.innergroup
def set_innergroup(self, innergroup):
self.innergroup = innergroup
def add_innergroup(self, value):
self.innergroup.append(value)
def insert_innergroup(self, index, value):
self.innergroup[index] = value
def get_templateparamlist(self):
return self.templateparamlist
def set_templateparamlist(self, templateparamlist):
self.templateparamlist = templateparamlist
def get_sectiondef(self):
return self.sectiondef
def set_sectiondef(self, sectiondef):
self.sectiondef = sectiondef
def add_sectiondef(self, value):
self.sectiondef.append(value)
def insert_sectiondef(self, index, value):
self.sectiondef[index] = value
def get_briefdescription(self):
return self.briefdescription
def set_briefdescription(self, briefdescription):
self.briefdescription = briefdescription
def get_detaileddescription(self):
return self.detaileddescription
def set_detaileddescription(self, detaileddescription):
self.detaileddescription = detaileddescription
def get_inheritancegraph(self):
return self.inheritancegraph
def set_inheritancegraph(self, inheritancegraph):
self.inheritancegraph = inheritancegraph
def get_collaborationgraph(self):
return self.collaborationgraph
def set_collaborationgraph(self, collaborationgraph):
self.collaborationgraph = collaborationgraph
def get_programlisting(self):
return self.programlisting
def set_programlisting(self, programlisting):
self.programlisting = programlisting
def get_location(self):
return self.location
def set_location(self, location):
self.location = location
def get_listofallmembers(self):
return self.listofallmembers
def set_listofallmembers(self, listofallmembers):
self.listofallmembers = listofallmembers
def get_kind(self):
return self.kind
def set_kind(self, kind):
self.kind = kind
def get_prot(self):
return self.prot
def set_prot(self, prot):
self.prot = prot
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def hasContent_(self):
if (
self.compoundname is not None
or self.title is not None
or self.basecompoundref is not None
or self.derivedcompoundref is not None
or self.includes is not None
or self.includedby is not None
or self.incdepgraph is not None
or self.invincdepgraph is not None
or self.innerdir is not None
or self.innerfile is not None
or self.innerclass is not None
or self.innernamespace is not None
or self.innerpage is not None
or self.innergroup is not None
or self.templateparamlist is not None
or self.sectiondef is not None
or self.briefdescription is not None
or self.detaileddescription is not None
or self.inheritancegraph is not None
or self.collaborationgraph is not None
or self.programlisting is not None
or self.location is not None
or self.listofallmembers is not None
):
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("kind"):
self.kind = attrs.get("kind").value
if attrs.get("prot"):
self.prot = attrs.get("prot").value
if attrs.get("id"):
self.id = attrs.get("id").value
if attrs.get("language"):
self.language = attrs.get("language").value.lower()
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "compoundname":
compoundname_ = ""
for text__content_ in child_.childNodes:
compoundname_ += text__content_.nodeValue
self.compoundname = compoundname_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title":
obj_ = docTitleType.factory()
obj_.build(child_)
self.set_title(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "basecompoundref":
obj_ = compoundRefType.factory()
obj_.build(child_)
self.basecompoundref.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "derivedcompoundref":
obj_ = compoundRefType.factory()
obj_.build(child_)
self.derivedcompoundref.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "includes":
obj_ = incType.factory()
obj_.build(child_)
self.includes.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "includedby":
obj_ = incType.factory()
obj_.build(child_)
self.includedby.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "incdepgraph":
obj_ = graphType.factory(
caption=f"Include dependency graph for {self.get_compoundname()}:"
)
obj_.build(child_)
self.set_incdepgraph(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "invincdepgraph":
obj_ = graphType.factory(
direction="back",
caption=f"This graph shows which files directly "
f"or indirectly include {self.get_compoundname()}:",
)
obj_.build(child_)
self.set_invincdepgraph(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innerdir":
obj_ = refType.factory(nodeName_)
obj_.build(child_)
self.innerdir.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innerfile":
obj_ = refType.factory(nodeName_)
obj_.build(child_)
self.innerfile.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innerclass":
obj_ = refType.factory(nodeName_)
obj_.build(child_)
self.innerclass.append(obj_)
self.namespaces.append(obj_.content_[0].getValue())
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innernamespace":
obj_ = refType.factory(nodeName_)
obj_.build(child_)
self.innernamespace.append(obj_)
self.namespaces.append(obj_.content_[0].getValue())
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innerpage":
obj_ = refType.factory(nodeName_)
obj_.build(child_)
self.innerpage.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innergroup":
obj_ = refType.factory(nodeName_)
obj_.build(child_)
self.innergroup.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "templateparamlist":
obj_ = templateparamlistType.factory()
obj_.build(child_)
self.set_templateparamlist(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sectiondef":
obj_ = sectiondefType.factory()
obj_.build(child_)
self.sectiondef.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "briefdescription":
obj_ = descriptionType.factory()
obj_.build(child_)
self.set_briefdescription(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "detaileddescription":
obj_ = descriptionType.factory()
obj_.build(child_)
self.set_detaileddescription(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "inheritancegraph":
obj_ = graphType.factory(caption=f"Inheritance diagram for {self.get_compoundname()}:")
obj_.build(child_)
self.set_inheritancegraph(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "collaborationgraph":
obj_ = graphType.factory(
caption=f"Collaboration diagram for {self.get_compoundname()}:"
)
obj_.build(child_)
self.set_collaborationgraph(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "programlisting":
obj_ = listingType.factory(domain=self.language)
obj_.build(child_)
self.set_programlisting(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "location":
obj_ = locationType.factory()
obj_.build(child_)
self.set_location(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "listofallmembers":
obj_ = listofallmembersType.factory()
obj_.build(child_)
self.set_listofallmembers(obj_)
# end class compounddefType
class listofallmembersType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, member=None):
if member is None:
self.member = []
else:
self.member = member
def factory(*args_, **kwargs_):
if listofallmembersType.subclass:
return listofallmembersType.subclass(*args_, **kwargs_)
else:
return listofallmembersType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_member(self):
return self.member
def set_member(self, member):
self.member = member
def add_member(self, value):
self.member.append(value)
def insert_member(self, index, value):
self.member[index] = value
def hasContent_(self):
if self.member is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "member":
obj_ = memberRefType.factory()
obj_.build(child_)
self.member.append(obj_)
# end class listofallmembersType
class memberRefType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self, virt=None, prot=None, refid=None, ambiguityscope=None, scope=None, name=None
):
self.virt = virt
self.prot = prot
self.refid = refid
self.ambiguityscope = ambiguityscope
self.scope = scope
self.name = name
def factory(*args_, **kwargs_):
if memberRefType.subclass:
return memberRefType.subclass(*args_, **kwargs_)
else:
return memberRefType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_scope(self):
return self.scope
def set_scope(self, scope):
self.scope = scope
def get_name(self):
return self.name
def set_name(self, name):
self.name = name
def get_virt(self):
return self.virt
def set_virt(self, virt):
self.virt = virt
def get_prot(self):
return self.prot
def set_prot(self, prot):
self.prot = prot
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def get_ambiguityscope(self):
return self.ambiguityscope
def set_ambiguityscope(self, ambiguityscope):
self.ambiguityscope = ambiguityscope
def hasContent_(self):
if self.scope is not None or self.name is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("virt"):
self.virt = attrs.get("virt").value
if attrs.get("prot"):
self.prot = attrs.get("prot").value
if attrs.get("refid"):
self.refid = attrs.get("refid").value
if attrs.get("ambiguityscope"):
self.ambiguityscope = attrs.get("ambiguityscope").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "scope":
scope_ = ""
for text__content_ in child_.childNodes:
scope_ += text__content_.nodeValue
self.scope = scope_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name":
name_ = ""
for text__content_ in child_.childNodes:
name_ += text__content_.nodeValue
self.name = name_
# end class memberRefType
class scope(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if scope.subclass:
return scope.subclass(*args_, **kwargs_)
else:
return scope(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class scope
class name(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if name.subclass:
return name.subclass(*args_, **kwargs_)
else:
return name(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class name
class compoundRefType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self, virt=None, prot=None, refid=None, valueOf_="", mixedclass_=None, content_=None
):
self.virt = virt
self.prot = prot
self.refid = refid
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if compoundRefType.subclass:
return compoundRefType.subclass(*args_, **kwargs_)
else:
return compoundRefType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_virt(self):
return self.virt
def set_virt(self, virt):
self.virt = virt
def get_prot(self):
return self.prot
def set_prot(self, prot):
self.prot = prot
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("virt"):
self.virt = attrs.get("virt").value
if attrs.get("prot"):
self.prot = attrs.get("prot").value
if attrs.get("refid"):
self.refid = attrs.get("refid").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class compoundRefType
class reimplementType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, refid=None, valueOf_="", mixedclass_=None, content_=None):
self.refid = refid
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if reimplementType.subclass:
return reimplementType.subclass(*args_, **kwargs_)
else:
return reimplementType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("refid"):
self.refid = attrs.get("refid").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class reimplementType
class incType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, local=None, refid=None, valueOf_="", mixedclass_=None, content_=None):
self.local = local
self.refid = refid
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if incType.subclass:
return incType.subclass(*args_, **kwargs_)
else:
return incType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_local(self):
return self.local
def set_local(self, local):
self.local = local
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("local"):
self.local = attrs.get("local").value
if attrs.get("refid"):
self.refid = attrs.get("refid").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class incType
class refType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, prot=None, refid=None, valueOf_="", mixedclass_=None, content_=None):
self.prot = prot
self.refid = refid
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if refType.subclass:
return refType.subclass(*args_, **kwargs_)
else:
return refType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_prot(self):
return self.prot
def set_prot(self, prot):
self.prot = prot
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("prot"):
self.prot = attrs.get("prot").value
if attrs.get("refid"):
self.refid = attrs.get("refid").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class refType
class refTextType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self, refid=None, kindref=None, external=None, valueOf_="", mixedclass_=None, content_=None
):
self.refid = refid
self.kindref = kindref
self.external = external
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if refTextType.subclass:
return refTextType.subclass(*args_, **kwargs_)
else:
return refTextType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def get_kindref(self):
return self.kindref
def set_kindref(self, kindref):
self.kindref = kindref
def get_external(self):
return self.external
def set_external(self, external):
self.external = external
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("refid"):
self.refid = attrs.get("refid").value
if attrs.get("kindref"):
self.kindref = attrs.get("kindref").value
if attrs.get("external"):
self.external = attrs.get("external").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class refTextType
class sectiondefType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, kind=None, header=None, description=None, memberdef=None):
self.kind = kind
self.header = header
self.description = description
if memberdef is None:
self.memberdef = []
else:
self.memberdef = memberdef
def factory(*args_, **kwargs_):
if sectiondefType.subclass:
return sectiondefType.subclass(*args_, **kwargs_)
else:
return sectiondefType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_header(self):
return self.header
def set_header(self, header):
self.header = header
def get_description(self):
return self.description
def set_description(self, description):
self.description = description
def get_memberdef(self):
return self.memberdef
def set_memberdef(self, memberdef):
self.memberdef = memberdef
def add_memberdef(self, value):
self.memberdef.append(value)
def insert_memberdef(self, index, value):
self.memberdef[index] = value
def get_kind(self):
return self.kind
def set_kind(self, kind):
self.kind = kind
def hasContent_(self):
if self.header is not None or self.description is not None or self.memberdef is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("kind"):
self.kind = attrs.get("kind").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "header":
header_ = ""
for text__content_ in child_.childNodes:
header_ += text__content_.nodeValue
self.header = header_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "description":
obj_ = descriptionType.factory()
obj_.build(child_)
self.set_description(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "memberdef":
obj_ = memberdefType.factory()
obj_.build(child_)
self.memberdef.append(obj_)
# end class sectiondefType
class memberdefType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self,
initonly=None,
kind=None,
volatile=None,
const=None,
raisexx=None,
virt=None,
readable=None,
prot=None,
explicit=None,
new=None,
final=None,
writable=None,
add=None,
static=None,
strong=None,
remove=None,
sealed=None,
mutable=None,
gettable=None,
inline=None,
settable=None,
id=None,
templateparamlist=None,
type_=None,
definition=None,
argsstring=None,
name=None,
read=None,
write=None,
bitfield=None,
reimplements=None,
reimplementedby=None,
param=None,
enumvalue=None,
initializer=None,
exceptions=None,
briefdescription=None,
detaileddescription=None,
inbodydescription=None,
location=None,
references=None,
referencedby=None,
refqual=None,
):
self.initonly = initonly
self.kind = kind
self.volatile = volatile
self.const = const
self.raisexx = raisexx
self.virt = virt
self.readable = readable
self.prot = prot
self.explicit = explicit
self.new = new
self.final = final
self.writable = writable
self.add = add
self.static = static
self.strong = strong
self.remove = remove
self.sealed = sealed
self.mutable = mutable
self.gettable = gettable
self.inline = inline
self.settable = settable
self.id = id
self.templateparamlist = templateparamlist
self.type_ = type_
self.definition = definition
self.argsstring = argsstring
self.name = name
self.read = read
self.write = write
self.bitfield = bitfield
if reimplements is None:
self.reimplements = []
else:
self.reimplements = reimplements
if reimplementedby is None:
self.reimplementedby = []
else:
self.reimplementedby = reimplementedby
if param is None:
self.param = []
else:
self.param = param
if enumvalue is None:
self.enumvalue = []
else:
self.enumvalue = enumvalue
self.initializer = initializer
self.exceptions = exceptions
self.briefdescription = briefdescription
self.detaileddescription = detaileddescription
self.inbodydescription = inbodydescription
self.location = location
if references is None:
self.references = []
else:
self.references = references
if referencedby is None:
self.referencedby = []
else:
self.referencedby = referencedby
self.refqual = refqual
def factory(*args_, **kwargs_):
if memberdefType.subclass:
return memberdefType.subclass(*args_, **kwargs_)
else:
return memberdefType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_templateparamlist(self):
return self.templateparamlist
def set_templateparamlist(self, templateparamlist):
self.templateparamlist = templateparamlist
def get_type(self):
return self.type_
def set_type(self, type_):
self.type_ = type_
def get_definition(self):
return self.definition
def set_definition(self, definition):
self.definition = definition
def get_argsstring(self):
return self.argsstring
def set_argsstring(self, argsstring):
self.argsstring = argsstring
def get_name(self):
return self.name
def set_name(self, name):
self.name = name
def get_read(self):
return self.read
def set_read(self, read):
self.read = read
def get_write(self):
return self.write
def set_write(self, write):
self.write = write
def get_bitfield(self):
return self.bitfield
def set_bitfield(self, bitfield):
self.bitfield = bitfield
def get_reimplements(self):
return self.reimplements
def set_reimplements(self, reimplements):
self.reimplements = reimplements
def add_reimplements(self, value):
self.reimplements.append(value)
def insert_reimplements(self, index, value):
self.reimplements[index] = value
def get_reimplementedby(self):
return self.reimplementedby
def set_reimplementedby(self, reimplementedby):
self.reimplementedby = reimplementedby
def add_reimplementedby(self, value):
self.reimplementedby.append(value)
def insert_reimplementedby(self, index, value):
self.reimplementedby[index] = value
def get_param(self):
return self.param
def set_param(self, param):
self.param = param
def add_param(self, value):
self.param.append(value)
def insert_param(self, index, value):
self.param[index] = value
def get_enumvalue(self):
return self.enumvalue
def set_enumvalue(self, enumvalue):
self.enumvalue = enumvalue
def add_enumvalue(self, value):
self.enumvalue.append(value)
def insert_enumvalue(self, index, value):
self.enumvalue[index] = value
def get_initializer(self):
return self.initializer
def set_initializer(self, initializer):
self.initializer = initializer
def get_exceptions(self):
return self.exceptions
def set_exceptions(self, exceptions):
self.exceptions = exceptions
def get_briefdescription(self):
return self.briefdescription
def set_briefdescription(self, briefdescription):
self.briefdescription = briefdescription
def get_detaileddescription(self):
return self.detaileddescription
def set_detaileddescription(self, detaileddescription):
self.detaileddescription = detaileddescription
def get_inbodydescription(self):
return self.inbodydescription
def set_inbodydescription(self, inbodydescription):
self.inbodydescription = inbodydescription
def get_location(self):
return self.location
def set_location(self, location):
self.location = location
def get_references(self):
return self.references
def set_references(self, references):
self.references = references
def add_references(self, value):
self.references.append(value)
def insert_references(self, index, value):
self.references[index] = value
def get_referencedby(self):
return self.referencedby
def set_referencedby(self, referencedby):
self.referencedby = referencedby
def add_referencedby(self, value):
self.referencedby.append(value)
def insert_referencedby(self, index, value):
self.referencedby[index] = value
def get_initonly(self):
return self.initonly
def set_initonly(self, initonly):
self.initonly = initonly
def get_kind(self):
return self.kind
def set_kind(self, kind):
self.kind = kind
def get_volatile(self):
return self.volatile
def set_volatile(self, volatile):
self.volatile = volatile
def get_const(self):
return self.const
def set_const(self, const):
self.const = const
def get_raise(self):
return self.raisexx
def set_raise(self, raisexx):
self.raisexx = raisexx
def get_virt(self):
return self.virt
def set_virt(self, virt):
self.virt = virt
def get_readable(self):
return self.readable
def set_readable(self, readable):
self.readable = readable
def get_prot(self):
return self.prot
def set_prot(self, prot):
self.prot = prot
def get_explicit(self):
return self.explicit
def set_explicit(self, explicit):
self.explicit = explicit
def get_new(self):
return self.new
def set_new(self, new):
self.new = new
def get_final(self):
return self.final
def set_final(self, final):
self.final = final
def get_writable(self):
return self.writable
def set_writable(self, writable):
self.writable = writable
def get_add(self):
return self.add
def set_add(self, add):
self.add = add
def get_static(self):
return self.static
def set_static(self, static):
self.static = static
def get_strong(self):
return self.strong
def set_strong(self, strong):
self.strong = strong
def get_remove(self):
return self.remove
def set_remove(self, remove):
self.remove = remove
def get_sealed(self):
return self.sealed
def set_sealed(self, sealed):
self.sealed = sealed
def get_mutable(self):
return self.mutable
def set_mutable(self, mutable):
self.mutable = mutable
def get_gettable(self):
return self.gettable
def set_gettable(self, gettable):
self.gettable = gettable
def get_inline(self):
return self.inline
def set_inline(self, inline):
self.inline = inline
def get_settable(self):
return self.settable
def set_settable(self, settable):
self.settable = settable
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def get_refqual(self):
return self.refqual
def set_refqual(self, refqual):
self.refqual = refqual
def hasContent_(self):
if (
self.templateparamlist is not None
or self.type_ is not None
or self.definition is not None
or self.argsstring is not None
or self.name is not None
or self.read is not None
or self.write is not None
or self.bitfield is not None
or self.reimplements is not None
or self.reimplementedby is not None
or self.param is not None
or self.enumvalue is not None
or self.initializer is not None
or self.exceptions is not None
or self.briefdescription is not None
or self.detaileddescription is not None
or self.inbodydescription is not None
or self.location is not None
or self.references is not None
or self.referencedby is not None
):
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("initonly"):
self.initonly = attrs.get("initonly").value
if attrs.get("kind"):
self.kind = attrs.get("kind").value
if attrs.get("volatile"):
self.volatile = attrs.get("volatile").value
if attrs.get("const"):
self.const = attrs.get("const").value
if attrs.get("raise"):
self.raisexx = attrs.get("raise").value
if attrs.get("virt"):
self.virt = attrs.get("virt").value
if attrs.get("readable"):
self.readable = attrs.get("readable").value
if attrs.get("prot"):
self.prot = attrs.get("prot").value
if attrs.get("explicit"):
self.explicit = attrs.get("explicit").value
if attrs.get("new"):
self.new = attrs.get("new").value
if attrs.get("final"):
self.final = attrs.get("final").value
if attrs.get("writable"):
self.writable = attrs.get("writable").value
if attrs.get("add"):
self.add = attrs.get("add").value
if attrs.get("static"):
self.static = attrs.get("static").value
if attrs.get("strong"):
self.strong = attrs.get("strong").value
if attrs.get("remove"):
self.remove = attrs.get("remove").value
if attrs.get("sealed"):
self.sealed = attrs.get("sealed").value
if attrs.get("mutable"):
self.mutable = attrs.get("mutable").value
if attrs.get("gettable"):
self.gettable = attrs.get("gettable").value
if attrs.get("inline"):
self.inline = attrs.get("inline").value
if attrs.get("settable"):
self.settable = attrs.get("settable").value
if attrs.get("id"):
self.id = attrs.get("id").value
if attrs.get("refqual"):
self.refqual = attrs.get("refqual").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "templateparamlist":
obj_ = templateparamlistType.factory()
obj_.build(child_)
self.set_templateparamlist(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "type":
obj_ = linkedTextType.factory()
obj_.build(child_)
self.set_type(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "definition":
definition_ = ""
for text__content_ in child_.childNodes:
definition_ += text__content_.nodeValue
self.definition = definition_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "argsstring":
argsstring_ = ""
for text__content_ in child_.childNodes:
argsstring_ += text__content_.nodeValue
self.argsstring = argsstring_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name":
name_ = ""
for text__content_ in child_.childNodes:
name_ += text__content_.nodeValue
self.name = name_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "read":
read_ = ""
for text__content_ in child_.childNodes:
read_ += text__content_.nodeValue
self.read = read_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "write":
write_ = ""
for text__content_ in child_.childNodes:
write_ += text__content_.nodeValue
self.write = write_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "bitfield":
bitfield_ = ""
for text__content_ in child_.childNodes:
bitfield_ += text__content_.nodeValue
self.bitfield = bitfield_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "reimplements":
obj_ = reimplementType.factory()
obj_.build(child_)
self.reimplements.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "reimplementedby":
obj_ = reimplementType.factory()
obj_.build(child_)
self.reimplementedby.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "param":
obj_ = paramType.factory()
obj_.build(child_)
self.param.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "enumvalue":
obj_ = enumvalueType.factory()
obj_.build(child_)
self.enumvalue.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "initializer":
obj_ = linkedTextType.factory()
obj_.build(child_)
self.set_initializer(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "exceptions":
obj_ = linkedTextType.factory()
obj_.build(child_)
self.set_exceptions(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "briefdescription":
obj_ = descriptionType.factory()
obj_.build(child_)
self.set_briefdescription(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "detaileddescription":
obj_ = descriptionType.factory()
obj_.build(child_)
self.set_detaileddescription(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "inbodydescription":
obj_ = descriptionType.factory()
obj_.build(child_)
self.set_inbodydescription(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "location":
obj_ = locationType.factory()
obj_.build(child_)
self.set_location(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "references":
obj_ = referenceType.factory()
obj_.build(child_)
self.references.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "referencedby":
obj_ = referenceType.factory()
obj_.build(child_)
self.referencedby.append(obj_)
# end class memberdefType
class definition(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if definition.subclass:
return definition.subclass(*args_, **kwargs_)
else:
return definition(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class definition
class argsstring(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if argsstring.subclass:
return argsstring.subclass(*args_, **kwargs_)
else:
return argsstring(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="argsstring", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="argsstring")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class argsstring
class read(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if read.subclass:
return read.subclass(*args_, **kwargs_)
else:
return read(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class read
class write(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if write.subclass:
return write.subclass(*args_, **kwargs_)
else:
return write(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class write
class bitfield(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if bitfield.subclass:
return bitfield.subclass(*args_, **kwargs_)
else:
return bitfield(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class bitfield
class descriptionType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self, title=None, para=None, sect1=None, internal=None, mixedclass_=None, content_=None
):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if descriptionType.subclass:
return descriptionType.subclass(*args_, **kwargs_)
else:
return descriptionType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_title(self):
return self.title
def set_title(self, title):
self.title = title
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_sect1(self):
return self.sect1
def set_sect1(self, sect1):
self.sect1 = sect1
def add_sect1(self, value):
self.sect1.append(value)
def insert_sect1(self, index, value):
self.sect1[index] = value
def get_internal(self):
return self.internal
def set_internal(self, internal):
self.internal = internal
def hasContent_(self):
if (
self.title is not None
or self.para is not None
or self.sect1 is not None
or self.internal is not None
):
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title":
childobj_ = docTitleType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "title", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
childobj_ = docParaType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect1":
childobj_ = docSect1Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect1", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal":
childobj_ = docInternalType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "internal", childobj_
)
self.content_.append(obj_)
# end class descriptionType
class enumvalueType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self,
prot=None,
id=None,
name=None,
initializer=None,
briefdescription=None,
detaileddescription=None,
mixedclass_=None,
content_=None,
):
self.prot = prot
self.id = id
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if enumvalueType.subclass:
return enumvalueType.subclass(*args_, **kwargs_)
else:
return enumvalueType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_name(self):
return self.name
def set_name(self, name):
self.name = name
def get_initializer(self):
return self.initializer
def set_initializer(self, initializer):
self.initializer = initializer
def get_briefdescription(self):
return self.briefdescription
def set_briefdescription(self, briefdescription):
self.briefdescription = briefdescription
def get_detaileddescription(self):
return self.detaileddescription
def set_detaileddescription(self, detaileddescription):
self.detaileddescription = detaileddescription
def get_prot(self):
return self.prot
def set_prot(self, prot):
self.prot = prot
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def hasContent_(self):
if (
self.name is not None
or self.initializer is not None
or self.briefdescription is not None
or self.detaileddescription is not None
):
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("prot"):
self.prot = attrs.get("prot").value
if attrs.get("id"):
self.id = attrs.get("id").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name":
valuestr_ = "".join(text_.nodeValue for text_ in child_.childNodes)
obj_ = self.mixedclass_(
MixedContainer.CategorySimple, MixedContainer.TypeString, "name", valuestr_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "initializer":
childobj_ = linkedTextType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "initializer", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "briefdescription":
childobj_ = descriptionType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex,
MixedContainer.TypeNone,
"briefdescription",
childobj_,
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "detaileddescription":
childobj_ = descriptionType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex,
MixedContainer.TypeNone,
"detaileddescription",
childobj_,
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class enumvalueType
class templateparamlistType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, param=None):
if param is None:
self.param = []
else:
self.param = param
def factory(*args_, **kwargs_):
if templateparamlistType.subclass:
return templateparamlistType.subclass(*args_, **kwargs_)
else:
return templateparamlistType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_param(self):
return self.param
def set_param(self, param):
self.param = param
def add_param(self, value):
self.param.append(value)
def insert_param(self, index, value):
self.param[index] = value
def hasContent_(self):
if self.param is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "param":
obj_ = paramType.factory()
obj_.build(child_)
self.param.append(obj_)
# end class templateparamlistType
class paramType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self,
type_=None,
declname=None,
defname=None,
array=None,
defval=None,
briefdescription=None,
):
self.type_ = type_
self.declname = declname
self.defname = defname
self.array = array
self.defval = defval
self.briefdescription = briefdescription
def factory(*args_, **kwargs_):
if paramType.subclass:
return paramType.subclass(*args_, **kwargs_)
else:
return paramType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_type(self):
return self.type_
def set_type(self, type_):
self.type_ = type_
def get_declname(self):
return self.declname
def set_declname(self, declname):
self.declname = declname
def get_defname(self):
return self.defname
def set_defname(self, defname):
self.defname = defname
def get_array(self):
return self.array
def set_array(self, array):
self.array = array
def get_defval(self):
return self.defval
def set_defval(self, defval):
self.defval = defval
def get_briefdescription(self):
return self.briefdescription
def set_briefdescription(self, briefdescription):
self.briefdescription = briefdescription
def hasContent_(self):
if (
self.type_ is not None
or self.declname is not None
or self.defname is not None
or self.array is not None
or self.defval is not None
or self.briefdescription is not None
):
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "type":
obj_ = linkedTextType.factory()
obj_.build(child_)
self.set_type(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "declname":
declname_ = ""
for text__content_ in child_.childNodes:
declname_ += text__content_.nodeValue
self.declname = declname_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "defname":
defname_ = ""
for text__content_ in child_.childNodes:
defname_ += text__content_.nodeValue
self.defname = defname_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "array":
array_ = ""
for text__content_ in child_.childNodes:
array_ += text__content_.nodeValue
self.array = array_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "defval":
obj_ = linkedTextType.factory()
obj_.build(child_)
self.set_defval(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "briefdescription":
obj_ = descriptionType.factory()
obj_.build(child_)
self.set_briefdescription(obj_)
# end class paramType
class declname(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if declname.subclass:
return declname.subclass(*args_, **kwargs_)
else:
return declname(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class declname
class defname(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if defname.subclass:
return defname.subclass(*args_, **kwargs_)
else:
return defname(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class defname
class array(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if array.subclass:
return array.subclass(*args_, **kwargs_)
else:
return array(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class array
class linkedTextType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, ref=None, mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if linkedTextType.subclass:
return linkedTextType.subclass(*args_, **kwargs_)
else:
return linkedTextType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_ref(self):
return self.ref
def set_ref(self, ref):
self.ref = ref
def add_ref(self, value):
self.ref.append(value)
def insert_ref(self, index, value):
self.ref[index] = value
def hasContent_(self):
if self.ref is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref":
childobj_ = docRefTextType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "ref", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class linkedTextType
class graphType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, node=None, direction: str = "forward", caption: str = ""):
if node is None:
self.node = []
else:
self.node = node
self.direction = direction
self.caption = caption
def factory(*args_, **kwargs_):
if graphType.subclass:
return graphType.subclass(*args_, **kwargs_)
else:
return graphType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_direction(self):
return self.direction
def set_direction(self, direction):
self.direction = direction
def get_caption(self):
return self.caption
def set_caption(self, caption):
self.caption = caption
def get_node(self):
return self.node
def set_node(self, node):
self.node = node
def add_node(self, value):
self.node.append(value)
def insert_node(self, index, value):
self.node[index] = value
def hasContent_(self):
if self.node is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "node":
obj_ = nodeType.factory()
obj_.build(child_)
self.node.append(obj_)
# end class graphType
class nodeType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, id=None, label=None, link=None, childnode=None):
self.id = id
self.label = label
self.link = link
if childnode is None:
self.childnode = []
else:
self.childnode = childnode
def factory(*args_, **kwargs_):
if nodeType.subclass:
return nodeType.subclass(*args_, **kwargs_)
else:
return nodeType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_label(self):
return self.label
def set_label(self, label):
self.label = label
def get_link(self):
return self.link
def set_link(self, link):
self.link = link
def get_childnode(self):
return self.childnode
def set_childnode(self, childnode):
self.childnode = childnode
def add_childnode(self, value):
self.childnode.append(value)
def insert_childnode(self, index, value):
self.childnode[index] = value
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def hasContent_(self):
if self.label is not None or self.link is not None or self.childnode is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("id"):
self.id = attrs.get("id").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "label":
label_ = ""
for text__content_ in child_.childNodes:
label_ += text__content_.nodeValue
self.label = label_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "link":
obj_ = linkType.factory()
obj_.build(child_)
self.set_link(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "childnode":
obj_ = childnodeType.factory()
obj_.build(child_)
self.childnode.append(obj_)
# end class nodeType
class label(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if label.subclass:
return label.subclass(*args_, **kwargs_)
else:
return label(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class label
class childnodeType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, relation=None, refid=None, edgelabel=None):
self.relation = relation
self.refid = refid
if edgelabel is None:
self.edgelabel = []
else:
self.edgelabel = edgelabel
def factory(*args_, **kwargs_):
if childnodeType.subclass:
return childnodeType.subclass(*args_, **kwargs_)
else:
return childnodeType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_edgelabel(self):
return self.edgelabel
def set_edgelabel(self, edgelabel):
self.edgelabel = edgelabel
def add_edgelabel(self, value):
self.edgelabel.append(value)
def insert_edgelabel(self, index, value):
self.edgelabel[index] = value
def get_relation(self):
return self.relation
def set_relation(self, relation):
self.relation = relation
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def export(self, outfile, level, namespace_="", name_="childnodeType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="childnodeType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="childnodeType"):
if self.relation is not None:
outfile.write(" relation=%s" % (quote_attrib(self.relation),))
if self.refid is not None:
outfile.write(
" refid=%s"
% (
self.format_string(
quote_attrib(self.refid).encode(ExternalEncoding), input_name="refid"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="childnodeType"):
for edgelabel_ in self.edgelabel:
showIndent(outfile, level)
outfile.write(
"<%sedgelabel>%s%sedgelabel>\n"
% (
namespace_,
self.format_string(
quote_xml(edgelabel_).encode(ExternalEncoding), input_name="edgelabel"
),
namespace_,
)
)
def hasContent_(self):
if self.edgelabel is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("relation"):
self.relation = attrs.get("relation").value
if attrs.get("refid"):
self.refid = attrs.get("refid").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "edgelabel":
edgelabel_ = ""
for text__content_ in child_.childNodes:
edgelabel_ += text__content_.nodeValue
self.edgelabel.append(edgelabel_)
# end class childnodeType
class edgelabel(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if edgelabel.subclass:
return edgelabel.subclass(*args_, **kwargs_)
else:
return edgelabel(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="edgelabel", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="edgelabel")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="edgelabel"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="edgelabel"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class edgelabel
class linkType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, refid=None, external=None, valueOf_=""):
self.refid = refid
self.external = external
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if linkType.subclass:
return linkType.subclass(*args_, **kwargs_)
else:
return linkType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def get_external(self):
return self.external
def set_external(self, external):
self.external = external
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="linkType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="linkType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="linkType"):
if self.refid is not None:
outfile.write(
" refid=%s"
% (
self.format_string(
quote_attrib(self.refid).encode(ExternalEncoding), input_name="refid"
),
)
)
if self.external is not None:
outfile.write(
" external=%s"
% (
self.format_string(
quote_attrib(self.external).encode(ExternalEncoding), input_name="external"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="linkType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("refid"):
self.refid = attrs.get("refid").value
if attrs.get("external"):
self.external = attrs.get("external").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class linkType
class listingType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, codeline=None, domain: str = None):
self.domain = domain
if codeline is None:
self.codeline = []
else:
self.codeline = codeline
def factory(*args_, **kwargs_):
if listingType.subclass:
return listingType.subclass(*args_, **kwargs_)
else:
return listingType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_codeline(self):
return self.codeline
def set_codeline(self, codeline):
self.codeline = codeline
def add_codeline(self, value):
self.codeline.append(value)
def insert_codeline(self, index, value):
self.codeline[index] = value
def export(self, outfile, level, namespace_="", name_="listingType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="listingType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="listingType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="listingType"):
for codeline_ in self.codeline:
codeline_.export(outfile, level, namespace_, name_="codeline")
def hasContent_(self):
if self.codeline is not None:
return True
else:
return False
def build(self, node_: minidom.Element):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs: minidom.NamedNodeMap):
if "filename" in attrs:
# extract the domain for this programlisting tag.
filename = attrs["filename"].value
self.domain = filetypes.get_pygments_alias(filename) or filetypes.get_extension(
filename
)
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "codeline":
obj_ = codelineType.factory()
obj_.build(child_)
self.codeline.append(obj_)
# end class listingType
class codelineType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None):
self.external = external
self.lineno = lineno
self.refkind = refkind
self.refid = refid
if highlight is None:
self.highlight = []
else:
self.highlight = highlight
def factory(*args_, **kwargs_):
if codelineType.subclass:
return codelineType.subclass(*args_, **kwargs_)
else:
return codelineType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_highlight(self):
return self.highlight
def set_highlight(self, highlight):
self.highlight = highlight
def add_highlight(self, value):
self.highlight.append(value)
def insert_highlight(self, index, value):
self.highlight[index] = value
def get_external(self):
return self.external
def set_external(self, external):
self.external = external
def get_lineno(self):
return self.lineno
def set_lineno(self, lineno):
self.lineno = lineno
def get_refkind(self):
return self.refkind
def set_refkind(self, refkind):
self.refkind = refkind
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def export(self, outfile, level, namespace_="", name_="codelineType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="codelineType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="codelineType"):
if self.external is not None:
outfile.write(" external=%s" % (quote_attrib(self.external),))
if self.lineno is not None:
outfile.write(' lineno="%s"' % self.format_integer(self.lineno, input_name="lineno"))
if self.refkind is not None:
outfile.write(" refkind=%s" % (quote_attrib(self.refkind),))
if self.refid is not None:
outfile.write(
" refid=%s"
% (
self.format_string(
quote_attrib(self.refid).encode(ExternalEncoding), input_name="refid"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="codelineType"):
for highlight_ in self.highlight:
highlight_.export(outfile, level, namespace_, name_="highlight")
def hasContent_(self):
if self.highlight is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("external"):
self.external = attrs.get("external").value
if attrs.get("lineno"):
try:
self.lineno = int(attrs.get("lineno").value)
except ValueError as exp:
raise ValueError("Bad integer attribute (lineno): %s" % exp)
if attrs.get("refkind"):
self.refkind = attrs.get("refkind").value
if attrs.get("refid"):
self.refid = attrs.get("refid").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "highlight":
obj_ = highlightType.factory()
obj_.build(child_)
self.highlight.append(obj_)
# end class codelineType
class highlightType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, classxx=None, sp=None, ref=None, mixedclass_=None, content_=None):
self.classxx = classxx
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if highlightType.subclass:
return highlightType.subclass(*args_, **kwargs_)
else:
return highlightType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_sp(self):
return self.sp
def set_sp(self, sp):
self.sp = sp
def add_sp(self, value):
self.sp.append(value)
def insert_sp(self, index, value):
self.sp[index] = value
def get_ref(self):
return self.ref
def set_ref(self, ref):
self.ref = ref
def add_ref(self, value):
self.ref.append(value)
def insert_ref(self, index, value):
self.ref[index] = value
def get_class(self):
return self.classxx
def set_class(self, classxx):
self.classxx = classxx
def export(self, outfile, level, namespace_="", name_="highlightType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="highlightType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="highlightType"):
if self.classxx is not None:
outfile.write(" class=%s" % (quote_attrib(self.classxx),))
def exportChildren(self, outfile, level, namespace_="", name_="highlightType"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if self.sp is not None or self.ref is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("class"):
self.classxx = attrs.get("class").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sp":
# value_ = [text_.nodeValue for text_ in child_.childNodes]
# We make this unicode so that our unicode renderer catch-all picks it up
# otherwise it would go through as 'str' and we'd have to pick it up too
valuestr_ = " "
obj_ = self.mixedclass_(
MixedContainer.CategorySimple, MixedContainer.TypeString, "sp", valuestr_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref":
childobj_ = docRefTextType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "ref", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class highlightType
class sp(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if sp.subclass:
return sp.subclass(*args_, **kwargs_)
else:
return sp(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="sp", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="sp")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="sp"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="sp"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class sp
class referenceType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self,
endline=None,
startline=None,
refid=None,
compoundref=None,
valueOf_="",
mixedclass_=None,
content_=None,
):
self.endline = endline
self.startline = startline
self.refid = refid
self.compoundref = compoundref
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if referenceType.subclass:
return referenceType.subclass(*args_, **kwargs_)
else:
return referenceType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_endline(self):
return self.endline
def set_endline(self, endline):
self.endline = endline
def get_startline(self):
return self.startline
def set_startline(self, startline):
self.startline = startline
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def get_compoundref(self):
return self.compoundref
def set_compoundref(self, compoundref):
self.compoundref = compoundref
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="referenceType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="referenceType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="referenceType"):
if self.endline is not None:
outfile.write(' endline="%s"' % self.format_integer(self.endline, input_name="endline"))
if self.startline is not None:
outfile.write(
' startline="%s"' % self.format_integer(self.startline, input_name="startline")
)
if self.refid is not None:
outfile.write(
" refid=%s"
% (
self.format_string(
quote_attrib(self.refid).encode(ExternalEncoding), input_name="refid"
),
)
)
if self.compoundref is not None:
outfile.write(
" compoundref=%s"
% (
self.format_string(
quote_attrib(self.compoundref).encode(ExternalEncoding),
input_name="compoundref",
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="referenceType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("endline"):
try:
self.endline = int(attrs.get("endline").value)
except ValueError as exp:
raise ValueError("Bad integer attribute (endline): %s" % exp)
if attrs.get("startline"):
try:
self.startline = int(attrs.get("startline").value)
except ValueError as exp:
raise ValueError("Bad integer attribute (startline): %s" % exp)
if attrs.get("refid"):
self.refid = attrs.get("refid").value
if attrs.get("compoundref"):
self.compoundref = attrs.get("compoundref").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class referenceType
class locationType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_=""
):
self.bodystart = bodystart
self.line = line
self.bodyend = bodyend
self.bodyfile = bodyfile
self.file = file
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if locationType.subclass:
return locationType.subclass(*args_, **kwargs_)
else:
return locationType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_bodystart(self):
return self.bodystart
def set_bodystart(self, bodystart):
self.bodystart = bodystart
def get_line(self):
return self.line
def set_line(self, line):
self.line = line
def get_bodyend(self):
return self.bodyend
def set_bodyend(self, bodyend):
self.bodyend = bodyend
def get_bodyfile(self):
return self.bodyfile
def set_bodyfile(self, bodyfile):
self.bodyfile = bodyfile
def get_file(self):
return self.file
def set_file(self, file):
self.file = file
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="locationType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="locationType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="locationType"):
if self.bodystart is not None:
outfile.write(
' bodystart="%s"' % self.format_integer(self.bodystart, input_name="bodystart")
)
if self.line is not None:
outfile.write(' line="%s"' % self.format_integer(self.line, input_name="line"))
if self.bodyend is not None:
outfile.write(' bodyend="%s"' % self.format_integer(self.bodyend, input_name="bodyend"))
if self.bodyfile is not None:
outfile.write(
" bodyfile=%s"
% (
self.format_string(
quote_attrib(self.bodyfile).encode(ExternalEncoding), input_name="bodyfile"
),
)
)
if self.file is not None:
outfile.write(
" file=%s"
% (
self.format_string(
quote_attrib(self.file).encode(ExternalEncoding), input_name="file"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="locationType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("bodystart"):
try:
self.bodystart = int(attrs.get("bodystart").value)
except ValueError as exp:
raise ValueError("Bad integer attribute (bodystart): %s" % exp)
if attrs.get("line"):
try:
self.line = int(attrs.get("line").value)
except ValueError as exp:
raise ValueError("Bad integer attribute (line): %s" % exp)
if attrs.get("bodyend"):
try:
self.bodyend = int(attrs.get("bodyend").value)
except ValueError as exp:
raise ValueError("Bad integer attribute (bodyend): %s" % exp)
if attrs.get("bodyfile"):
self.bodyfile = attrs.get("bodyfile").value
if attrs.get("file"):
self.file = attrs.get("file").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class locationType
class docSect1Type(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self,
id=None,
title=None,
para=None,
sect2=None,
internal=None,
mixedclass_=None,
content_=None,
):
self.id = id
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
if title is None:
self.title = ""
else:
self.title = title
def factory(*args_, **kwargs_):
if docSect1Type.subclass:
return docSect1Type.subclass(*args_, **kwargs_)
else:
return docSect1Type(*args_, **kwargs_)
factory = staticmethod(factory)
def get_title(self):
return self.title
def set_title(self, title):
self.title = title
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_sect2(self):
return self.sect2
def set_sect2(self, sect2):
self.sect2 = sect2
def add_sect2(self, value):
self.sect2.append(value)
def insert_sect2(self, index, value):
self.sect2[index] = value
def get_internal(self):
return self.internal
def set_internal(self, internal):
self.internal = internal
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def export(self, outfile, level, namespace_="", name_="docSect1Type", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docSect1Type")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docSect1Type"):
if self.id is not None:
outfile.write(
" id=%s"
% (
self.format_string(
quote_attrib(self.id).encode(ExternalEncoding), input_name="id"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docSect1Type"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if (
self.title is not None
or self.para is not None
or self.sect2 is not None
or self.internal is not None
):
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("id"):
self.id = attrs.get("id").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title":
self.title = child_.childNodes[0].nodeValue
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
childobj_ = docParaType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect2":
childobj_ = docSect2Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect2", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal":
childobj_ = docInternalS1Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "internal", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class docSect1Type
class docSect2Type(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self,
id=None,
title=None,
para=None,
sect3=None,
internal=None,
mixedclass_=None,
content_=None,
):
self.id = id
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
if title is None:
title = ""
else:
title = title
def factory(*args_, **kwargs_):
if docSect2Type.subclass:
return docSect2Type.subclass(*args_, **kwargs_)
else:
return docSect2Type(*args_, **kwargs_)
factory = staticmethod(factory)
def get_title(self):
return self.title
def set_title(self, title):
self.title = title
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_sect3(self):
return self.sect3
def set_sect3(self, sect3):
self.sect3 = sect3
def add_sect3(self, value):
self.sect3.append(value)
def insert_sect3(self, index, value):
self.sect3[index] = value
def get_internal(self):
return self.internal
def set_internal(self, internal):
self.internal = internal
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def export(self, outfile, level, namespace_="", name_="docSect2Type", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docSect2Type")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docSect2Type"):
if self.id is not None:
outfile.write(
" id=%s"
% (
self.format_string(
quote_attrib(self.id).encode(ExternalEncoding), input_name="id"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docSect2Type"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if (
self.title is not None
or self.para is not None
or self.sect3 is not None
or self.internal is not None
):
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("id"):
self.id = attrs.get("id").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title":
self.title = child_.childNodes[0].nodeValue
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
childobj_ = docParaType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect3":
childobj_ = docSect3Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect3", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal":
childobj_ = docInternalS2Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "internal", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class docSect2Type
class docSect3Type(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self,
id=None,
title=None,
para=None,
sect4=None,
internal=None,
mixedclass_=None,
content_=None,
):
self.id = id
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
if title is None:
self.title = ""
else:
self.title = title
def factory(*args_, **kwargs_):
if docSect3Type.subclass:
return docSect3Type.subclass(*args_, **kwargs_)
else:
return docSect3Type(*args_, **kwargs_)
factory = staticmethod(factory)
def get_title(self):
return self.title
def set_title(self, title):
self.title = title
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_sect4(self):
return self.sect4
def set_sect4(self, sect4):
self.sect4 = sect4
def add_sect4(self, value):
self.sect4.append(value)
def insert_sect4(self, index, value):
self.sect4[index] = value
def get_internal(self):
return self.internal
def set_internal(self, internal):
self.internal = internal
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def export(self, outfile, level, namespace_="", name_="docSect3Type", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docSect3Type")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docSect3Type"):
if self.id is not None:
outfile.write(
" id=%s"
% (
self.format_string(
quote_attrib(self.id).encode(ExternalEncoding), input_name="id"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docSect3Type"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if (
self.title is not None
or self.para is not None
or self.sect4 is not None
or self.internal is not None
):
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("id"):
self.id = attrs.get("id").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title":
self.title = child_.childNodes[0].nodeValue
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
childobj_ = docParaType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect4":
childobj_ = docSect4Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect4", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal":
childobj_ = docInternalS3Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "internal", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class docSect3Type
class docSect4Type(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self, id=None, title=None, para=None, internal=None, mixedclass_=None, content_=None
):
self.id = id
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docSect4Type.subclass:
return docSect4Type.subclass(*args_, **kwargs_)
else:
return docSect4Type(*args_, **kwargs_)
factory = staticmethod(factory)
def get_title(self):
return self.title
def set_title(self, title):
self.title = title
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_internal(self):
return self.internal
def set_internal(self, internal):
self.internal = internal
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def export(self, outfile, level, namespace_="", name_="docSect4Type", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docSect4Type")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docSect4Type"):
if self.id is not None:
outfile.write(
" id=%s"
% (
self.format_string(
quote_attrib(self.id).encode(ExternalEncoding), input_name="id"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docSect4Type"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if self.title is not None or self.para is not None or self.internal is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("id"):
self.id = attrs.get("id").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title":
childobj_ = docTitleType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "title", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
childobj_ = docParaType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal":
childobj_ = docInternalS4Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "internal", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class docSect4Type
class docInternalType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docInternalType.subclass:
return docInternalType.subclass(*args_, **kwargs_)
else:
return docInternalType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_sect1(self):
return self.sect1
def set_sect1(self, sect1):
self.sect1 = sect1
def add_sect1(self, value):
self.sect1.append(value)
def insert_sect1(self, index, value):
self.sect1[index] = value
def export(self, outfile, level, namespace_="", name_="docInternalType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docInternalType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docInternalType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docInternalType"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if self.para is not None or self.sect1 is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
childobj_ = docParaType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect1":
childobj_ = docSect1Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect1", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class docInternalType
class docInternalS1Type(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docInternalS1Type.subclass:
return docInternalS1Type.subclass(*args_, **kwargs_)
else:
return docInternalS1Type(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_sect2(self):
return self.sect2
def set_sect2(self, sect2):
self.sect2 = sect2
def add_sect2(self, value):
self.sect2.append(value)
def insert_sect2(self, index, value):
self.sect2[index] = value
def export(self, outfile, level, namespace_="", name_="docInternalS1Type", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docInternalS1Type")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docInternalS1Type"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docInternalS1Type"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if self.para is not None or self.sect2 is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
childobj_ = docParaType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect2":
childobj_ = docSect2Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect2", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class docInternalS1Type
class docInternalS2Type(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docInternalS2Type.subclass:
return docInternalS2Type.subclass(*args_, **kwargs_)
else:
return docInternalS2Type(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_sect3(self):
return self.sect3
def set_sect3(self, sect3):
self.sect3 = sect3
def add_sect3(self, value):
self.sect3.append(value)
def insert_sect3(self, index, value):
self.sect3[index] = value
def export(self, outfile, level, namespace_="", name_="docInternalS2Type", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docInternalS2Type")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docInternalS2Type"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docInternalS2Type"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if self.para is not None or self.sect3 is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
childobj_ = docParaType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect3":
childobj_ = docSect3Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect3", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class docInternalS2Type
class docInternalS3Type(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docInternalS3Type.subclass:
return docInternalS3Type.subclass(*args_, **kwargs_)
else:
return docInternalS3Type(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_sect3(self):
return self.sect3
def set_sect3(self, sect3):
self.sect3 = sect3
def add_sect3(self, value):
self.sect3.append(value)
def insert_sect3(self, index, value):
self.sect3[index] = value
def export(self, outfile, level, namespace_="", name_="docInternalS3Type", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docInternalS3Type")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docInternalS3Type"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docInternalS3Type"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if self.para is not None or self.sect3 is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
childobj_ = docParaType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect3":
childobj_ = docSect4Type.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect3", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class docInternalS3Type
class docInternalS4Type(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, para=None, mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docInternalS4Type.subclass:
return docInternalS4Type.subclass(*args_, **kwargs_)
else:
return docInternalS4Type(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def export(self, outfile, level, namespace_="", name_="docInternalS4Type", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docInternalS4Type")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docInternalS4Type"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docInternalS4Type"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if self.para is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
childobj_ = docParaType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
# end class docInternalS4Type
class docTitleType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_="", mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docTitleType.subclass:
return docTitleType.subclass(*args_, **kwargs_)
else:
return docTitleType(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docTitleType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docTitleType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docTitleType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docTitleType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docTitleType
class docParaType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_="", mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docParaType.subclass:
return docParaType.subclass(*args_, **kwargs_)
else:
return docParaType(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docParaType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docParaType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docParaType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docParaType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docParaType
class docMarkupType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_="", mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docMarkupType.subclass:
return docMarkupType.subclass(*args_, **kwargs_)
else:
return docMarkupType(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docMarkupType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docMarkupType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docMarkupType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docMarkupType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docMarkupType
class docURLLink(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, url=None, valueOf_="", mixedclass_=None, content_=None):
self.url = url
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docURLLink.subclass:
return docURLLink.subclass(*args_, **kwargs_)
else:
return docURLLink(*args_, **kwargs_)
factory = staticmethod(factory)
def get_url(self):
return self.url
def set_url(self, url):
self.url = url
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docURLLink", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docURLLink")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docURLLink"):
if self.url is not None:
outfile.write(
" url=%s"
% (
self.format_string(
quote_attrib(self.url).encode(ExternalEncoding), input_name="url"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docURLLink"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("url"):
self.url = attrs.get("url").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docURLLink
class docAnchorType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None):
self.id = id
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docAnchorType.subclass:
return docAnchorType.subclass(*args_, **kwargs_)
else:
return docAnchorType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docAnchorType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docAnchorType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docAnchorType"):
if self.id is not None:
outfile.write(
" id=%s"
% (
self.format_string(
quote_attrib(self.id).encode(ExternalEncoding), input_name="id"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docAnchorType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("id"):
self.id = attrs.get("id").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docAnchorType
class docFormulaType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None):
self.id = id
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docFormulaType.subclass:
return docFormulaType.subclass(*args_, **kwargs_)
else:
return docFormulaType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docFormulaType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docFormulaType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docFormulaType"):
if self.id is not None:
outfile.write(
" id=%s"
% (
self.format_string(
quote_attrib(self.id).encode(ExternalEncoding), input_name="id"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docFormulaType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("id"):
self.id = attrs.get("id").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docFormulaType
class docIndexEntryType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, primaryie=None, secondaryie=None):
self.primaryie = primaryie
self.secondaryie = secondaryie
def factory(*args_, **kwargs_):
if docIndexEntryType.subclass:
return docIndexEntryType.subclass(*args_, **kwargs_)
else:
return docIndexEntryType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_primaryie(self):
return self.primaryie
def set_primaryie(self, primaryie):
self.primaryie = primaryie
def get_secondaryie(self):
return self.secondaryie
def set_secondaryie(self, secondaryie):
self.secondaryie = secondaryie
def export(self, outfile, level, namespace_="", name_="docIndexEntryType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docIndexEntryType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docIndexEntryType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docIndexEntryType"):
if self.primaryie is not None:
showIndent(outfile, level)
outfile.write(
"<%sprimaryie>%s%sprimaryie>\n"
% (
namespace_,
self.format_string(
quote_xml(self.primaryie).encode(ExternalEncoding), input_name="primaryie"
),
namespace_,
)
)
if self.secondaryie is not None:
showIndent(outfile, level)
outfile.write(
"<%ssecondaryie>%s%ssecondaryie>\n"
% (
namespace_,
self.format_string(
quote_xml(self.secondaryie).encode(ExternalEncoding),
input_name="secondaryie",
),
namespace_,
)
)
def hasContent_(self):
if self.primaryie is not None or self.secondaryie is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "primaryie":
primaryie_ = ""
for text__content_ in child_.childNodes:
primaryie_ += text__content_.nodeValue
self.primaryie = primaryie_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "secondaryie":
secondaryie_ = ""
for text__content_ in child_.childNodes:
secondaryie_ += text__content_.nodeValue
self.secondaryie = secondaryie_
# end class docIndexEntryType
class docListType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, listitem=None):
if listitem is None:
self.listitem = []
else:
self.listitem = listitem
def factory(*args_, **kwargs_):
if docListType.subclass:
return docListType.subclass(*args_, **kwargs_)
else:
return docListType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_listitem(self):
return self.listitem
def set_listitem(self, listitem):
self.listitem = listitem
def add_listitem(self, value):
self.listitem.append(value)
def insert_listitem(self, index, value):
self.listitem[index] = value
def export(self, outfile, level, namespace_="", name_="docListType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docListType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docListType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docListType"):
for listitem_ in self.listitem:
listitem_.export(outfile, level, namespace_, name_="listitem")
def hasContent_(self):
if self.listitem is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "listitem":
obj_ = docListItemType.factory()
obj_.build(child_)
self.listitem.append(obj_)
# end class docListType
class docListItemType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, para=None):
if para is None:
self.para = []
else:
self.para = para
def factory(*args_, **kwargs_):
if docListItemType.subclass:
return docListItemType.subclass(*args_, **kwargs_)
else:
return docListItemType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def export(self, outfile, level, namespace_="", name_="docListItemType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docListItemType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docListItemType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docListItemType"):
for para_ in self.para:
para_.export(outfile, level, namespace_, name_="para")
def hasContent_(self):
if self.para is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
obj_ = docParaType.factory()
obj_.build(child_)
self.para.append(obj_)
# end class docListItemType
class docSimpleSectType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, kind=None, title=None, para=None):
self.kind = kind
self.title = title
if para is None:
self.para = []
else:
self.para = para
def factory(*args_, **kwargs_):
if docSimpleSectType.subclass:
return docSimpleSectType.subclass(*args_, **kwargs_)
else:
return docSimpleSectType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_title(self):
return self.title
def set_title(self, title):
self.title = title
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_kind(self):
return self.kind
def set_kind(self, kind):
self.kind = kind
def export(self, outfile, level, namespace_="", name_="docSimpleSectType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docSimpleSectType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docSimpleSectType"):
if self.kind is not None:
outfile.write(" kind=%s" % (quote_attrib(self.kind),))
def exportChildren(self, outfile, level, namespace_="", name_="docSimpleSectType"):
if self.title:
self.title.export(outfile, level, namespace_, name_="title")
for para_ in self.para:
para_.export(outfile, level, namespace_, name_="para")
def hasContent_(self):
if self.title is not None or self.para is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("kind"):
self.kind = attrs.get("kind").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title":
obj_ = docTitleType.factory()
obj_.build(child_)
self.set_title(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
obj_ = docParaType.factory()
obj_.build(child_)
self.para.append(obj_)
# end class docSimpleSectType
class docVarListEntryType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, term=None):
self.term = term
def factory(*args_, **kwargs_):
if docVarListEntryType.subclass:
return docVarListEntryType.subclass(*args_, **kwargs_)
else:
return docVarListEntryType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_term(self):
return self.term
def set_term(self, term):
self.term = term
def export(self, outfile, level, namespace_="", name_="docVarListEntryType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docVarListEntryType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docVarListEntryType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docVarListEntryType"):
if self.term:
self.term.export(
outfile,
level,
namespace_,
name_="term",
)
def hasContent_(self):
if self.term is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "term":
obj_ = docTitleType.factory()
obj_.build(child_)
self.set_term(obj_)
# end class docVarListEntryType
class docVariableListType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if docVariableListType.subclass:
return docVariableListType.subclass(*args_, **kwargs_)
else:
return docVariableListType(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docVariableListType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docVariableListType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docVariableListType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docVariableListType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docVariableListType
class docRefTextType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self, refid=None, kindref=None, external=None, valueOf_="", mixedclass_=None, content_=None
):
self.refid = refid
self.kindref = kindref
self.external = external
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docRefTextType.subclass:
return docRefTextType.subclass(*args_, **kwargs_)
else:
return docRefTextType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def get_kindref(self):
return self.kindref
def set_kindref(self, kindref):
self.kindref = kindref
def get_external(self):
return self.external
def set_external(self, external):
self.external = external
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docRefTextType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docRefTextType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docRefTextType"):
if self.refid is not None:
outfile.write(
" refid=%s"
% (
self.format_string(
quote_attrib(self.refid).encode(ExternalEncoding), input_name="refid"
),
)
)
if self.kindref is not None:
outfile.write(" kindref=%s" % (quote_attrib(self.kindref),))
if self.external is not None:
outfile.write(
" external=%s"
% (
self.format_string(
quote_attrib(self.external).encode(ExternalEncoding), input_name="external"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docRefTextType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("refid"):
self.refid = attrs.get("refid").value
if attrs.get("kindref"):
self.kindref = attrs.get("kindref").value
if attrs.get("external"):
self.external = attrs.get("external").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docRefTextType
class docTableType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, rows=None, cols=None, row=None, caption=None):
self.rows = rows
self.cols = cols
if row is None:
self.row = []
else:
self.row = row
self.caption = caption
def factory(*args_, **kwargs_):
if docTableType.subclass:
return docTableType.subclass(*args_, **kwargs_)
else:
return docTableType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_row(self):
return self.row
def set_row(self, row):
self.row = row
def add_row(self, value):
self.row.append(value)
def insert_row(self, index, value):
self.row[index] = value
def get_caption(self):
return self.caption
def set_caption(self, caption):
self.caption = caption
def get_rows(self):
return self.rows
def set_rows(self, rows):
self.rows = rows
def get_cols(self):
return self.cols
def set_cols(self, cols):
self.cols = cols
def export(self, outfile, level, namespace_="", name_="docTableType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docTableType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docTableType"):
if self.rows is not None:
outfile.write(' rows="%s"' % self.format_integer(self.rows, input_name="rows"))
if self.cols is not None:
outfile.write(' cols="%s"' % self.format_integer(self.cols, input_name="cols"))
def exportChildren(self, outfile, level, namespace_="", name_="docTableType"):
for row_ in self.row:
row_.export(outfile, level, namespace_, name_="row")
if self.caption:
self.caption.export(outfile, level, namespace_, name_="caption")
def hasContent_(self):
if self.row is not None or self.caption is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("rows"):
try:
self.rows = int(attrs.get("rows").value)
except ValueError as exp:
raise ValueError("Bad integer attribute (rows): %s" % exp)
if attrs.get("cols"):
try:
self.cols = int(attrs.get("cols").value)
except ValueError as exp:
raise ValueError("Bad integer attribute (cols): %s" % exp)
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "row":
obj_ = docRowType.factory()
obj_.build(child_)
self.row.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "caption":
obj_ = docCaptionType.factory()
obj_.build(child_)
self.set_caption(obj_)
# end class docTableType
class docRowType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, entry=None):
if entry is None:
self.entry = []
else:
self.entry = entry
def factory(*args_, **kwargs_):
if docRowType.subclass:
return docRowType.subclass(*args_, **kwargs_)
else:
return docRowType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_entry(self):
return self.entry
def set_entry(self, entry):
self.entry = entry
def add_entry(self, value):
self.entry.append(value)
def insert_entry(self, index, value):
self.entry[index] = value
def export(self, outfile, level, namespace_="", name_="docRowType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docRowType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docRowType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docRowType"):
for entry_ in self.entry:
entry_.export(outfile, level, namespace_, name_="entry")
def hasContent_(self):
if self.entry is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "entry":
obj_ = docEntryType.factory()
obj_.build(child_)
self.entry.append(obj_)
# end class docRowType
class docEntryType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, thead=None, align=None, rowspan=None, colspan=None, para=None):
self.thead = thead
self.align = align
self.rowspan = rowspan
self.colspan = colspan
if para is None:
self.para = []
else:
self.para = para
def factory(*args_, **kwargs_):
if docEntryType.subclass:
return docEntryType.subclass(*args_, **kwargs_)
else:
return docEntryType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_thead(self):
return self.thead
def set_thead(self, thead):
self.thead = thead
def get_align(self):
return self.align
def set_align(self, align):
self.align = align
def get_rowspan(self):
return self.rowspan
def set_rowspan(self, rowspan):
self.rowspan = rowspan
def get_colspan(self):
return self.colspan
def set_colspan(self, colspan):
self.colspan = colspan
def export(self, outfile, level, namespace_="", name_="docEntryType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docEntryType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docEntryType"):
if self.thead is not None:
outfile.write(" thead=%s" % (quote_attrib(self.thead),))
if self.align is not None:
outfile.write(" align=%s" % (quote_attrib(self.align),))
if self.rowspan is not None:
outfile.write(" rowspan=%s" % (quote_attrib(self.rowspan),))
if self.colspan is not None:
outfile.write(" colspan=%s" % (quote_attrib(self.colspan),))
def exportChildren(self, outfile, level, namespace_="", name_="docEntryType"):
for para_ in self.para:
para_.export(outfile, level, namespace_, name_="para")
def hasContent_(self):
if self.para is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("thead"):
self.thead = attrs.get("thead").value
if attrs.get("align"):
self.align = attrs.get("align").value
if attrs.get("rowspan"):
self.rowspan = attrs.get("rowspan").value
if attrs.get("colspan"):
self.colspan = attrs.get("colspan").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
obj_ = docParaType.factory()
obj_.build(child_)
self.para.append(obj_)
# end class docEntryType
class docCaptionType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_="", mixedclass_=None, content_=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docCaptionType.subclass:
return docCaptionType.subclass(*args_, **kwargs_)
else:
return docCaptionType(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docCaptionType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docCaptionType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docCaptionType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docCaptionType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docCaptionType
class docHeadingType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, level=None, valueOf_="", mixedclass_=None, content_=None):
self.level = level
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docHeadingType.subclass:
return docHeadingType.subclass(*args_, **kwargs_)
else:
return docHeadingType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_level(self):
return self.level
def set_level(self, level):
self.level = level
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docHeadingType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docHeadingType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docHeadingType"):
if self.level is not None:
outfile.write(' level="%s"' % self.format_integer(self.level, input_name="level"))
def exportChildren(self, outfile, level, namespace_="", name_="docHeadingType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("level"):
try:
self.level = int(attrs.get("level").value)
except ValueError as exp:
raise ValueError("Bad integer attribute (level): %s" % exp)
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docHeadingType
class docImageType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(
self,
width=None,
type_=None,
name=None,
height=None,
valueOf_="",
mixedclass_=None,
content_=None,
):
self.width = width
self.type_ = type_
self.name = name
self.height = height
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docImageType.subclass:
return docImageType.subclass(*args_, **kwargs_)
else:
return docImageType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_width(self):
return self.width
def set_width(self, width):
self.width = width
def get_type(self):
return self.type_
def set_type(self, type_):
self.type_ = type_
def get_name(self):
return self.name
def set_name(self, name):
self.name = name
def get_height(self):
return self.height
def set_height(self, height):
self.height = height
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docImageType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docImageType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docImageType"):
if self.width is not None:
outfile.write(
" width=%s"
% (
self.format_string(
quote_attrib(self.width).encode(ExternalEncoding), input_name="width"
),
)
)
if self.type_ is not None:
outfile.write(" type=%s" % (quote_attrib(self.type_),))
if self.name is not None:
outfile.write(
" name=%s"
% (
self.format_string(
quote_attrib(self.name).encode(ExternalEncoding), input_name="name"
),
)
)
if self.height is not None:
outfile.write(
" height=%s"
% (
self.format_string(
quote_attrib(self.height).encode(ExternalEncoding), input_name="height"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docImageType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("width"):
self.width = attrs.get("width").value
if attrs.get("type"):
self.type_ = attrs.get("type").value
if attrs.get("name"):
self.name = attrs.get("name").value
if attrs.get("height"):
self.height = attrs.get("height").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docImageType
class docDotFileType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, name=None, valueOf_="", mixedclass_=None, content_=None):
self.name = name
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docDotFileType.subclass:
return docDotFileType.subclass(*args_, **kwargs_)
else:
return docDotFileType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_name(self):
return self.name
def set_name(self, name):
self.name = name
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docDotFileType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docDotFileType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docDotFileType"):
if self.name is not None:
outfile.write(
" name=%s"
% (
self.format_string(
quote_attrib(self.name).encode(ExternalEncoding), input_name="name"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docDotFileType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("name"):
self.name = attrs.get("name").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docDotFileType
class docDotType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, caption=None, valueOf_="", mixedclass_=None, content_=None):
self.caption = caption
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docDotType.subclass:
return docDotType.subclass(*args_, **kwargs_)
else:
return docDotType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_name(self):
return self.caption
def set_name(self, caption):
self.caption = caption
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docDotType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docDotType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docDotType"):
if self.caption is not None:
outfile.write(
" caption=%s"
% (
self.format_string(
quote_attrib(self.caption).encode(ExternalEncoding), input_name="caption"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docDotType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("caption"):
self.caption = attrs.get("caption").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docDotType
class docTocItemType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None):
self.id = id
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docTocItemType.subclass:
return docTocItemType.subclass(*args_, **kwargs_)
else:
return docTocItemType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docTocItemType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docTocItemType")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docTocItemType"):
if self.id is not None:
outfile.write(
" id=%s"
% (
self.format_string(
quote_attrib(self.id).encode(ExternalEncoding), input_name="id"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docTocItemType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("id"):
self.id = attrs.get("id").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docTocItemType
class docTocListType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, tocitem=None):
if tocitem is None:
self.tocitem = []
else:
self.tocitem = tocitem
def factory(*args_, **kwargs_):
if docTocListType.subclass:
return docTocListType.subclass(*args_, **kwargs_)
else:
return docTocListType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_tocitem(self):
return self.tocitem
def set_tocitem(self, tocitem):
self.tocitem = tocitem
def add_tocitem(self, value):
self.tocitem.append(value)
def insert_tocitem(self, index, value):
self.tocitem[index] = value
def export(self, outfile, level, namespace_="", name_="docTocListType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docTocListType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docTocListType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docTocListType"):
for tocitem_ in self.tocitem:
tocitem_.export(outfile, level, namespace_, name_="tocitem")
def hasContent_(self):
if self.tocitem is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "tocitem":
obj_ = docTocItemType.factory()
obj_.build(child_)
self.tocitem.append(obj_)
# end class docTocListType
class docLanguageType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, langid=None, para=None):
self.langid = langid
if para is None:
self.para = []
else:
self.para = para
def factory(*args_, **kwargs_):
if docLanguageType.subclass:
return docLanguageType.subclass(*args_, **kwargs_)
else:
return docLanguageType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_langid(self):
return self.langid
def set_langid(self, langid):
self.langid = langid
def export(self, outfile, level, namespace_="", name_="docLanguageType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docLanguageType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docLanguageType"):
if self.langid is not None:
outfile.write(
" langid=%s"
% (
self.format_string(
quote_attrib(self.langid).encode(ExternalEncoding), input_name="langid"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docLanguageType"):
for para_ in self.para:
para_.export(outfile, level, namespace_, name_="para")
def hasContent_(self):
if self.para is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("langid"):
self.langid = attrs.get("langid").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
obj_ = docParaType.factory()
obj_.build(child_)
self.para.append(obj_)
# end class docLanguageType
class docParamListType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, kind=None, parameteritem=None):
self.kind = kind
if parameteritem is None:
self.parameteritem = []
else:
self.parameteritem = parameteritem
def factory(*args_, **kwargs_):
if docParamListType.subclass:
return docParamListType.subclass(*args_, **kwargs_)
else:
return docParamListType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_parameteritem(self):
return self.parameteritem
def set_parameteritem(self, parameteritem):
self.parameteritem = parameteritem
def add_parameteritem(self, value):
self.parameteritem.append(value)
def insert_parameteritem(self, index, value):
self.parameteritem[index] = value
def get_kind(self):
return self.kind
def set_kind(self, kind):
self.kind = kind
def export(self, outfile, level, namespace_="", name_="docParamListType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docParamListType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docParamListType"):
if self.kind is not None:
outfile.write(" kind=%s" % (quote_attrib(self.kind),))
def exportChildren(self, outfile, level, namespace_="", name_="docParamListType"):
for parameteritem_ in self.parameteritem:
parameteritem_.export(outfile, level, namespace_, name_="parameteritem")
def hasContent_(self):
if self.parameteritem is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("kind"):
self.kind = attrs.get("kind").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parameteritem":
obj_ = docParamListItem.factory()
obj_.build(child_)
self.parameteritem.append(obj_)
# end class docParamListType
class docParamListItem(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, parameternamelist=None, parameterdescription=None):
if parameternamelist is None:
self.parameternamelist = []
else:
self.parameternamelist = parameternamelist
self.parameterdescription = parameterdescription
def factory(*args_, **kwargs_):
if docParamListItem.subclass:
return docParamListItem.subclass(*args_, **kwargs_)
else:
return docParamListItem(*args_, **kwargs_)
factory = staticmethod(factory)
def get_parameternamelist(self):
return self.parameternamelist
def set_parameternamelist(self, parameternamelist):
self.parameternamelist = parameternamelist
def add_parameternamelist(self, value):
self.parameternamelist.append(value)
def insert_parameternamelist(self, index, value):
self.parameternamelist[index] = value
def get_parameterdescription(self):
return self.parameterdescription
def set_parameterdescription(self, parameterdescription):
self.parameterdescription = parameterdescription
def export(self, outfile, level, namespace_="", name_="docParamListItem", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docParamListItem")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docParamListItem"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docParamListItem"):
for parameternamelist_ in self.parameternamelist:
parameternamelist_.export(outfile, level, namespace_, name_="parameternamelist")
if self.parameterdescription:
self.parameterdescription.export(
outfile,
level,
namespace_,
name_="parameterdescription",
)
def hasContent_(self):
if self.parameternamelist is not None or self.parameterdescription is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parameternamelist":
obj_ = docParamNameList.factory()
obj_.build(child_)
self.parameternamelist.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parameterdescription":
obj_ = descriptionType.factory()
obj_.build(child_)
self.set_parameterdescription(obj_)
# end class docParamListItem
class docParamNameList(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, parametername=None):
if parametername is None:
self.parametername = []
else:
self.parametername = parametername
def factory(*args_, **kwargs_):
if docParamNameList.subclass:
return docParamNameList.subclass(*args_, **kwargs_)
else:
return docParamNameList(*args_, **kwargs_)
factory = staticmethod(factory)
def get_parametername(self):
return self.parametername
def set_parametername(self, parametername):
self.parametername = parametername
def add_parametername(self, value):
self.parametername.append(value)
def insert_parametername(self, index, value):
self.parametername[index] = value
def export(self, outfile, level, namespace_="", name_="docParamNameList", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docParamNameList")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docParamNameList"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docParamNameList"):
for parametername_ in self.parametername:
parametername_.export(outfile, level, namespace_, name_="parametername")
def hasContent_(self):
if self.parametername is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parametername":
obj_ = docParamName.factory()
obj_.build(child_)
self.parametername.append(obj_)
# end class docParamNameList
class docParamName(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None):
self.direction = direction
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if content_ is None:
self.content_ = []
else:
self.content_ = content_
def factory(*args_, **kwargs_):
if docParamName.subclass:
return docParamName.subclass(*args_, **kwargs_)
else:
return docParamName(*args_, **kwargs_)
factory = staticmethod(factory)
def get_ref(self):
return self.ref
def set_ref(self, ref):
self.ref = ref
def get_direction(self):
return self.direction
def set_direction(self, direction):
self.direction = direction
def export(self, outfile, level, namespace_="", name_="docParamName", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docParamName")
outfile.write(">")
self.exportChildren(outfile, level + 1, namespace_, name_)
outfile.write("%s%s>\n" % (namespace_, name_))
def exportAttributes(self, outfile, level, namespace_="", name_="docParamName"):
if self.direction is not None:
outfile.write(" direction=%s" % (quote_attrib(self.direction),))
def exportChildren(self, outfile, level, namespace_="", name_="docParamName"):
for item_ in self.content_:
item_.export(outfile, level, item_.name, namespace_)
def hasContent_(self):
if self.ref is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("direction"):
self.direction = attrs.get("direction").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref":
childobj_ = docRefTextType.factory()
childobj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "ref", childobj_
)
self.content_.append(obj_)
elif child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(
MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue
)
self.content_.append(obj_)
d = child_.parentNode.attributes.get("direction")
if d is not None:
self.content_.insert(
0,
self.mixedclass_(
MixedContainer.CategoryText,
MixedContainer.TypeNone,
"",
f"[{d.value}] ",
),
)
# end class docParamName
class docXRefSectType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, id=None, xreftitle=None, xrefdescription=None):
self.id = id
if xreftitle is None:
self.xreftitle = []
else:
self.xreftitle = xreftitle
self.xrefdescription = xrefdescription
def factory(*args_, **kwargs_):
if docXRefSectType.subclass:
return docXRefSectType.subclass(*args_, **kwargs_)
else:
return docXRefSectType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_xreftitle(self):
return self.xreftitle
def set_xreftitle(self, xreftitle):
self.xreftitle = xreftitle
def add_xreftitle(self, value):
self.xreftitle.append(value)
def insert_xreftitle(self, index, value):
self.xreftitle[index] = value
def get_xrefdescription(self):
return self.xrefdescription
def set_xrefdescription(self, xrefdescription):
self.xrefdescription = xrefdescription
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def export(self, outfile, level, namespace_="", name_="docXRefSectType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docXRefSectType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docXRefSectType"):
if self.id is not None:
outfile.write(
" id=%s"
% (
self.format_string(
quote_attrib(self.id).encode(ExternalEncoding), input_name="id"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docXRefSectType"):
for xreftitle_ in self.xreftitle:
showIndent(outfile, level)
outfile.write(
"<%sxreftitle>%s%sxreftitle>\n"
% (
namespace_,
self.format_string(
quote_xml(xreftitle_).encode(ExternalEncoding), input_name="xreftitle"
),
namespace_,
)
)
if self.xrefdescription:
self.xrefdescription.export(
outfile,
level,
namespace_,
name_="xrefdescription",
)
def hasContent_(self):
if self.xreftitle is not None or self.xrefdescription is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("id"):
self.id = attrs.get("id").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "xreftitle":
xreftitle_ = ""
for text__content_ in child_.childNodes:
xreftitle_ += text__content_.nodeValue
self.xreftitle.append(xreftitle_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "xrefdescription":
obj_ = descriptionType.factory()
obj_.build(child_)
self.set_xrefdescription(obj_)
# end class docXRefSectType
class docCopyType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, link=None, para=None, sect1=None, internal=None):
self.link = link
if para is None:
self.para = []
else:
self.para = para
if sect1 is None:
self.sect1 = []
else:
self.sect1 = sect1
self.internal = internal
def factory(*args_, **kwargs_):
if docCopyType.subclass:
return docCopyType.subclass(*args_, **kwargs_)
else:
return docCopyType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def get_sect1(self):
return self.sect1
def set_sect1(self, sect1):
self.sect1 = sect1
def add_sect1(self, value):
self.sect1.append(value)
def insert_sect1(self, index, value):
self.sect1[index] = value
def get_internal(self):
return self.internal
def set_internal(self, internal):
self.internal = internal
def get_link(self):
return self.link
def set_link(self, link):
self.link = link
def export(self, outfile, level, namespace_="", name_="docCopyType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docCopyType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docCopyType"):
if self.link is not None:
outfile.write(
" link=%s"
% (
self.format_string(
quote_attrib(self.link).encode(ExternalEncoding), input_name="link"
),
)
)
def exportChildren(self, outfile, level, namespace_="", name_="docCopyType"):
for para_ in self.para:
para_.export(outfile, level, namespace_, name_="para")
for sect1_ in self.sect1:
sect1_.export(outfile, level, namespace_, name_="sect1")
if self.internal:
self.internal.export(outfile, level, namespace_, name_="internal")
def hasContent_(self):
if self.para is not None or self.sect1 is not None or self.internal is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("link"):
self.link = attrs.get("link").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
obj_ = docParaType.factory()
obj_.build(child_)
self.para.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect1":
obj_ = docSect1Type.factory()
obj_.build(child_)
self.sect1.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal":
obj_ = docInternalType.factory()
obj_.build(child_)
self.set_internal(obj_)
# end class docCopyType
class docCharType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, char=None, valueOf_=""):
self.char = char
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if docCharType.subclass:
return docCharType.subclass(*args_, **kwargs_)
else:
return docCharType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_char(self):
return self.char
def set_char(self, char):
self.char = char
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docCharType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docCharType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docCharType"):
if self.char is not None:
outfile.write(" char=%s" % (quote_attrib(self.char),))
def exportChildren(self, outfile, level, namespace_="", name_="docCharType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("char"):
self.char = attrs.get("char").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docCharType
class docBlockQuoteType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, mixedclass_=None, para=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if para is None:
self.para = []
else:
self.para = para
def factory(*args_, **kwargs_):
if docBlockQuoteType.subclass:
return docBlockQuoteType.subclass(*args_, **kwargs_)
else:
return docBlockQuoteType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def export(self, outfile, level, namespace_="", name_="docBlockQuoteType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s%s"
% (
namespace_,
name_,
namespacedef_ and " " + namespacedef_ or "",
)
)
self.exportAttributes(outfile, level, namespace_, name_="docBlockQuoteType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write("/>\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docBlockQuoteType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docBlockQuoteType"):
for para_ in self.para:
para_.export(outfile, level, namespace_, name_="para")
def hasContent_(self):
if self.para:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
obj_ = docParaType.factory()
obj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", obj_
)
self.para.append(obj_)
# end class docBlockQuoteType
class docParBlockType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, mixedclass_=None, para=None):
if mixedclass_ is None:
self.mixedclass_ = MixedContainer
else:
self.mixedclass_ = mixedclass_
if para is None:
self.para = []
else:
self.para = para
def factory(*args_, **kwargs_):
if docParBlockType.subclass:
return docParBlockType.subclass(*args_, **kwargs_)
else:
return docParBlockType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_para(self):
return self.para
def set_para(self, para):
self.para = para
def add_para(self, value):
self.para.append(value)
def insert_para(self, index, value):
self.para[index] = value
def export(self, outfile, level, namespace_="", name_="docParBlockType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s%s"
% (
namespace_,
name_,
namespacedef_ and " " + namespacedef_ or "",
)
)
self.exportAttributes(outfile, level, namespace_, name_="docParBlockType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write("/>\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docParBlockType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docParBlockType"):
for para_ in self.para:
para_.export(outfile, level, namespace_, name_="para")
def hasContent_(self):
if self.para:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para":
obj_ = docParaType.factory()
obj_.build(child_)
obj_ = self.mixedclass_(
MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", obj_
)
self.para.append(obj_)
# end class docParBlockType
class docEmptyType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, valueOf_=""):
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if docEmptyType.subclass:
return docEmptyType.subclass(*args_, **kwargs_)
else:
return docEmptyType(*args_, **kwargs_)
factory = staticmethod(factory)
def getValueOf_(self):
return self.valueOf_
def setValueOf_(self, valueOf_):
self.valueOf_ = valueOf_
def export(self, outfile, level, namespace_="", name_="docEmptyType", namespacedef_=""):
showIndent(outfile, level)
outfile.write(
"<%s%s %s"
% (
namespace_,
name_,
namespacedef_,
)
)
self.exportAttributes(outfile, level, namespace_, name_="docEmptyType")
if self.hasContent_():
outfile.write(">\n")
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write("%s%s>\n" % (namespace_, name_))
else:
outfile.write(" />\n")
def exportAttributes(self, outfile, level, namespace_="", name_="docEmptyType"):
pass
def exportChildren(self, outfile, level, namespace_="", name_="docEmptyType"):
if self.valueOf_.find("![CDATA") > -1:
value = quote_xml("%s" % self.valueOf_)
value = value.replace("![CDATA", "")
outfile.write(value)
else:
outfile.write(quote_xml("%s" % self.valueOf_))
def hasContent_(self):
if self.valueOf_ is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
self.valueOf_ = ""
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
pass
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
self.valueOf_ += child_.nodeValue
elif child_.nodeType == Node.CDATA_SECTION_NODE:
self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]"
# end class docEmptyType
USAGE_TEXT = """
Usage: python .py [ -s ]
Options:
-s Use the SAX parser, not the minidom parser.
"""
def usage():
print(USAGE_TEXT)
sys.exit(1)
def parse(inFileName):
doc = minidom.parse(inFileName)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write('\n')
rootObj.export(sys.stdout, 0, name_="doxygen", namespacedef_="")
return rootObj
def parseString(inString):
doc = minidom.parseString(inString)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write('\n')
rootObj.export(sys.stdout, 0, name_="doxygen", namespacedef_="")
return rootObj
def parseLiteral(inFileName):
doc = minidom.parse(inFileName)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write("from compound import *\n\n")
sys.stdout.write("rootObj = doxygen(\n")
rootObj.exportLiteral(sys.stdout, 0, name_="doxygen")
sys.stdout.write(")\n")
return rootObj
def main():
args = sys.argv[1:]
if len(args) == 1:
parse(args[0])
else:
usage()
if __name__ == "__main__":
main()
# import pdb
# pdb.run('main()')
breathe-doc-breathe-10a36f3/breathe/parser/index.py 0000664 0000000 0000000 00000002636 14756414247 0022240 0 ustar 00root root 0000000 0000000 """
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from __future__ import annotations
from xml.dom import minidom
from xml.parsers.expat import ExpatError
from breathe.parser import indexsuper as supermod
class DoxygenTypeSub(supermod.DoxygenType):
node_type = "doxygen"
def __init__(self, version=None, compound=None):
supermod.DoxygenType.__init__(self, version, compound)
supermod.DoxygenType.subclass = DoxygenTypeSub
# end class DoxygenTypeSub
class CompoundTypeSub(supermod.CompoundType):
node_type = "compound"
def __init__(self, kind=None, refid=None, name="", member=None):
supermod.CompoundType.__init__(self, kind, refid, name, member)
supermod.CompoundType.subclass = CompoundTypeSub
# end class CompoundTypeSub
class MemberTypeSub(supermod.MemberType):
node_type = "member"
def __init__(self, kind=None, refid=None, name=""):
supermod.MemberType.__init__(self, kind, refid, name)
supermod.MemberType.subclass = MemberTypeSub
# end class MemberTypeSub
class ParseError(Exception):
pass
class FileIOError(Exception):
pass
def parse(inFilename):
try:
doc = minidom.parse(str(inFilename))
except OSError as e:
raise FileIOError(e)
except ExpatError as e:
raise ParseError(e)
rootNode = doc.documentElement
rootObj = supermod.DoxygenType.factory()
rootObj.build(rootNode)
return rootObj
breathe-doc-breathe-10a36f3/breathe/parser/indexsuper.py 0000664 0000000 0000000 00000025133 14756414247 0023314 0 ustar 00root root 0000000 0000000 #
# Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
#
from __future__ import annotations
import sys
from xml.dom import Node, minidom
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
# in a module named generatedssuper.py.
try:
from generatedssuper import GeneratedsSuper
except ImportError:
class GeneratedsSuper:
def format_string(self, input_data, input_name=""):
return input_data
def format_integer(self, input_data, input_name=""):
return "%d" % input_data
def format_float(self, input_data, input_name=""):
return "%f" % input_data
def format_double(self, input_data, input_name=""):
return "%e" % input_data
def format_boolean(self, input_data, input_name=""):
return "%s" % input_data
#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from https://ipython.org/.
#
## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
## banner = 'Dropping into IPython',
## exit_msg = 'Leaving Interpreter, back to program.')
# Then use the following line where and when you want to drop into the
# IPython shell:
# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit')
#
# Globals
#
ExternalEncoding = "ascii"
#
# Support/utility functions.
#
def showIndent(outfile, level):
for idx in range(level):
outfile.write(" ")
def quote_xml(inStr):
s1 = isinstance(inStr, str) and inStr or "%s" % inStr
s1 = s1.replace("&", "&")
s1 = s1.replace("<", "<")
s1 = s1.replace(">", ">")
return s1
def quote_attrib(inStr):
s1 = isinstance(inStr, str) and inStr or "%s" % inStr
s1 = s1.replace("&", "&")
s1 = s1.replace("<", "<")
s1 = s1.replace(">", ">")
if '"' in s1:
if "'" in s1:
s1 = '"%s"' % s1.replace('"', """)
else:
s1 = "'%s'" % s1
else:
s1 = '"%s"' % s1
return s1
def quote_python(inStr):
s1 = inStr
if s1.find("'") == -1:
if s1.find("\n") == -1:
return "'%s'" % s1
else:
return "'''%s'''" % s1
else:
if s1.find('"') != -1:
s1 = s1.replace('"', '\\"')
if s1.find("\n") == -1:
return '"%s"' % s1
else:
return '"""%s"""' % s1
class MixedContainer:
# Constants for category:
CategoryNone = 0
CategoryText = 1
CategorySimple = 2
CategoryComplex = 3
# Constants for content_type:
TypeNone = 0
TypeText = 1
TypeString = 2
TypeInteger = 3
TypeFloat = 4
TypeDecimal = 5
TypeDouble = 6
TypeBoolean = 7
def __init__(self, category, content_type, name, value):
self.category = category
self.content_type = content_type
self.name = name
self.value = value
def getCategory(self):
return self.category
def getContenttype(self, content_type):
return self.content_type
def getValue(self):
return self.value
def getName(self):
return self.name
class _MemberSpec:
def __init__(self, name="", data_type="", container=0):
self.name = name
self.data_type = data_type
self.container = container
def set_name(self, name):
self.name = name
def get_name(self):
return self.name
def set_data_type(self, data_type):
self.data_type = data_type
def get_data_type(self):
return self.data_type
def set_container(self, container):
self.container = container
def get_container(self):
return self.container
#
# Data representation classes.
#
class DoxygenType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, version=None, compound=None):
self.version = version
if compound is None:
self.compound = []
else:
self.compound = compound
def factory(*args_, **kwargs_):
if DoxygenType.subclass:
return DoxygenType.subclass(*args_, **kwargs_)
else:
return DoxygenType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_compound(self):
return self.compound
def set_compound(self, compound):
self.compound = compound
def add_compound(self, value):
self.compound.append(value)
def insert_compound(self, index, value):
self.compound[index] = value
def get_version(self):
return self.version
def set_version(self, version):
self.version = version
def hasContent_(self):
if self.compound is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("version"):
self.version = attrs.get("version").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "compound":
obj_ = CompoundType.factory()
obj_.build(child_)
self.compound.append(obj_)
# end class DoxygenType
class CompoundType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, kind=None, refid=None, name=None, member=None):
self.kind = kind
self.refid = refid
self.name = name
if member is None:
self.member = []
else:
self.member = member
def factory(*args_, **kwargs_):
if CompoundType.subclass:
return CompoundType.subclass(*args_, **kwargs_)
else:
return CompoundType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_name(self):
return self.name
def set_name(self, name):
self.name = name
def get_member(self):
return self.member
def set_member(self, member):
self.member = member
def add_member(self, value):
self.member.append(value)
def insert_member(self, index, value):
self.member[index] = value
def get_kind(self):
return self.kind
def set_kind(self, kind):
self.kind = kind
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("kind"):
self.kind = attrs.get("kind").value
if attrs.get("refid"):
self.refid = attrs.get("refid").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name":
name_ = ""
for text__content_ in child_.childNodes:
name_ += text__content_.nodeValue
self.name = name_
elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "member":
obj_ = MemberType.factory()
obj_.build(child_)
self.member.append(obj_)
# end class CompoundType
class MemberType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, kind=None, refid=None, name=None):
self.kind = kind
self.refid = refid
self.name = name
def factory(*args_, **kwargs_):
if MemberType.subclass:
return MemberType.subclass(*args_, **kwargs_)
else:
return MemberType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_name(self):
return self.name
def set_name(self, name):
self.name = name
def get_kind(self):
return self.kind
def set_kind(self, kind):
self.kind = kind
def get_refid(self):
return self.refid
def set_refid(self, refid):
self.refid = refid
def hasContent_(self):
if self.name is not None:
return True
else:
return False
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(":")[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get("kind"):
self.kind = attrs.get("kind").value
if attrs.get("refid"):
self.refid = attrs.get("refid").value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name":
name_ = ""
for text__content_ in child_.childNodes:
name_ += text__content_.nodeValue
self.name = name_
# end class MemberType
USAGE_TEXT = """
Usage: python .py [ -s ]
Options:
-s Use the SAX parser, not the minidom parser.
"""
def usage():
print(USAGE_TEXT)
sys.exit(1)
def parse(inFileName):
doc = minidom.parse(inFileName)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write('\n')
rootObj.export(sys.stdout, 0, name_="doxygenindex", namespacedef_="")
return rootObj
def parseString(inString):
doc = minidom.parseString(inString)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write('\n')
rootObj.export(sys.stdout, 0, name_="doxygenindex", namespacedef_="")
return rootObj
def parseLiteral(inFileName):
doc = minidom.parse(inFileName)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write("from index import *\n\n")
sys.stdout.write("rootObj = doxygenindex(\n")
rootObj.exportLiteral(sys.stdout, 0, name_="doxygenindex")
sys.stdout.write(")\n")
return rootObj
def main():
args = sys.argv[1:]
if len(args) == 1:
parse(args[0])
else:
usage()
if __name__ == "__main__":
main()
# import pdb
# pdb.run('main()')
breathe-doc-breathe-10a36f3/breathe/path_handler.py 0000664 0000000 0000000 00000001340 14756414247 0022255 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from sphinx.application import Sphinx
def includes_directory(file_path: str):
# Check for backslash or forward slash as we don't know what platform we're on and sometimes
# the doxygen paths will have forward slash even on Windows.
return bool(str(file_path).count("\\")) or bool(str(file_path).count("/"))
def resolve_path(app: Sphinx, directory: str, filename: str):
"""Returns a full path to the filename in the given directory assuming that if the directory
path is relative, then it is relative to the conf.py directory.
"""
return Path(app.confdir, directory, filename).resolve()
breathe-doc-breathe-10a36f3/breathe/process.py 0000664 0000000 0000000 00000007331 14756414247 0021310 0 ustar 00root root 0000000 0000000 from __future__ import annotations
import os
from pathlib import Path
from shlex import quote
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Callable
from breathe.project import AutoProjectInfo, ProjectInfoFactory
AUTOCFG_TEMPLATE = r"""
PROJECT_NAME = "{project_name}"
OUTPUT_DIRECTORY = {output_dir}
GENERATE_LATEX = NO
GENERATE_MAN = NO
GENERATE_RTF = NO
CASE_SENSE_NAMES = NO
INPUT = {input}
ENABLE_PREPROCESSING = YES
QUIET = YES
JAVADOC_AUTOBRIEF = YES
JAVADOC_AUTOBRIEF = NO
GENERATE_HTML = NO
GENERATE_XML = YES
ALIASES = rst="\verbatim embed:rst"
ALIASES += endrst="\endverbatim"
ALIASES += inlinerst="\verbatim embed:rst:inline"
{extra}
""".strip()
class ProjectData:
"""Simple handler for the files and project_info for each project."""
def __init__(self, auto_project_info: AutoProjectInfo, files: list[str]) -> None:
self.auto_project_info = auto_project_info
self.files = files
class AutoDoxygenProcessHandle:
def __init__(
self,
run_process: Callable,
write_file: Callable[[str | os.PathLike[str], str, str], None],
project_info_factory: ProjectInfoFactory,
) -> None:
self.run_process = run_process
self.write_file = write_file
self.project_info_factory = project_info_factory
def generate_xml(
self,
projects_source: dict[str, tuple[str, list[str]]],
doxygen_options: dict[str, str],
doxygen_aliases: dict[str, str],
) -> None:
project_files: dict[str, ProjectData] = {}
# First collect together all the files which need to be doxygen processed for each project
for project_name, file_structure in projects_source.items():
folder, contents = file_structure
auto_project_info = self.project_info_factory.create_auto_project_info(
project_name, folder
)
project_files[project_name] = ProjectData(auto_project_info, contents)
# Iterate over the projects and generate doxygen xml output for the files for each one into
# a directory in the Sphinx build area
for project_name, data in project_files.items():
project_path = self.process(
data.auto_project_info, data.files, doxygen_options, doxygen_aliases
)
project_info = data.auto_project_info.create_project_info(project_path)
self.project_info_factory.store_project_info_for_auto(project_name, project_info)
def process(
self,
auto_project_info: AutoProjectInfo,
files: list[str],
doxygen_options: dict[str, str],
doxygen_aliases: dict[str, str],
) -> str:
name = auto_project_info.name()
full_paths = [str(auto_project_info.abs_path_to_source_file(f)) for f in files]
options = "\n".join("%s=%s" % pair for pair in doxygen_options.items())
aliases = "\n".join(
f'ALIASES += {name}="{value}"' for name, value in doxygen_aliases.items()
)
cfg = AUTOCFG_TEMPLATE.format(
project_name=name,
output_dir=name,
input=" ".join(full_paths),
extra=f"{options}\n{aliases}",
)
build_dir = Path(auto_project_info.build_dir(), "breathe", "doxygen")
cfgfile = f"{name}.cfg"
self.write_file(build_dir, cfgfile, cfg)
# Shell-escape the cfg file name to try to avoid any issue where the name might include
# malicious shell character - We have to use the shell=True option to make it work on
# Windows. See issue #271
self.run_process(f"doxygen {quote(cfgfile)}", cwd=build_dir, shell=True)
return os.path.join(build_dir, name, "xml")
breathe-doc-breathe-10a36f3/breathe/project.py 0000664 0000000 0000000 00000016773 14756414247 0021312 0 ustar 00root root 0000000 0000000 from __future__ import annotations
import fnmatch
import os
from pathlib import Path
from typing import TYPE_CHECKING
from breathe.exception import BreatheError
if TYPE_CHECKING:
from sphinx.application import Sphinx
class ProjectError(BreatheError):
pass
class NoDefaultProjectError(ProjectError):
pass
class AutoProjectInfo:
"""Created as a temporary step in the automatic xml generation process"""
def __init__(self, app: Sphinx, name: str, source_path: str, build_dir: str, reference: str):
self.app = app
self._name = name
self._source_path = source_path
self._build_dir = build_dir
self._reference = reference
def name(self):
return self._name
def build_dir(self):
return self._build_dir
def abs_path_to_source_file(self, file_):
"""
Returns full path to the provide file assuming that the provided path is relative to the
projects conf.py directory as specified in the breathe_projects_source config variable.
"""
return Path(self.app.confdir, self._source_path, file_).resolve()
def create_project_info(self, project_path):
"""Creates a proper ProjectInfo object based on the information in this AutoProjectInfo"""
return ProjectInfo(self.app, self._name, project_path, self._source_path, self._reference)
class ProjectInfo:
def __init__(self, app: Sphinx, name: str, path: str, source_path: str, reference: str):
self.app = app
self._name = name
self._project_path = path
self._source_path = source_path
self._reference = reference
def name(self) -> str:
return self._name
def project_path(self):
return self._project_path
def source_path(self):
return self._source_path
def relative_path_to_xml_file(self, file_):
"""
Returns relative path from Sphinx documentation top-level source directory to the specified
file assuming that the specified file is a path relative to the doxygen xml output
directory.
"""
# os.path.join does the appropriate handling if _project_path is an absolute path
full_xml_project_path = os.path.join(self.app.confdir, self._project_path, file_)
return os.path.relpath(full_xml_project_path, self.app.srcdir)
def sphinx_abs_path_to_file(self, file_):
"""
Prepends os.path.sep to the value returned by relative_path_to_file.
This is to match Sphinx's concept of an absolute path which starts from the top-level source
directory of the project.
"""
return os.path.sep + self.relative_path_to_xml_file(file_)
def reference(self):
return self._reference
def domain_for_file(self, file_: str) -> str:
extension = file_.split(".")[-1]
try:
domain = self.app.config.breathe_domain_by_extension[extension]
except KeyError:
domain = ""
domainFromFilePattern = self.app.config.breathe_domain_by_file_pattern
for pattern, pattern_domain in domainFromFilePattern.items():
if fnmatch.fnmatch(file_, pattern):
domain = pattern_domain
return domain
class ProjectInfoFactory:
def __init__(self, app: Sphinx):
self.app = app
# note: don't access self.app.config now, as we are instantiated at setup-time.
# Assume general build directory is the parent of the doctree directory.
# This can be overridden with the breathe_build_directory config variable
self._default_build_dir = os.path.dirname(os.path.normpath(app.doctreedir))
self.project_count = 0
self.project_info_store: dict[str, ProjectInfo] = {}
self.project_info_for_auto_store: dict[str, AutoProjectInfo] = {}
self.auto_project_info_store: dict[str, AutoProjectInfo] = {}
@property
def build_dir(self) -> str:
config = self.app.config
if config.breathe_build_directory:
return config.breathe_build_directory
else:
return self._default_build_dir
def default_path(self) -> str:
config = self.app.config
if not config.breathe_default_project:
raise NoDefaultProjectError(
"No breathe_default_project config setting to fall back on "
"for directive with no 'project' or 'path' specified."
)
try:
return config.breathe_projects[config.breathe_default_project]
except KeyError:
raise ProjectError(
(
"breathe_default_project value '%s' does not seem to be a valid key for the "
"breathe_projects dictionary"
)
% config.breathe_default_project
)
def create_project_info(self, options) -> ProjectInfo:
config = self.app.config
name = config.breathe_default_project
if "project" in options:
try:
path = config.breathe_projects[options["project"]]
name = options["project"]
except KeyError:
raise ProjectError(
"Unable to find project '%s' in breathe_projects dictionary"
% options["project"]
)
elif "path" in options:
path = options["path"]
else:
path = self.default_path()
try:
return self.project_info_store[path]
except KeyError:
reference = name
if not name:
name = "project%s" % self.project_count
reference = path
self.project_count += 1
project_info = ProjectInfo(self.app, name, path, "NoSourcePath", reference)
self.project_info_store[path] = project_info
return project_info
def store_project_info_for_auto(self, name: str, project_info: AutoProjectInfo) -> None:
"""Stores the project info by name for later extraction by the auto directives.
Stored separately to the non-auto project info objects as they should never overlap.
"""
self.project_info_for_auto_store[name] = project_info
def retrieve_project_info_for_auto(self, options) -> AutoProjectInfo:
"""Retrieves the project info by name for later extraction by the auto directives.
Looks for the 'project' entry in the options dictionary. This is a less than ideal API but
it is designed to match the use of 'create_project_info' above for which it makes much more
sense.
"""
name = options.get("project", self.app.config.breathe_default_project)
if name is None:
raise NoDefaultProjectError(
"No breathe_default_project config setting to fall back on "
"for directive with no 'project' or 'path' specified."
)
return self.project_info_for_auto_store[name]
def create_auto_project_info(self, name: str, source_path) -> AutoProjectInfo:
key = source_path
try:
return self.auto_project_info_store[key]
except KeyError:
reference = name
if not name:
name = "project%s" % self.project_count
reference = source_path
self.project_count += 1
auto_project_info = AutoProjectInfo(
self.app, name, source_path, self.build_dir, reference
)
self.auto_project_info_store[key] = auto_project_info
return auto_project_info
breathe-doc-breathe-10a36f3/breathe/renderer/ 0000775 0000000 0000000 00000000000 14756414247 0021062 5 ustar 00root root 0000000 0000000 breathe-doc-breathe-10a36f3/breathe/renderer/__init__.py 0000664 0000000 0000000 00000003413 14756414247 0023174 0 ustar 00root root 0000000 0000000 from __future__ import annotations
import textwrap
from docutils import nodes
def format_parser_error(name, error, filename, state, lineno, do_unicode_warning):
warning = '%s: Unable to parse xml file "%s". ' % (name, filename)
explanation = "Reported error: %s. " % error
unicode_explanation_text = ""
unicode_explanation = []
if do_unicode_warning:
unicode_explanation_text = (
textwrap.dedent(
"""
Parsing errors are often due to unicode errors associated with the encoding of the original
source files. Doxygen propagates invalid characters from the input source files to the
output xml."""
)
.strip()
.replace("\n", " ")
)
unicode_explanation = [nodes.paragraph("", "", nodes.Text(unicode_explanation_text))]
return [
nodes.warning(
"",
nodes.paragraph("", "", nodes.Text(warning)),
nodes.paragraph("", "", nodes.Text(explanation)),
*unicode_explanation,
),
state.document.reporter.warning(
warning + explanation + unicode_explanation_text, line=lineno
),
]
class RenderContext:
def __init__(
self, node_stack, mask_factory, directive_args, domain: str = "", child: bool = False
) -> None:
self.node_stack = node_stack
self.mask_factory = mask_factory
self.directive_args = directive_args
self.domain = domain
self.child = child
def create_child_context(self, data_object) -> RenderContext:
node_stack = self.node_stack[:]
node_stack.insert(0, self.mask_factory.mask(data_object))
return RenderContext(node_stack, self.mask_factory, self.directive_args, self.domain, True)
breathe-doc-breathe-10a36f3/breathe/renderer/filter.py 0000664 0000000 0000000 00000116017 14756414247 0022727 0 ustar 00root root 0000000 0000000 """
Filters
-------
Filters are an interesting and somewhat challenging part of the code base. They are used for
two different purposes:
- To figure out which nodes in the xml hierarchy to start rendering from. These are called
'finder filters' or 'content filters'. This is done before rendering starts.
- To figure out which nodes under a selected nodes in the xml hierarchy should be rendered. These
are called 'render filters'. This is done during the render process with a test in the
DoxygenToRstRendererFactory.
General Implementation
~~~~~~~~~~~~~~~~~~~~~~
Filters are essential just tests to see if a node matches certain parameters that are needed to
decide whether or not to include it in some output.
As these filters are declared once and then used on multiple nodes, we model them as object
hierarchies that encapsulate the required test and take a node (with its context) and return True or
False.
If you wanted a test which figures out if a node has the node_type 'memberdef' you might create the
following object hierarchy:
node_is_memberdef = InFilter(AttributeAccessor(Node(), 'node_type'), ['memberdef'])
This reads from the inside out, as get the node, then get the node_type attribute from it, and see
if the value of the attribute is in the list ['memberdef'].
The Node() is called a 'Selector'. Parent() is also a selector. It means given the current context,
work with the parent of the current node rather than the node itself. This allows you to frame tests
in terms of a node's parent as well as the node which helps when we want nodes with particular
parents and not others.
The AttributeAccessor() is called an 'Accessor'. It wraps up an attempt to access a particular
attribute on the selected node. There are quite a few different specific accessors but they can
mostly be generalised with the AttributeAccessor. This code has evolved over time and initially the
implementation involved specific accessor classes (which are still used in large parts of it.)
The InFilter() is unsurprisingly called a 'Filter'. There are lots of different filters. Filters
either act on the results of Accessors or on the results of other Filters and they always return
True or False. The AndFilter and the OrFilter can be used to combine the outputs of other Filters
with logical 'and' and 'or' operations.
You can build up some pretty complex expressions with this level of freedom as you
might imagine. The complexity is unfortunate but necessary as the nature of filtering the xml is
quite complex.
Finder Filters
~~~~~~~~~~~~~~
The implementation of the filters can change a little depending on how they are called. Finder
filters are called from the breathe.finder.doxygen.index and breathe.finder.doxygen.compound files.
They are called like this:
# Descend down the hierarchy
# ...
if filter_.allow(node_stack):
matches.append(self.data_object)
# Keep on descending
# ...
This means that the result of the filter does not stop us descending down the hierarchy and testing
more nodes. This simplifies the filters as they only have to return true for the exact nodes they
are interested in and they don't have to worry about allowing the iteration down the hierarchy to
continue for nodes which don't match.
An example of a finder filter is:
AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compound"]),
InFilter(KindAccessor(Node()), ["group"]),
InFilter(NameAccessor(Node()), ["mygroup"])
)
This says, return True for all the nodes of node_type 'compound' with 'kind' set to 'group' which
have the name 'mygroup'. It returns false for everything else, but when a node matching this is
found then it is added to the matches list by the code above.
It is therefore relatively easy to write finder filters. If you have two separate node filters like
the one above and you want to match on both of them then you can do:
OrFilter(
node_filter_1,
node_filter_2
)
To combine them.
Content Filters
~~~~~~~~~~~~~~~
Content filters are harder than the finder filters as they are responsible for halting the iteration
down the hierarchy if they return false. This means that if you're interested in memberdef nodes
with a particular attribute then you have to check for that but also include a clause which allows
all other non-memberdef nodes to pass through as you don't want to interrupt them.
This means you end up with filters like this:
OrFilter(
AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compound"]),
InFilter(KindAccessor(Node()), ["group"]),
InFilter(NameAccessor(Node()), ["mygroup"])
),
NotFilter(
AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compound"]),
InFilter(KindAccessor(Node()), ["group"]),
)
)
)
Which is to say that we want to let through a compound, with kind group, with name 'mygroup' but
we're also happy if the node is **not** a compound with kind group. Really we just don't want to let
through any compounds with kind group with name other than 'mygroup'. As such, we can rephrase this
as:
NotFilter(
AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compound"]),
InFilter(KindAccessor(Node()), ["group"]),
NotFilter(InFilter(NameAccessor(Node()), ["mygroup"]))
)
)
Using logical manipulation we can rewrite this as:
OrFilter(
NotFilter(InFilter(NodeTypeAccessor(Node()), ["compound"])),
NotFilter(InFilter(KindAccessor(Node()), ["group"])),
InFilter(NameAccessor(Node()), ["mygroup"])
)
We reads: allow if it isn't a compound, or if it is a compound but doesn't have a 'kind' of 'group',
but if it is a compound and has a 'kind' of 'group then only allow it if it is named 'mygroup'.
Helper Syntax
~~~~~~~~~~~~~
Some of these filter declarations get a little awkward to read and write. They are not laid out in
manner which reads smoothly. Additional helper methods and operator overloads have been introduced
to help with this.
AttributeAccessor objects are created in property methods on the Selector classes so:
node.kind
Where node has been declared as a Node() instance. Results in:
AttributeAccessor(Node(), 'kind')
The '==' and '!=' operators on the Accessors have been overloaded to return the appropriate filters
so that:
node.kind == 'group'
Results in:
InFilter(AttributeAccessor(Node(), 'kind'), ['kind'])
We also override the binary 'and' (&), 'or' (|) and 'not' (~) operators in Python to apply
AndFilters, OrFilters and NotFilters respectively. We have to override the binary operators as they
actual 'and', 'or' and 'not' operators cannot be overridden. So:
(node.node_type == 'compound') & (node.name == 'mygroup')
Translates to:
AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compound"])),
InFilter(NameAccessor(Node()), ["mygroup"])
)
Where the former is hopefully more readable without sacrificing too much to the abstract magic of
operator overloads.
Operator Precedences & Extra Parenthesis
''''''''''''''''''''''''''''''''''''''''
As the binary operators have a lower operator precedence than '==' and '!=' and some other operators
we have to include additional parenthesis in the expressions to group them as we want. So instead of
writing:
node.node_type == 'compound' & node.name == 'mygroup'
We have to write:
(node.node_type == 'compound') & (node.name == 'mygroup')
"""
from __future__ import annotations
import os
from typing import TYPE_CHECKING
from breathe import path_handler
if TYPE_CHECKING:
from typing import Any, Callable
from sphinx.application import Sphinx
class UnrecognisedKindError(Exception):
pass
###############################################################################
# Selectors
###############################################################################
class Selector:
def __call__(self, node_stack):
raise NotImplementedError
@property
def node_type(self):
return NodeTypeAccessor(self)
@property
def kind(self):
return AttributeAccessor(self, "kind")
@property
def node_name(self):
return AttributeAccessor(self, "node_name")
@property
def name(self):
return AttributeAccessor(self, "name")
@property
def briefdescription(self):
return AttributeAccessor(self, "briefdescription")
@property
def detaileddescription(self):
return AttributeAccessor(self, "detaileddescription")
@property
def prot(self):
return AttributeAccessor(self, "prot")
@property
def valueOf(self):
return AttributeAccessor(self, "valueOf_")
@property
def id(self):
return AttributeAccessor(self, "id")
class Ancestor(Selector):
def __init__(self, generations):
self.generations = generations
def __call__(self, node_stack):
return node_stack[self.generations]
class Parent(Selector):
def __call__(self, node_stack):
return node_stack[1]
class Node(Selector):
def __call__(self, node_stack):
return node_stack[0]
###############################################################################
# Accessors
###############################################################################
class Accessor:
def __init__(self, selector: Selector) -> None:
self.selector = selector
def __call__(self, node_stack):
raise NotImplementedError
def __eq__(self, value: str) -> InFilter: # type: ignore[override]
return InFilter(self, [value])
def __ne__(self, value: str) -> NotFilter: # type: ignore[override]
return NotFilter(InFilter(self, [value]))
def is_one_of(self, collection: list[str]) -> InFilter:
return InFilter(self, collection)
def has_content(self) -> HasContentFilter:
return HasContentFilter(self)
def endswith(self, options: list[str]) -> EndsWithFilter:
return EndsWithFilter(self, options)
class NameAccessor(Accessor):
def __call__(self, node_stack) -> str:
return self.selector(node_stack).name
class NodeNameAccessor(Accessor):
"""Check the .node_name member which is declared on refTypeSub nodes
It distinguishes between innerclass, innernamespace, etc.
"""
def __call__(self, node_stack) -> str:
return self.selector(node_stack).node_name
class NodeTypeAccessor(Accessor):
def __call__(self, node_stack) -> str:
data_object = self.selector(node_stack)
try:
return data_object.node_type
except AttributeError as e:
# Horrible hack to silence errors on filtering unicode objects
# until we fix the parsing
if type(data_object) is str:
return "unicode"
else:
raise e
class KindAccessor(Accessor):
def __call__(self, node_stack) -> str:
return self.selector(node_stack).kind
class AttributeAccessor(Accessor):
"""Returns the value of a particular attribute on the selected node.
AttributeAccessor(Node(), 'name') returns the value of ``node.name``.
"""
def __init__(self, selector: Selector, attribute_name: str) -> None:
super().__init__(selector)
self.attribute_name = attribute_name
def __call__(self, node_stack) -> Any:
return getattr(self.selector(node_stack), self.attribute_name)
class LambdaAccessor(Accessor):
def __init__(self, selector: Selector, func: Callable[[Any], str]):
super().__init__(selector)
self.func = func
def __call__(self, node_stack):
return self.func(self.selector(node_stack))
class NamespaceAccessor(Accessor):
def __call__(self, node_stack):
return self.selector(node_stack).namespaces
###############################################################################
# Filters
###############################################################################
class Filter:
def allow(self, node_stack) -> bool:
raise NotImplementedError
def __and__(self, other: Filter) -> AndFilter:
return AndFilter(self, other)
def __or__(self, other: Filter) -> OrFilter:
return OrFilter(self, other)
def __invert__(self) -> NotFilter:
return NotFilter(self)
class HasAncestorFilter(Filter):
def __init__(self, generations: int) -> None:
self.generations = generations
def allow(self, node_stack) -> bool:
return len(node_stack) > self.generations
class HasContentFilter(Filter):
def __init__(self, accessor: Accessor):
self.accessor = accessor
def allow(self, node_stack) -> bool:
"""Detects if the node in questions has an empty .content_ property."""
return bool(self.accessor(node_stack).content_)
class EndsWithFilter(Filter):
"""Detects if the string result of the accessor ends with any of the strings in the ``options``
iterable parameter.
"""
def __init__(self, accessor: Accessor, options: list[str]):
self.accessor = accessor
self.options = options
def allow(self, node_stack) -> bool:
string = self.accessor(node_stack)
for entry in self.options:
if string.endswith(entry):
return True
return False
class InFilter(Filter):
"""Checks if what is returned from the accessor is 'in' in the members"""
def __init__(self, accessor: Accessor, members: list[str]) -> None:
self.accessor = accessor
self.members = members
def allow(self, node_stack) -> bool:
name = self.accessor(node_stack)
return name in self.members
class GlobFilter(Filter):
def __init__(self, accessor: Accessor, glob):
self.accessor = accessor
self.glob = glob
def allow(self, node_stack) -> bool:
text = self.accessor(node_stack)
return self.glob.match(text)
class FilePathFilter(Filter):
def __init__(self, accessor: Accessor, target_file: str):
self.accessor = accessor
self.target_file = target_file
def allow(self, node_stack) -> bool:
location = self.accessor(node_stack).file
if path_handler.includes_directory(self.target_file):
# If the target_file contains directory separators then
# match against the same length at the end of the location
#
location_match = location[-len(self.target_file) :]
return location_match == self.target_file
else:
# If there are no separators, match against the whole filename
# at the end of the location
#
# This is to prevent "Util.cpp" matching "PathUtil.cpp"
#
location_basename = os.path.basename(location)
return location_basename == self.target_file
class NamespaceFilter(Filter):
def __init__(self, namespace_accessor: Accessor, name_accessor: Accessor):
self.namespace_accessor = namespace_accessor
self.name_accessor = name_accessor
def allow(self, node_stack) -> bool:
namespaces = self.namespace_accessor(node_stack)
name = self.name_accessor(node_stack)
try:
# strip out any template arguments before splitting on '::', to
# avoid errors if a template specialization has qualified arguments
# (see examples/specific/cpp_ns_template_specialization)
cleaned_name, sep, rest = name.partition("<")
namespace, name = cleaned_name.rsplit("::", 1)
name += sep + rest
except ValueError:
namespace, name = "", name
return namespace in namespaces
class OpenFilter(Filter):
def allow(self, node_stack) -> bool:
return True
class ClosedFilter(Filter):
def allow(self, node_stack) -> bool:
return False
class NotFilter(Filter):
def __init__(self, child_filter: Filter):
self.child_filter = child_filter
def allow(self, node_stack) -> bool:
return not self.child_filter.allow(node_stack)
class AndFilter(Filter):
def __init__(self, *filters: Filter):
self.filters = filters
def allow(self, node_stack) -> bool:
# If any filter returns False then return False
for filter_ in self.filters:
if not filter_.allow(node_stack):
return False
return True
class OrFilter(Filter):
"""Provides a short-cutted 'or' operation between two filters"""
def __init__(self, *filters: Filter):
self.filters = filters
def allow(self, node_stack) -> bool:
# If any filter returns True then return True
for filter_ in self.filters:
if filter_.allow(node_stack):
return True
return False
class IfFilter(Filter):
def __init__(self, condition, if_true, if_false):
self.condition = condition
self.if_true = if_true
self.if_false = if_false
def allow(self, node_stack) -> bool:
if self.condition.allow(node_stack):
return self.if_true.allow(node_stack)
else:
return self.if_false.allow(node_stack)
class Gather(Filter):
def __init__(self, accessor: Accessor, names: list[str]):
self.accessor = accessor
self.names = names
def allow(self, node_stack) -> bool:
self.names.extend(self.accessor(node_stack))
return False
###############################################################################
# Other stuff
###############################################################################
class Glob:
def __init__(self, method, pattern):
self.method = method
self.pattern = pattern
def match(self, name):
return self.method(name, self.pattern)
class FilterFactory:
# C++ style public entries
public_kinds = {
"public-type",
"public-func",
"public-attrib",
"public-slot",
"public-static-func",
"public-static-attrib",
}
def __init__(self, app: Sphinx) -> None:
self.app = app
def create_render_filter(self, kind: str, options: dict[str, Any]) -> Filter:
"""Render filter for group & namespace blocks"""
if kind not in ["group", "page", "namespace"]:
raise UnrecognisedKindError(kind)
# Generate new dictionary from defaults
filter_options = dict.fromkeys(self.app.config.breathe_default_members, "")
# Update from the actual options
filter_options.update(options)
# Convert the doxygengroup members flag (which just stores None as the value) to an empty
# string to allow the create_class_member_filter to process it properly
if "members" in filter_options:
filter_options["members"] = ""
if "desc-only" in filter_options:
return self._create_description_filter(True, "compounddef", options)
node = Node()
grandparent = Ancestor(2)
has_grandparent = HasAncestorFilter(2)
non_class_memberdef = (
has_grandparent
& (grandparent.node_type == "compounddef")
& (grandparent.kind != "class")
& (grandparent.kind != "struct")
& (grandparent.kind != "interface")
& (node.node_type == "memberdef")
)
return (
(self.create_class_member_filter(filter_options) | non_class_memberdef)
& self.create_innerclass_filter(filter_options)
& self.create_outline_filter(filter_options)
)
def create_class_filter(self, target: str, options: dict[str, Any]) -> Filter:
"""Content filter for classes based on various directive options"""
# Generate new dictionary from defaults
filter_options = dict.fromkeys(self.app.config.breathe_default_members, "")
# Update from the actual options
filter_options.update(options)
return AndFilter(
self.create_class_member_filter(filter_options),
self.create_innerclass_filter(filter_options, outerclass=target),
self.create_outline_filter(filter_options),
self.create_show_filter(filter_options),
)
def create_innerclass_filter(self, options: dict[str, Any], outerclass: str = "") -> Filter:
"""
:param outerclass: Should be the class/struct being target by the directive calling this
code. If it is a group or namespace directive then it should be left
blank. It is used when looking for names listed in the :members: option.
The name should include any additional namespaces that the target class
is in.
"""
node = Node()
node_is_innerclass = (node.node_type == "ref") & (node.node_name == "innerclass")
parent = Parent()
parent_is_compounddef = parent.node_type == "compounddef"
parent_is_class = parent.kind.is_one_of(["class", "struct", "interface"])
allowed = set()
all_options = {
"protected-members": "protected",
"private-members": "private",
}
for option, scope in all_options.items():
if option in options:
allowed.add(scope)
node_is_innerclass_in_class = parent_is_compounddef & parent_is_class & node_is_innerclass
public_innerclass_filter = ClosedFilter()
if "members" in options:
if options["members"].strip():
text = options["members"]
prefix = ("%s::" % outerclass) if outerclass else ""
# Matches sphinx-autodoc behaviour of comma separated values
members = {f"{prefix}{x.strip()}" for x in text.split(",")}
node_valueOf_is_in_members = node.valueOf.is_one_of(members)
# Accept any nodes which don't have a "sectiondef" as a parent or, if they do, only
# accept them if their names are in the members list
public_innerclass_filter = ~node_is_innerclass_in_class | node_valueOf_is_in_members
else:
allowed.add("public")
node_is_in_allowed_scope = node.prot.is_one_of(allowed)
innerclass = ~node_is_innerclass_in_class | node_is_in_allowed_scope
description = self._create_description_filter(True, "compounddef", options)
# Put parent check last as we only want to check parents of innerclass's otherwise we have
# to check the parent's type as well
return innerclass | public_innerclass_filter | description
def create_show_filter(self, options: dict[str, Any]) -> Filter:
"""Currently only handles the header-file entry"""
try:
text = options["show"]
except KeyError:
# Allow through everything except the header-file includes nodes
return OrFilter(
NotFilter(InFilter(NodeTypeAccessor(Parent()), ["compounddef"])),
NotFilter(InFilter(NodeTypeAccessor(Node()), ["inc"])),
)
if text == "header-file":
# Allow through everything, including header-file includes
return OpenFilter()
# Allow through everything except the header-file includes nodes
return OrFilter(
NotFilter(InFilter(NodeTypeAccessor(Parent()), ["compounddef"])),
NotFilter(InFilter(NodeTypeAccessor(Node()), ["inc"])),
)
def _create_description_filter(
self, allow: bool, level: str, options: dict[str, Any]
) -> Filter:
"""Whether or not we allow descriptions is determined by the calling function and we just do
whatever the 'allow' function parameter tells us.
"""
node = Node()
node_is_description = node.node_type == "description"
parent = Parent()
parent_is_level = parent.node_type == level
# Nothing with a parent that's a sectiondef
description_filter = ~parent_is_level
# Let through any description children of sectiondefs if we output any kind members
if allow:
description_filter = (parent_is_level & node_is_description) | ~parent_is_level
return description_filter
def _create_public_members_filter(self, options: dict[str, Any]) -> Filter:
node = Node()
node_is_memberdef = node.node_type == "memberdef"
node_is_public = node.prot == "public"
parent = Parent()
parent_is_sectiondef = parent.node_type == "sectiondef"
# Nothing with a parent that's a sectiondef
is_memberdef = parent_is_sectiondef & node_is_memberdef
public_members_filter = ~is_memberdef
# If the user has specified the 'members' option with arguments then we only pay attention
# to that and not to any other member settings
if "members" in options:
if options["members"].strip():
text = options["members"]
# Matches sphinx-autodoc behaviour of comma separated values
members = {x.strip() for x in text.split(",")}
node_name_is_in_members = node.name.is_one_of(members)
# Accept any nodes which don't have a "sectiondef" as a parent or, if they do, only
# accept them if their names are in the members list
public_members_filter = (
parent_is_sectiondef & node_name_is_in_members
) | ~parent_is_sectiondef
else:
# Select anything that doesn't have a parent which is a sectiondef, or, if it does,
# only select the public ones
public_members_filter = (is_memberdef & node_is_public) | ~is_memberdef
return public_members_filter
def _create_non_public_members_filter(
self, prot: str, option_name: str, options: dict[str, Any]
) -> Filter:
"""'prot' is the doxygen xml term for 'public', 'protected' and 'private' categories."""
node = Node()
node_is_memberdef = node.node_type == "memberdef"
node_is_public = node.prot == prot
parent = Parent()
parent_is_sectiondef = parent.node_type == "sectiondef"
# Nothing with a parent that's a sectiondef
is_memberdef = parent_is_sectiondef & node_is_memberdef
filter_ = ~is_memberdef
if option_name in options:
# Allow anything that isn't a memberdef, or if it is only allow the public ones
filter_ = ~is_memberdef | node_is_public
return filter_
def _create_undoc_members_filter(self, options: dict[str, Any]) -> Filter:
node = Node()
node_is_memberdef = node.node_type == "memberdef"
node_has_description = (
node.briefdescription.has_content() | node.detaileddescription.has_content()
)
# Allow anything that isn't a memberdef, or if it is only allow the ones with a description
undoc_members_filter = ~node_is_memberdef | node_has_description
if "undoc-members" in options:
undoc_members_filter = OpenFilter()
return undoc_members_filter
def create_class_member_filter(self, options: dict[str, Any]) -> Filter:
"""Content filter based on :members: and :private-members: classes"""
# I can't fully explain the filtering of descriptions here. More testing needed to figure
# out when it is needed. This approach reflects the old code that was here but it wasn't
# commented (my fault.) I wonder if maybe the public and private declarations themselves can
# be documented and we need to let them through. Not sure.
allow = (
"members" in options or "protected-members" in options or "private-members" in options
)
description = self._create_description_filter(allow, "sectiondef", options)
# Create all necessary filters and combine them
public_members = self._create_public_members_filter(options)
protected_members = self._create_non_public_members_filter(
"protected", "protected-members", options
)
private_members = self._create_non_public_members_filter(
"private", "private-members", options
)
undoc_members = self._create_undoc_members_filter(options)
# Allow any public/private members which also fit the undoc filter and all the descriptions
allowed_members = (public_members | protected_members | private_members) & undoc_members
return allowed_members | description
def create_outline_filter(self, options: dict[str, Any]) -> Filter:
if "outline" in options:
node = Node()
return ~node.node_type.is_one_of(["description", "inc"])
else:
return OpenFilter()
def create_file_filter(self, filename: str, options: dict[str, Any]) -> Filter:
valid_names: list[str] = []
filter_ = AndFilter(
NotFilter(
# Gather the "namespaces" attribute from the
# compounddef for the file we're rendering and
# store the information in the "valid_names" list
#
# Gather always returns false, so, combined with
# the NotFilter this chunk always returns true and
# so does not affect the result of the filtering
AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compounddef"]),
InFilter(KindAccessor(Node()), ["file"]),
FilePathFilter(LambdaAccessor(Node(), lambda x: x.location), filename),
Gather(LambdaAccessor(Node(), lambda x: x.namespaces), valid_names),
)
),
NotFilter(
# Take the valid_names and everytime we handle an
# innerclass or innernamespace, check that its name
# was one of those initial valid names so that we
# never end up rendering a namespace or class that
# wasn't in the initial file. Notably this is
# required as the location attribute for the
# namespace in the xml is unreliable.
AndFilter(
InFilter(NodeTypeAccessor(Parent()), ["compounddef"]),
InFilter(NodeTypeAccessor(Node()), ["ref"]),
InFilter(NodeNameAccessor(Node()), ["innerclass", "innernamespace"]),
NotFilter(
InFilter(
LambdaAccessor(Node(), lambda x: x.content_[0].getValue()), valid_names
)
),
)
),
NotFilter(
# Ignore innerclasses and innernamespaces that are inside a
# namespace that is going to be rendered as they will be
# rendered with that namespace and we don't want them twice
AndFilter(
InFilter(NodeTypeAccessor(Parent()), ["compounddef"]),
InFilter(NodeTypeAccessor(Node()), ["ref"]),
InFilter(NodeNameAccessor(Node()), ["innerclass", "innernamespace"]),
NamespaceFilter(
NamespaceAccessor(Parent()),
LambdaAccessor(Node(), lambda x: x.content_[0].getValue()),
),
)
),
NotFilter(
# Ignore memberdefs from files which are different to
# the one we're rendering. This happens when we have to
# cross into a namespace xml file which has entries
# from multiple files in it
AndFilter(
InFilter(NodeTypeAccessor(Node()), ["memberdef"]),
NotFilter(
FilePathFilter(LambdaAccessor(Node(), lambda x: x.location), filename)
),
)
),
NotFilter(
# Ignore compounddefs which are from another file
# (normally means classes and structs which are in a
# namespace that we have other interests in) but only
# check it if the compounddef is not a namespace
# itself, as for some reason compounddefs for
# namespaces are registered with just a single file
# location even if they namespace is spread over
# multiple files
AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compounddef"]),
NotFilter(InFilter(KindAccessor(Node()), ["namespace"])),
NotFilter(
FilePathFilter(LambdaAccessor(Node(), lambda x: x.location), filename)
),
)
),
)
return AndFilter(self.create_outline_filter(options), filter_)
def create_content_filter(self, kind: str, options: dict[str, Any]) -> Filter:
"""Returns a filter which matches the contents of the or namespace but not the group or
namespace name or description.
This allows the groups to be used to structure sections of the documentation rather than to
structure and further document groups of documentation
As a finder/content filter we only need to match exactly what we're interested in.
"""
if kind not in ["group", "page", "namespace"]:
raise UnrecognisedKindError(kind)
node = Node()
# Filter for public memberdefs
node_is_memberdef = node.node_type == "memberdef"
node_is_public = node.prot == "public"
public_members = node_is_memberdef & node_is_public
# Filter for public innerclasses
parent = Parent()
parent_is_compounddef = parent.node_type == "compounddef"
parent_is_class = parent.kind == kind
node_is_innerclass = (node.node_type == "ref") & (node.node_name == "innerclass")
node_is_public = node.prot == "public"
public_innerclass = (
parent_is_compounddef & parent_is_class & node_is_innerclass & node_is_public
)
return public_members | public_innerclass
def create_index_filter(self, options: dict[str, Any]) -> Filter:
filter_ = AndFilter(
NotFilter(
AndFilter(
InFilter(NodeTypeAccessor(Parent()), ["compounddef"]),
InFilter(NodeTypeAccessor(Node()), ["ref"]),
InFilter(NodeNameAccessor(Node()), ["innerclass", "innernamespace"]),
)
),
NotFilter(
AndFilter(
InFilter(NodeTypeAccessor(Parent()), ["compounddef"]),
InFilter(KindAccessor(Parent()), ["group"]),
InFilter(NodeTypeAccessor(Node()), ["sectiondef"]),
InFilter(KindAccessor(Node()), ["func"]),
)
),
)
return AndFilter(self.create_outline_filter(options), filter_)
def create_open_filter(self) -> Filter:
"""Returns a completely open filter which matches everything"""
return OpenFilter()
def create_id_filter(self, node_type: str, refid: str) -> Filter:
node = Node()
return (node.node_type == node_type) & (node.id == refid)
def create_file_finder_filter(self, filename: str) -> Filter:
filter_ = AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compounddef"]),
InFilter(KindAccessor(Node()), ["file"]),
FilePathFilter(LambdaAccessor(Node(), lambda x: x.location), filename),
)
return filter_
def create_member_finder_filter(self, namespace: str, name: str, kind: str) -> Filter:
"""Returns a filter which looks for a member with the specified name and kind."""
node = Node()
parent = Parent()
node_matches = (node.node_type == "member") & (node.kind == kind) & (node.name == name)
if namespace:
parent_matches = (
(parent.node_type == "compound")
& (
(parent.kind == "namespace")
| (parent.kind == "class")
| (parent.kind == "struct")
| (parent.kind == "interface")
)
& (parent.name == namespace)
)
return parent_matches & node_matches
else:
is_implementation_file = parent.name.endswith(
self.app.config.breathe_implementation_filename_extensions
)
parent_is_compound = parent.node_type == "compound"
parent_is_file = (parent.kind == "file") & (~is_implementation_file)
parent_is_not_file = parent.kind != "file"
return (parent_is_compound & parent_is_file & node_matches) | (
parent_is_compound & parent_is_not_file & node_matches
)
def create_function_and_all_friend_finder_filter(self, namespace: str, name: str) -> Filter:
parent = Parent()
parent_is_compound = parent.node_type == "compound"
parent_is_group = parent.kind == "group"
function_filter = self.create_member_finder_filter(namespace, name, "function")
friend_filter = self.create_member_finder_filter(namespace, name, "friend")
# Get matching functions but only ones where the parent is not a group. We want to skip
# function entries in groups as we'll find the same functions in a file's xml output
# elsewhere and having more than one match is confusing for our logic later on.
return (function_filter | friend_filter) & ~(parent_is_compound & parent_is_group)
def create_enumvalue_finder_filter(self, name: str) -> Filter:
"""Returns a filter which looks for an enumvalue with the specified name."""
node = Node()
return (node.node_type == "enumvalue") & (node.name == name)
def create_compound_finder_filter(self, name: str, kind: str) -> Filter:
"""Returns a filter which looks for a compound with the specified name and kind."""
node = Node()
return (node.node_type == "compound") & (node.kind == kind) & (node.name == name)
def create_finder_filter(self, kind: str, name: str) -> Filter:
"""Returns a filter which looks for the compound node from the index which is a group node
(kind=group) and has the appropriate name
The compound node should reference the group file which we can parse for the group
contents.
"""
if kind == "group":
filter_ = AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compound"]),
InFilter(KindAccessor(Node()), ["group"]),
InFilter(NameAccessor(Node()), [name]),
)
elif kind == "page":
filter_ = AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compound"]),
InFilter(KindAccessor(Node()), ["page"]),
InFilter(NameAccessor(Node()), [name]),
)
else:
# Assume kind == 'namespace'
filter_ = AndFilter(
InFilter(NodeTypeAccessor(Node()), ["compound"]),
InFilter(KindAccessor(Node()), ["namespace"]),
InFilter(NameAccessor(Node()), [name]),
)
return filter_
breathe-doc-breathe-10a36f3/breathe/renderer/mask.py 0000664 0000000 0000000 00000004000 14756414247 0022361 0 ustar 00root root 0000000 0000000 """
Masks
=====
Masks are related to filters. Filters can block the processing of particular parts of the xml
hierarchy but they can only work on node level. If the part of the xml hierarchy that you want to
filter out is read in as an instance of one of the classes in parser/doxygen/*.py then you can use
the filters. However, if you want to filter out an attribute from one of the nodes (and some of the
xml child nodes are read in as attributes on their parents) then you can't use a filter.
We introduce the Mask's to fulfil this need. The masks are designed to be applied to a particular
node type and to limit the access to particular attributes on the node. For example, then
NoParameterNamesMask wraps a node a returns all its standard attributes but returns None for the
'declname' and 'defname' attributes.
Currently the Mask functionality is only used for the text signature rendering for doing function
matching.
"""
from __future__ import annotations
class NoParameterNamesMask:
def __init__(self, data_object) -> None:
self.data_object = data_object
def __getattr__(self, attr):
if attr in ["declname", "defname", "defval"]:
return None
return getattr(self.data_object, attr)
class MaskFactoryBase:
def mask(self, data_object):
raise NotImplementedError
class MaskFactory(MaskFactoryBase):
def __init__(self, lookup):
self.lookup = lookup
def mask(self, data_object):
try:
node_type = data_object.node_type
except AttributeError as e:
# Horrible hack to silence errors on filtering unicode objects
# until we fix the parsing
if isinstance(data_object, str):
node_type = "unicode"
else:
raise e
if node_type in self.lookup:
Mask = self.lookup[node_type]
return Mask(data_object)
return data_object
class NullMaskFactory(MaskFactoryBase):
def mask(self, data_object):
return data_object
breathe-doc-breathe-10a36f3/breathe/renderer/sphinxrenderer.py 0000664 0000000 0000000 00000317413 14756414247 0024505 0 ustar 00root root 0000000 0000000 from __future__ import annotations
from pathlib import Path
from docutils import nodes
from docutils.parsers.rst.states import Text
from docutils.statemachine import StringList, UnexpectedIndentationError
from sphinx import addnodes
from sphinx.domains import c, cpp, python
from sphinx.ext.graphviz import graphviz
from sphinx.util import url_re
from sphinx.util.nodes import nested_parse_with_titles
try:
from sphinxcontrib import phpdomain as php # type: ignore[import-untyped]
except ImportError:
php = None
try:
from sphinx_csharp import csharp as cs # type: ignore[import-untyped]
except ImportError:
cs = None
import re
import textwrap
from typing import TYPE_CHECKING, Callable, Union, cast
if TYPE_CHECKING:
from typing import Any
from docutils.nodes import Node, TextElement
from sphinx.application import Sphinx
from sphinx.directives import ObjectDescription
from breathe.parser import DoxygenCompoundParser, compound, compoundsuper
from breathe.project import ProjectInfo
from breathe.renderer import RenderContext
from breathe.renderer.filter import Filter
from breathe.renderer.target import TargetHandler
ContentCallback = Callable[[addnodes.desc_content], None]
Declarator = Union[addnodes.desc_signature, addnodes.desc_signature_line]
DeclaratorCallback = Callable[[Declarator], None]
_debug_indent = 0
class WithContext:
def __init__(self, parent: SphinxRenderer, context: RenderContext):
self.context = context
self.parent = parent
self.previous = None
def __enter__(self):
assert self.previous is None
self.previous = self.parent.context
self.parent.set_context(self.context)
return self
def __exit__(self, et, ev, bt):
self.parent.context = self.previous
self.previous = None
class BaseObject:
# Use this class as the first base class to make sure the overrides are used.
# Set the content_callback attribute to a function taking a docutils node.
def transform_content(self, contentnode: addnodes.desc_content) -> None:
super().transform_content(contentnode) # type: ignore[misc]
callback = getattr(self, "breathe_content_callback", None)
if callback is None:
return
callback(contentnode)
# ----------------------------------------------------------------------------
class CPPClassObject(BaseObject, cpp.CPPClassObject):
pass
class CPPUnionObject(BaseObject, cpp.CPPUnionObject):
pass
class CPPFunctionObject(BaseObject, cpp.CPPFunctionObject):
pass
class CPPMemberObject(BaseObject, cpp.CPPMemberObject):
pass
class CPPTypeObject(BaseObject, cpp.CPPTypeObject):
pass
class CPPConceptObject(BaseObject, cpp.CPPConceptObject):
pass
class CPPEnumObject(BaseObject, cpp.CPPEnumObject):
pass
class CPPEnumeratorObject(BaseObject, cpp.CPPEnumeratorObject):
pass
# ----------------------------------------------------------------------------
class CStructObject(BaseObject, c.CStructObject):
pass
class CUnionObject(BaseObject, c.CUnionObject):
pass
class CFunctionObject(BaseObject, c.CFunctionObject):
pass
class CMemberObject(BaseObject, c.CMemberObject):
pass
class CTypeObject(BaseObject, c.CTypeObject):
pass
class CEnumObject(BaseObject, c.CEnumObject):
pass
class CEnumeratorObject(BaseObject, c.CEnumeratorObject):
pass
class CMacroObject(BaseObject, c.CMacroObject):
pass
# ----------------------------------------------------------------------------
class PyFunction(BaseObject, python.PyFunction):
pass
class PyAttribute(BaseObject, python.PyAttribute):
pass
class PyClasslike(BaseObject, python.PyClasslike):
pass
# ----------------------------------------------------------------------------
# Create multi-inheritance classes to merge BaseObject from Breathe with
# classes from phpdomain.
# We use capitalization (and the namespace) to differentiate between the two
if php is not None:
class PHPNamespaceLevel(BaseObject, php.PhpNamespacelevel):
"""Description of a PHP item *in* a namespace (not the space itself)."""
pass
class PHPClassLike(BaseObject, php.PhpClasslike):
pass
class PHPClassMember(BaseObject, php.PhpClassmember):
pass
class PHPGlobalLevel(BaseObject, php.PhpGloballevel):
pass
# ----------------------------------------------------------------------------
if cs is not None:
class CSharpCurrentNamespace(BaseObject, cs.CSharpCurrentNamespace):
pass
class CSharpNamespacePlain(BaseObject, cs.CSharpNamespacePlain):
pass
class CSharpClass(BaseObject, cs.CSharpClass):
pass
class CSharpStruct(BaseObject, cs.CSharpStruct):
pass
class CSharpInterface(BaseObject, cs.CSharpInterface):
pass
class CSharpInherits(BaseObject, cs.CSharpInherits):
pass
class CSharpMethod(BaseObject, cs.CSharpMethod):
pass
class CSharpVariable(BaseObject, cs.CSharpVariable):
pass
class CSharpProperty(BaseObject, cs.CSharpProperty):
pass
class CSharpEvent(BaseObject, cs.CSharpEvent):
pass
class CSharpEnum(BaseObject, cs.CSharpEnum):
pass
class CSharpEnumValue(BaseObject, cs.CSharpEnumValue):
pass
class CSharpAttribute(BaseObject, cs.CSharpAttribute):
pass
class CSharpIndexer(BaseObject, cs.CSharpIndexer):
pass
class CSharpXRefRole(BaseObject, cs.CSharpXRefRole):
pass
# ----------------------------------------------------------------------------
class DomainDirectiveFactory:
# A mapping from node kinds to domain directives and their names.
cpp_classes = {
"variable": (CPPMemberObject, "var"),
"class": (CPPClassObject, "class"),
"struct": (CPPClassObject, "struct"),
"interface": (CPPClassObject, "class"),
"function": (CPPFunctionObject, "function"),
"friend": (CPPFunctionObject, "function"),
"signal": (CPPFunctionObject, "function"),
"slot": (CPPFunctionObject, "function"),
"concept": (CPPConceptObject, "concept"),
"enum": (CPPEnumObject, "enum"),
"enum-class": (CPPEnumObject, "enum-class"),
"typedef": (CPPTypeObject, "type"),
"using": (CPPTypeObject, "type"),
"union": (CPPUnionObject, "union"),
"namespace": (CPPTypeObject, "type"),
"enumvalue": (CPPEnumeratorObject, "enumerator"),
"define": (CMacroObject, "macro"),
}
c_classes = {
"variable": (CMemberObject, "var"),
"function": (CFunctionObject, "function"),
"define": (CMacroObject, "macro"),
"struct": (CStructObject, "struct"),
"union": (CUnionObject, "union"),
"enum": (CEnumObject, "enum"),
"enumvalue": (CEnumeratorObject, "enumerator"),
"typedef": (CTypeObject, "type"),
}
python_classes = {
# TODO: PyFunction is meant for module-level functions
# and PyAttribute is meant for class attributes, not module-level variables.
# Somehow there should be made a distinction at some point to get the correct
# index-text and whatever other things are different.
"function": (PyFunction, "function"),
"variable": (PyAttribute, "attribute"),
"class": (PyClasslike, "class"),
"namespace": (PyClasslike, "class"),
}
if php is not None:
php_classes = {
"function": (PHPNamespaceLevel, "function"),
"class": (PHPClassLike, "class"),
"attr": (PHPClassMember, "attr"),
"method": (PHPClassMember, "method"),
"global": (PHPGlobalLevel, "global"),
}
php_classes_default = php_classes["class"] # Directive when no matching ones were found
if cs is not None:
cs_classes = {
# 'doxygen-name': (CSharp class, key in CSharpDomain.object_types)
"namespace": (CSharpNamespacePlain, "namespace"),
"class": (CSharpClass, "class"),
"struct": (CSharpStruct, "struct"),
"interface": (CSharpInterface, "interface"),
"function": (CSharpMethod, "function"),
"method": (CSharpMethod, "method"),
"variable": (CSharpVariable, "var"),
"property": (CSharpProperty, "property"),
"event": (CSharpEvent, "event"),
"enum": (CSharpEnum, "enum"),
"enumvalue": (CSharpEnumValue, "enumerator"),
"attribute": (CSharpAttribute, "attr"),
# Fallback to cpp domain
"typedef": (CPPTypeObject, "type"),
}
@staticmethod
def create(domain: str, args) -> ObjectDescription:
cls = cast("type[ObjectDescription]", None)
name = cast("str", None)
if domain == "c":
cls, name = DomainDirectiveFactory.c_classes[args[0]]
elif domain == "py":
cls, name = DomainDirectiveFactory.python_classes[args[0]]
elif php is not None and domain == "php":
separators = php.separators
arg_0 = args[0]
if any(separators["method"] in n for n in args[1]):
if any(separators["attr"] in n for n in args[1]):
arg_0 = "attr"
else:
arg_0 = "method"
else:
if arg_0 == "variable":
arg_0 = "global"
if arg_0 in DomainDirectiveFactory.php_classes:
cls, name = DomainDirectiveFactory.php_classes[arg_0] # type: ignore[assignment]
else:
cls, name = DomainDirectiveFactory.php_classes_default # type: ignore[assignment]
elif cs is not None and domain == "cs":
cls, name = DomainDirectiveFactory.cs_classes[args[0]]
else:
domain = "cpp"
cls, name = DomainDirectiveFactory.cpp_classes[args[0]] # type: ignore[assignment]
# Replace the directive name because domain directives don't know how to handle
# Breathe's "doxygen" directives.
assert ":" not in name
args = [domain + ":" + name] + args[1:]
return cls(*args)
class NodeFinder(nodes.SparseNodeVisitor):
"""Find the Docutils desc_signature declarator and desc_content nodes."""
def __init__(self, document):
super().__init__(document)
self.declarator = None
self.content = None
def visit_desc_signature(self, node):
# Find the last signature node because it contains the actual declarator
# rather than "template <...>". In Sphinx 1.4.1 we'll be able to use sphinx_cpp_tagname:
# https://github.com/breathe-doc/breathe/issues/242
self.declarator = node
def visit_desc_signature_line(self, node):
# In sphinx 1.5, there is now a desc_signature_line node within the desc_signature
# This should be used instead
self.declarator = node
def visit_desc_content(self, node):
self.content = node
# The SparseNodeVisitor seems to not actually be universally Sparse,
# but only for nodes known to Docutils.
# So if there are extensions with new node types in the content,
# then the visitation will fail.
# We anyway don't need to visit the actual content, so skip it.
raise nodes.SkipChildren
def intersperse(iterable, delimiter):
it = iter(iterable)
yield next(it)
for x in it:
yield delimiter
yield x
def get_param_decl(param):
def to_string(node):
"""Convert Doxygen node content to a string."""
result = []
if node is not None:
for p in node.content_:
value = p.value
if not isinstance(value, str):
value = value.valueOf_
result.append(value)
return " ".join(result)
param_type = to_string(param.type_)
param_name = param.declname or param.defname
if not param_name:
param_decl = param_type
else:
param_decl, number_of_subs = re.subn(
r"(\((?:\w+::)*[*&]+)(\))", r"\g<1>" + param_name + r"\g<2>", param_type
)
if number_of_subs == 0:
param_decl = param_type + " " + param_name
if param.array:
param_decl += param.array
if param.defval:
param_decl += " = " + to_string(param.defval)
return param_decl
def get_definition_without_template_args(data_object):
"""
Return data_object.definition removing any template arguments from the class name in the member
function. Otherwise links to classes defined in the same template are not generated correctly.
For example in 'Result