././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1675629870.5175488 doxypypy-0.8.8.7/0000775000175000017500000000000014370012457012274 5ustar00ericeric././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/LICENSE.txt0000664000175000017500000004307614150504334014125 0ustar00ericericGNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/MANIFEST.in0000664000175000017500000000005014150504334014021 0ustar00ericericinclude README.rst include LICENSE.txt ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1675629870.5175488 doxypypy-0.8.8.7/PKG-INFO0000664000175000017500000002022414370012457013371 0ustar00ericericMetadata-Version: 2.1 Name: doxypypy Version: 0.8.8.7 Summary: A Doxygen filter for Python Home-page: https://github.com/Feneric/doxypypy Author: Eric W. Brown Keywords: Doxygen filter Python documentation Classifier: Development Status :: 4 - Beta Classifier: Environment :: Console Classifier: Environment :: Plugins Classifier: Intended Audience :: Developers Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2) Classifier: Natural Language :: English Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX Classifier: Operating System :: Unix Classifier: Programming Language :: Python Classifier: Topic :: Software Development :: Documentation Provides-Extra: testing License-File: LICENSE.txt doxypypy ======== *A more Pythonic version of doxypy, a Doxygen filter for Python.* Intent ------ For now Doxygen_ has limited support for Python. It recognizes Python comments, but otherwise treats the language as being more or less like Java. It doesn't understand basic Python syntax constructs like docstrings, keyword arguments, generators, nested functions, decorators, or lambda expressions. It likewise doesn't understand conventional constructs like doctests or ZOPE-style interfaces. It does however support inline filters that can be used to make input source code a little more like what it's expecting. The excellent doxypy_ makes it possible to embed Doxygen commands in Python docstrings, and have those docstrings converted to Doxygen-recognized comments on the fly per Doxygen's regular input filtering process. It however does not address any of the other previously mentioned areas of difficulty. This project started off as a fork of doxypy but quickly became quite distinct. It shares little (if any) of the same code at this point (but maintains the original license just in case). It is meant to support all the same command line options as doxypy, but handle additional Python syntax beyond docstrings. Additional Syntax Supported --------------------------- Python can have functions and classes within both functions and classes. Doxygen best understands this concept via its notion of namespaces. This filter thus can supply Doxygen tags marking namespaces on every function and class. This addresses the issue of Doxygen merging inner functions' documentation with the documentation of the parent. Python class members whose names begin with a double-underscore are mangled and kept private by the language. Doxygen does not understand this natively yet, so this filter additionally provides Doxygen tags to label such variables as private. Python frequently embeds doctests within docstrings. This filter makes it trivial to mark off such sections of the docstring so they get displayed as code. ZOPE-style interfaces overload class definitions to be interface definitions, use embedded variable assignments to identify attributes, and use specific function calls to indicate interface adherence. Furthermore, they frequently don't have any code beyond their docstrings, so naively removing docstrings would result in broken Python. This filter has basic understanding of these interfaces and treats them accordingly, supplying Doxygen tags as appropriate. Fundamentally Python docstrings are meant for humans and not machines, and ought not to have special mark-up beyond conventional structured text. This filter heuristically examines Python docstrings, and ones like the sample for complex in `PEP 257`_ or that generally follow the stricter `Google Python Style Guide`_ will get appropriate Doxygen tags automatically added. How It Works ------------ This project takes a radically different approach than doxypy. Rather than use regular expressions tied to a state machine to figure out syntax, Python's own Abstract Syntax Tree module is used to extract items of interest. If the `autobrief` option is enabled, docstrings are parsed via a set of regular expressions and a producer / consumer pair of coroutines. Example ------- This filter will correctly process code like the following working (albeit contrived) example: .. code-block:: python def myfunction(arg1, arg2, kwarg='whatever.'): """ Does nothing more than demonstrate syntax. This is an example of how a Pythonic human-readable docstring can get parsed by doxypypy and marked up with Doxygen commands as a regular input filter to Doxygen. Args: arg1: A positional argument. arg2: Another positional argument. Kwargs: kwarg: A keyword argument. Returns: A string holding the result. Raises: ZeroDivisionError, AssertionError, & ValueError. Examples: >>> myfunction(2, 3) '5 - 0, whatever.' >>> myfunction(5, 0, 'oops.') Traceback (most recent call last): ... ZeroDivisionError: integer division or modulo by zero >>> myfunction(4, 1, 'got it.') '5 - 4, got it.' >>> myfunction(23.5, 23, 'oh well.') Traceback (most recent call last): ... AssertionError >>> myfunction(5, 50, 'too big.') Traceback (most recent call last): ... ValueError """ assert isinstance(arg1, int) if arg2 > 23: raise ValueError return '{0} - {1}, {2}'.format(arg1 + arg2, arg1 / arg2, kwarg) There are a few points to note: 1. No special tags are used. Best practice human-readable section headers are enough. 2. Some flexibility is allowed. Most common names for sections are accepted, and items and descriptions may be separated by either colons or dashes. 3. The brief must be the first item and be no longer than one line. 4. Everything thrown into an examples section will be treated as code, so it's the perfect place for doctests. Additional more comprehensive examples can be found in the test area. Installing doxypypy ------------------- One can use either :code:`pip` or :code:`easy_install` for installation. Running either: .. code-block:: shell pip install doxypypy or: .. code-block:: shell easy_install doxypypy with administrator privileges should do the trick. Many Linux distributions have packages for doxypypy, so if you are using Linux you may find it more convenient to use :code:`aptitude`, :code:`apt`, :code:`apt-get`, :code:`yum`, :code:`dnf`, etc. as appropriate for your system to install the version tested by the distribution maintainer. It will often be available as separate packages for both Python 3 and Python 2. Previewing doxypypy Output -------------------------- After successful installation, doxypypy can be run from the command line to preview the filtered results with: .. code-block:: shell doxypypy -a -c file.py Typically you'll want to redirect output to a file for viewing in a text editor: .. code-block:: shell doxypypy -a -c file.py > file.py.out Invoking doxypypy from Doxygen ------------------------------ To make Doxygen run your Python code through doxypypy, set the FILTER\_PATTERNS tag in your Doxyfile as follows: .. code-block:: shell FILTER_PATTERNS = *.py=py_filter `py_filter` must be available in your path as a shell script (or Windows batch file). If you wish to run `py_filter` in a particular directory you can include the full or relative path. For Unix-like operating systems, `py_filter` should like something like this: .. code-block:: shell #!/bin/bash doxypypy -a -c $1 In Windows, the batch file should be named `py_filter.bat`, and need only contain the one line: .. code-block:: shell doxypypy -a -c %1 Running Doxygen as usual should now run all Python code through doxypypy. Be sure to carefully browse the Doxygen output the first time to make sure that Doxygen properly found and executed doxypypy. .. _Doxygen: http://www.stack.nl/~dimitri/doxygen/ .. _doxypy: https://github.com/Feneric/doxypy .. _PEP 257: http://www.python.org/dev/peps/pep-0257/ .. _Google Python Style Guide: https://google.github.io/styleguide/pyguide.html?showone=Comments#Comments ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638048846.0 doxypypy-0.8.8.7/README.rst0000664000175000017500000001655014150522116013764 0ustar00ericericdoxypypy ======== *A more Pythonic version of doxypy, a Doxygen filter for Python.* Intent ------ For now Doxygen_ has limited support for Python. It recognizes Python comments, but otherwise treats the language as being more or less like Java. It doesn't understand basic Python syntax constructs like docstrings, keyword arguments, generators, nested functions, decorators, or lambda expressions. It likewise doesn't understand conventional constructs like doctests or ZOPE-style interfaces. It does however support inline filters that can be used to make input source code a little more like what it's expecting. The excellent doxypy_ makes it possible to embed Doxygen commands in Python docstrings, and have those docstrings converted to Doxygen-recognized comments on the fly per Doxygen's regular input filtering process. It however does not address any of the other previously mentioned areas of difficulty. This project started off as a fork of doxypy but quickly became quite distinct. It shares little (if any) of the same code at this point (but maintains the original license just in case). It is meant to support all the same command line options as doxypy, but handle additional Python syntax beyond docstrings. Additional Syntax Supported --------------------------- Python can have functions and classes within both functions and classes. Doxygen best understands this concept via its notion of namespaces. This filter thus can supply Doxygen tags marking namespaces on every function and class. This addresses the issue of Doxygen merging inner functions' documentation with the documentation of the parent. Python class members whose names begin with a double-underscore are mangled and kept private by the language. Doxygen does not understand this natively yet, so this filter additionally provides Doxygen tags to label such variables as private. Python frequently embeds doctests within docstrings. This filter makes it trivial to mark off such sections of the docstring so they get displayed as code. ZOPE-style interfaces overload class definitions to be interface definitions, use embedded variable assignments to identify attributes, and use specific function calls to indicate interface adherence. Furthermore, they frequently don't have any code beyond their docstrings, so naively removing docstrings would result in broken Python. This filter has basic understanding of these interfaces and treats them accordingly, supplying Doxygen tags as appropriate. Fundamentally Python docstrings are meant for humans and not machines, and ought not to have special mark-up beyond conventional structured text. This filter heuristically examines Python docstrings, and ones like the sample for complex in `PEP 257`_ or that generally follow the stricter `Google Python Style Guide`_ will get appropriate Doxygen tags automatically added. How It Works ------------ This project takes a radically different approach than doxypy. Rather than use regular expressions tied to a state machine to figure out syntax, Python's own Abstract Syntax Tree module is used to extract items of interest. If the `autobrief` option is enabled, docstrings are parsed via a set of regular expressions and a producer / consumer pair of coroutines. Example ------- This filter will correctly process code like the following working (albeit contrived) example: .. code-block:: python def myfunction(arg1, arg2, kwarg='whatever.'): """ Does nothing more than demonstrate syntax. This is an example of how a Pythonic human-readable docstring can get parsed by doxypypy and marked up with Doxygen commands as a regular input filter to Doxygen. Args: arg1: A positional argument. arg2: Another positional argument. Kwargs: kwarg: A keyword argument. Returns: A string holding the result. Raises: ZeroDivisionError, AssertionError, & ValueError. Examples: >>> myfunction(2, 3) '5 - 0, whatever.' >>> myfunction(5, 0, 'oops.') Traceback (most recent call last): ... ZeroDivisionError: integer division or modulo by zero >>> myfunction(4, 1, 'got it.') '5 - 4, got it.' >>> myfunction(23.5, 23, 'oh well.') Traceback (most recent call last): ... AssertionError >>> myfunction(5, 50, 'too big.') Traceback (most recent call last): ... ValueError """ assert isinstance(arg1, int) if arg2 > 23: raise ValueError return '{0} - {1}, {2}'.format(arg1 + arg2, arg1 / arg2, kwarg) There are a few points to note: 1. No special tags are used. Best practice human-readable section headers are enough. 2. Some flexibility is allowed. Most common names for sections are accepted, and items and descriptions may be separated by either colons or dashes. 3. The brief must be the first item and be no longer than one line. 4. Everything thrown into an examples section will be treated as code, so it's the perfect place for doctests. Additional more comprehensive examples can be found in the test area. Installing doxypypy ------------------- One can use either :code:`pip` or :code:`easy_install` for installation. Running either: .. code-block:: shell pip install doxypypy or: .. code-block:: shell easy_install doxypypy with administrator privileges should do the trick. Many Linux distributions have packages for doxypypy, so if you are using Linux you may find it more convenient to use :code:`aptitude`, :code:`apt`, :code:`apt-get`, :code:`yum`, :code:`dnf`, etc. as appropriate for your system to install the version tested by the distribution maintainer. It will often be available as separate packages for both Python 3 and Python 2. Previewing doxypypy Output -------------------------- After successful installation, doxypypy can be run from the command line to preview the filtered results with: .. code-block:: shell doxypypy -a -c file.py Typically you'll want to redirect output to a file for viewing in a text editor: .. code-block:: shell doxypypy -a -c file.py > file.py.out Invoking doxypypy from Doxygen ------------------------------ To make Doxygen run your Python code through doxypypy, set the FILTER\_PATTERNS tag in your Doxyfile as follows: .. code-block:: shell FILTER_PATTERNS = *.py=py_filter `py_filter` must be available in your path as a shell script (or Windows batch file). If you wish to run `py_filter` in a particular directory you can include the full or relative path. For Unix-like operating systems, `py_filter` should like something like this: .. code-block:: shell #!/bin/bash doxypypy -a -c $1 In Windows, the batch file should be named `py_filter.bat`, and need only contain the one line: .. code-block:: shell doxypypy -a -c %1 Running Doxygen as usual should now run all Python code through doxypypy. Be sure to carefully browse the Doxygen output the first time to make sure that Doxygen properly found and executed doxypypy. .. _Doxygen: http://www.stack.nl/~dimitri/doxygen/ .. _doxypy: https://github.com/Feneric/doxypy .. _PEP 257: http://www.python.org/dev/peps/pep-0257/ .. _Google Python Style Guide: https://google.github.io/styleguide/pyguide.html?showone=Comments#Comments ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1675629870.509549 doxypypy-0.8.8.7/doxypypy/0000775000175000017500000000000014370012457014201 5ustar00ericeric././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/__init__.py0000664000175000017500000000000014150504334016274 0ustar00ericeric././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638149262.0 doxypypy-0.8.8.7/doxypypy/doxypypy.py0000775000175000017500000015531714151026216016472 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- """ Filters Python code for use with Doxygen, using a syntax-aware approach. Rather than implementing a partial Python parser with regular expressions, this script uses Python's own abstract syntax tree walker to isolate meaningful constructs. It passes along namespace information so Doxygen can construct a proper tree for nested functions, classes, and methods. It understands bed lump variables are by convention private. It groks Zope-style Python interfaces. It can automatically turn PEP 257 compliant that follow the more restrictive Google style guide into appropriate Doxygen tags, and is even aware of doctests. """ from __future__ import print_function from ast import NodeVisitor, parse, iter_fields, AST, Name, get_docstring from argparse import ArgumentParser from re import compile as regexpCompile, IGNORECASE, MULTILINE from types import GeneratorType from sys import argv, stderr, exit as sysExit from os.path import basename, getsize from os import linesep, sep from string import whitespace from codecs import BOM_UTF8, open as codecsOpen from codeop import compile_command from chardet import detect def coroutine(func): """Implement the coroutine pattern as a decorator.""" def __start(*args, **kwargs): """Automatically calls next() on the internal generator function.""" __cr = func(*args, **kwargs) next(__cr) return __cr return __start class AstWalker(NodeVisitor): """ A walker that'll recursively progress through an AST. Given an abstract syntax tree for Python code, walk through all the nodes looking for significant types (for our purposes we only care about module starts, class definitions, function definitions, variable assignments, and function calls, as all the information we want to pass to Doxygen is found within these constructs). If the autobrief option is set, it further attempts to parse docstrings to create appropriate Doxygen tags. """ # We have a number of regular expressions that we use. They don't # vary across instances and so are compiled directly in the class # definition. __indentRE = regexpCompile(r'^(\s*)\S') __newlineRE = regexpCompile(r'^#', MULTILINE) __blanklineRE = regexpCompile(r'^\s*$') __docstrMarkerRE = regexpCompile(r"\s*([uUbB]*[rR]?(['\"]{3}))") __docstrOneLineRE = regexpCompile(r"\s*[uUbB]*[rR]?(['\"]{3})(.+)\1") __implementsRE = regexpCompile(r"^(\s*)(?:zope\.)?(?:interface\.)?" r"(?:module|class|directly)?" r"(?:Provides|Implements)\(\s*(.+)\s*\)", IGNORECASE) __classRE = regexpCompile(r"^\s*class\s+(\S+)\s*\((\S+)\):") __interfaceRE = regexpCompile(r"^\s*class\s+(\S+)\s*\(\s*(?:zope\.)?" r"(?:interface\.)?" r"Interface\s*\)\s*:", IGNORECASE) __attributeRE = regexpCompile(r"^(\s*)(\S+)\s*=\s*(?:zope\.)?" r"(?:interface\.)?" r"Attribute\s*\(['\"]{1,3}(.*)['\"]{1,3}\)", IGNORECASE) __singleLineREs = { ' @author: ': regexpCompile(r"^(\s*Authors?:\s*)(.*)$", IGNORECASE), ' @copyright ': regexpCompile(r"^(\s*Copyright:\s*)(.*)$", IGNORECASE), ' @date ': regexpCompile(r"^(\s*Date:\s*)(.*)$", IGNORECASE), ' @file ': regexpCompile(r"^(\s*File:\s*)(.*)$", IGNORECASE), ' @version: ': regexpCompile(r"^(\s*Version:\s*)(.*)$", IGNORECASE), ' @note ': regexpCompile(r"^(\s*Note:\s*)(.*)$", IGNORECASE), ' @warning ': regexpCompile(r"^(\s*Warning:\s*)(.*)$", IGNORECASE) } __argsStartRE = regexpCompile(r"^(\s*(?:(?:Keyword\s+)?" r"(?:A|Kwa)rg(?:ument)?|Attribute)s?" r"\s*:\s*)$", IGNORECASE) __argsRE = regexpCompile(r"^\s*(?P\w+)\s*(?P\(?\S*\)?)?\s*" r"(?:-|:)+\s+(?P.+)$") __returnsStartRE = regexpCompile(r"^\s*(?:Return|Yield)s:\s*$", IGNORECASE) __raisesStartRE = regexpCompile(r"^\s*(Raises|Exceptions|See Also):\s*$", IGNORECASE) __listRE = regexpCompile(r"^\s*(([\w\.]+),\s*)+(&|and)?\s*([\w\.]+)$") __singleListItemRE = regexpCompile(r'^\s*([\w\.]+)\s*$') __listItemRE = regexpCompile(r'([\w\.]+),?\s*') __examplesStartRE = regexpCompile(r"^\s*(?:Example|Doctest)s?:\s*$", IGNORECASE) __sectionStartRE = regexpCompile(r"^\s*(([A-Z]\w* ?){1,2}):\s*$") # The error line should match traceback lines, error exception lines, and # (due to a weird behavior of codeop) single word lines. __errorLineRE = regexpCompile(r"^\s*((?:\S+Error|Traceback.*):?\s*(.*)|@?[\w.]+)\s*$", IGNORECASE) # searching for reStructuredText field lists # __rst_paramRE = regexpCompile(r"^\s*(?::param(eter)?|:arg(ument)?|:key(word)?)" # r"\s*(\w*)\s*(\w*)\s*:(.*)") # search for :param, :parameter, # :arg, :argument, :key, :keyword # this searches for the keyword and the colons, but returns all in between as one group: __rst_paramRE = regexpCompile(r"^\s*(?::param(eter)?|:arg(ument)?|:key(word)?)([^:]*):\s*(.*)") __rst_typeRE = regexpCompile(r"^(\s*)(?::type)" r"\s*(\w*)\s*:(.*)") # search for :type __rst_rtypeRE = regexpCompile(r"^(\s*)(?::rtype)\s*(.*):(.*)") # search for rtype __rst_returnRE = regexpCompile(r"^\s*(?::return)\s*(.*): (.*)$") __rst_literal_sectionRE = regexpCompile(r"^(.*)::$") __rst_tableRE = regexpCompile(r"^\s*=+\s+(=+\s*)+$") # end of table is a blank line __LITERAL_SECTION_MARK = "~~~~~~" def __init__(self, lines, arguments): """Initialize a few class variables in preparation for our walk.""" self.lines = lines self.args = arguments self.docLines = [] @staticmethod def _stripOutAnds(inStr): """Take a string and returns the same without ands or ampersands.""" assert isinstance(inStr, str) return inStr.replace(' and ', ' ').replace(' & ', ' ') @staticmethod def _endCodeIfNeeded(line, inCodeBlock): """Append end code marker if needed.""" assert isinstance(line, str) if inCodeBlock: line = '# @endcode{0}{1}'.format(linesep, line.rstrip()) inCodeBlock = False return line, inCodeBlock @staticmethod @coroutine def _checkIfCode(inCodeBlockObj): """Check whether or not a given line appears to be Python code.""" while True: line, lines, lineNum = (yield) testLineNum = 1 currentLineNum = 0 testLine = line.strip() lineOfCode = None while lineOfCode is None: match = AstWalker.__errorLineRE.match(testLine) if not testLine or testLine == '...' or match: # These are ambiguous. line, lines, lineNum = (yield) testLine = line.strip() # testLineNum = 1 elif testLine.startswith('>>>'): # This is definitely code. lineOfCode = True elif testLine.startswith('...'): lineOfCode = True else: try: compLine = compile_command(testLine) if compLine and lines[currentLineNum].strip().startswith('#'): lineOfCode = True else: line, lines, lineNum = (yield) line = line.strip() if line.startswith('>>>'): # Definitely code, don't compile further. lineOfCode = True else: testLine += linesep + line testLine = testLine.strip() testLineNum += 1 except (SyntaxError, RuntimeError): # This is definitely not code. lineOfCode = False except Exception: # Other errors are ambiguous. line, lines, lineNum = (yield) testLine = line.strip() # testLineNum = 1 currentLineNum = lineNum - testLineNum if not inCodeBlockObj[0] and lineOfCode: inCodeBlockObj[0] = True lines[currentLineNum] = '{0}{1}# @code{1}'.format( lines[currentLineNum], linesep ) elif inCodeBlockObj[0] and lineOfCode is False: # None is ambiguous, so strict checking # against False is necessary. inCodeBlockObj[0] = False lines[currentLineNum] = '{0}{1}# @endcode{1}'.format( lines[currentLineNum], linesep ) @coroutine def __alterDocstring(self, tail='', writer=None): """ Run eternally, processing docstring lines. Parses docstring lines as they get fed in via send, applies appropriate Doxygen tags, and passes them along in batches for writing. """ assert isinstance(tail, str) and isinstance(writer, GeneratorType) lines = [] # get's filled with changed line data until it is written out again timeToSend = False inCodeBlock = False # local CodeBlock state inCodeBlockObj = [False] # codeChecker CodeBlock state inSection = False in_literal_section = False in_rst_table = False rst_table_start_line_number = -1 table_count = 0 rst_table_middle_column_positions = [] # first and last column are line dependent... prefix = '' firstLineNum = -1 sectionHeadingIndent = 0 codeChecker = self._checkIfCode(inCodeBlockObj) while True: lineNum, line = (yield) if firstLineNum < 0: firstLineNum = lineNum # Don't bother doing extra work if it's a sentinel. if line is not None: # Also limit work if we're not parsing the docstring. if self.args.autobrief: for doxyTag, tagRE in AstWalker.__singleLineREs.items(): match = tagRE.search(line) if match: # We've got a simple one-line Doxygen command if lines: lines[-1], inCodeBlock = self._endCodeIfNeeded( lines[-1], inCodeBlock) inCodeBlockObj[0] = inCodeBlock writer.send((firstLineNum, lineNum - 1, lines)) lines = [] firstLineNum = lineNum line = line.replace(match.group(1), doxyTag) timeToSend = True # Special Line Mode handlings: if inSection: # The last line belonged to a section. # Does this one too? (Ignoring empty lines.) match = AstWalker.__blanklineRE.match(line) if not match: indent = len(line.expandtabs(self.args.tablength)) - \ len(line.expandtabs(self.args.tablength).lstrip()) if indent <= sectionHeadingIndent: inSection = False else: if lines[-1] == '#': # If the last line was empty, but we're still in a section # then we need to start a new paragraph. lines[-1] = '# @par' elif in_literal_section: # currently there's a literal section active match = AstWalker.__blanklineRE.match(line) if not match: # evaluate only non blank lines current_indent = len(line.expandtabs(self.args.tablength)) \ - len(line.expandtabs(self.args.tablength).lstrip()) if current_indent > sectionHeadingIndent: # just use it unchanged, but ensure it is at least 4 spaces indented # doxygen only evaluates relative indents to former indent level if (current_indent - sectionHeadingIndent) < 4: extra_indent = " " * (4 - current_indent + sectionHeadingIndent) else: extra_indent = '' lines.append("#" + extra_indent + line) continue in_literal_section = False # line = line.rstrip() + "Le" # lines.append("#" + AstWalker.__LITERAL_SECTION_MARK) # fencing requires line addition -> which is not yet supported here elif in_rst_table: # end table on a blank line match = AstWalker.__blanklineRE.match(line) if match: in_rst_table = False lines.append("#" + line) continue # check for intermediate border lines -> doxygen only knows them at # second table line as separator line ... match = AstWalker.__rst_tableRE.match(line) if match: if rst_table_start_line_number + 2 == lineNum: line = line.replace("=", "-") else: # line = line.replace("="," ") # white spaces will end the table... so use # replace every starting = with - and all following with ' ' line = line.replace(" =", " -") line = line.replace("=", " ") # insert pipes before first text and behind last text ... well not always # needed so skip it for now # insert pipes on all middle positions, check if there's a whitespace there for pos in rst_table_middle_column_positions: if line[pos] == ' ': line = line[:pos] + '|' + line[pos + 1:] # else: # well miss formated simple rst table # -> let the garbage flow... until next blank line... # Note: multiline rst table cells are not translateable to # simple Markdown... lines.append("#" + line) continue # no further translation needed here match = AstWalker.__returnsStartRE.match(line) if match: # We've got a "returns" section lines[-1], inCodeBlock = self._endCodeIfNeeded( lines[-1], inCodeBlock) inCodeBlockObj[0] = inCodeBlock line = line.replace(match.group(0), ' @return\t').rstrip() prefix = '@return\t' else: match = AstWalker.__argsStartRE.match(line) if match: # We've got an "arguments" section line = line.replace(match.group(0), '').rstrip() if 'attr' in match.group(0).lower(): prefix = '@property\t' else: prefix = '@param\t' if lines: lines[-1], inCodeBlock = self._endCodeIfNeeded(lines[-1], inCodeBlock) inCodeBlockObj[0] = inCodeBlock lines.append('#' + line) continue match = AstWalker.__rst_paramRE.match(line) if match: # it's an rst param # last word is the param name param_declarations = match.group(4).rpartition(' ') line = "{} {} {} {}".format( param_declarations[2], param_declarations[0], param_declarations[1], match.group(5) ) prefix = '@param\t' if lines: lines[-1], inCodeBlock = self._endCodeIfNeeded(lines[-1], inCodeBlock) lines.append('#@param\t' + line) continue # line is processed match = AstWalker.__rst_typeRE.match(line) if match: # it's a type description to a former param line = "{}@n type of {}: {}".format( match.group(1), match.group(2), match.group(3) ) # @n = newline if lines: lines[-1], inCodeBlock = self._endCodeIfNeeded(lines[-1], inCodeBlock) lines.append('#' + line) continue # line is processed match = AstWalker.__rst_returnRE.match(line) if match: # it's a return description line prefix = "@return\t" line = "@return {} {}".format(match.group(1), match.group(2)) if lines: lines[-1], inCodeBlock = self._endCodeIfNeeded(lines[-1], inCodeBlock) lines.append('#' + line) continue # line is processed match = AstWalker.__rst_rtypeRE.match(line) if match: # it's a return type description to a former return line = "{}@n return type of {}: {}".format( match.group(1), match.group(2), match.group(3) ) # @n = newline if lines: lines[-1], inCodeBlock = self._endCodeIfNeeded(lines[-1], inCodeBlock) lines.append('#' + line) continue # line is processed match = AstWalker.__rst_tableRE.match(line) if match: # found a rst table start in_rst_table = True current_indent = len(line.expandtabs(self.args.tablength)) \ - len(line.expandtabs(self.args.tablength).lstrip()) rst_table_start_line_number = lineNum # get the positions of middle columns rst_table_middle_column_positions = [] pos = line.find("= ") while pos != -1: rst_table_middle_column_positions.append(pos + 1) # the space is after = pos = line.find("= ", pos + 1) # other code detectors need to be run here to get out of their mode but keep # line indention for not triggering a literal section! table_count += 1 # number prevents singleListItem detection later line = " " * current_indent + "Table {}".format(table_count) match = AstWalker.__argsRE.match(line) if match and not inCodeBlock: # We've got something that looks like an item / # description pair. if 'property' in prefix: line = '# {0}\t{1[name]}{2}# {1[desc]}'.format( prefix, match.groupdict(), linesep) else: line = ' {0}\t{1[name]}\t{1[desc]}'.format( prefix, match.groupdict()) else: match = AstWalker.__raisesStartRE.match(line) if match: line = line.replace(match.group(0), '').rstrip() if 'see' in match.group(1).lower(): # We've got a "see also" section prefix = '@sa\t' else: # We've got an "exceptions" section prefix = '@exception\t' lines[-1], inCodeBlock = self._endCodeIfNeeded( lines[-1], inCodeBlock) inCodeBlockObj[0] = inCodeBlock lines.append('#' + line) continue match = AstWalker.__listRE.match(line) if match and not inCodeBlock: # We've got a list of something or another itemList = [] for itemMatch in AstWalker.__listItemRE.findall(self._stripOutAnds( match.group(0))): itemList.append('# {0}\t{1}{2}'.format( prefix, itemMatch, linesep)) line = ''.join(itemList)[1:] else: match = AstWalker.__examplesStartRE.match(line) if match and lines[-1].strip() == '#' \ and self.args.autocode: # We've got an "example" section inCodeBlock = True inCodeBlockObj[0] = True line = line.replace(match.group(0), ' @b Examples{0}# @code'.format(linesep)) else: match = AstWalker.__sectionStartRE.match(line) if match: # We've got an arbitrary section prefix = '' inSection = True # What's the indentation of the section heading? sectionHeadingIndent = len(line.expandtabs(self.args.tablength)) \ - len(line.expandtabs(self.args.tablength).lstrip()) line = line.replace( match.group(0), ' @par {0}'.format(match.group(1)) ) if lines[-1] == '# @par': lines[-1] = '#' lines[-1], inCodeBlock = self._endCodeIfNeeded( lines[-1], inCodeBlock) inCodeBlockObj[0] = inCodeBlock lines.append('#' + line) continue if prefix: match = AstWalker.__singleListItemRE.match(line) if match and not inCodeBlock: # Probably a single list item line = ' {0}\t{1}'.format( prefix, match.group(0)) elif self.args.autocode: codeChecker.send( ( line, lines, lineNum - firstLineNum ) ) inCodeBlock = inCodeBlockObj[0] else: if self.args.autocode: codeChecker.send( ( line, lines, lineNum - firstLineNum ) ) inCodeBlock = inCodeBlockObj[0] # If we were passed a tail, append it to the docstring. # Note that this means that we need a docstring for this # item to get documented. if tail and lineNum == len(self.docLines) - 1: line = '{0}{1}# {2}'.format(line.rstrip(), linesep, tail) # Add comment marker for every line. line = '#{0}'.format(line.rstrip()) # Ensure the first line has the Doxygen double comment. if lineNum == 0: line = '#' + line lines.append(line.replace(' ' + linesep, linesep)) else: # If we get our sentinel value, send out what we've got. timeToSend = True if timeToSend: if lines: lines[-1], inCodeBlock = self._endCodeIfNeeded(lines[-1], inCodeBlock) inCodeBlockObj[0] = inCodeBlock writer.send((firstLineNum, lineNum, lines)) lines = [] firstLineNum = -1 table_count = 0 timeToSend = False @coroutine def __writeDocstring(self): """ Run eternally, dumping out docstring line batches as they get fed in. Replaces original batches of docstring lines with modified versions fed in via send. """ while True: firstLineNum, lastLineNum, lines = (yield) newDocstringLen = lastLineNum - firstLineNum + 1 while len(lines) < newDocstringLen: lines.append('') # Substitute the new block of lines for the original block of lines. self.docLines[firstLineNum: lastLineNum + 1] = lines def _processDocstring(self, node, tail='', **kwargs): """ Handle a docstring for functions, classes, and modules. Basically just figures out the bounds of the docstring and sends it off to the parser to do the actual work. Return: last line number of this docstring """ typeName = type(node).__name__ # Modules don't have lineno defined, but it's always 0 for them. curLineNum = startLineNum = 0 if typeName != 'Module': startLineNum = curLineNum = node.lineno - 1 # Figure out where both our enclosing object and our docstring start. line = '' while curLineNum < len(self.lines): line = self.lines[curLineNum] match = AstWalker.__docstrMarkerRE.match(line) if match: break curLineNum += 1 docstringStart = curLineNum # Figure out where our docstring ends. if not AstWalker.__docstrOneLineRE.match(line): # Skip for the special case of a single-line docstring. curLineNum += 1 while curLineNum < len(self.lines): line = self.lines[curLineNum] if line.find(match.group(2)) >= 0: break curLineNum += 1 endLineNum = curLineNum + 1 # Isolate our enclosing object's declaration. defLines = self.lines[startLineNum: docstringStart] # Isolate our docstring. self.docLines = self.lines[docstringStart: endLineNum] # If we have a docstring, extract information from it. if self.docLines: # Get rid of the docstring delineators. self.docLines[0] = AstWalker.__docstrMarkerRE.sub('', self.docLines[0]) self.docLines[-1] = AstWalker.__docstrMarkerRE.sub('', self.docLines[-1]) # Handle special strings within the docstring. docstringConverter = self.__alterDocstring( tail, self.__writeDocstring()) for lineInfo in enumerate(self.docLines): docstringConverter.send(lineInfo) docstringConverter.send((len(self.docLines) - 1, None)) # Add a Doxygen @brief tag to any single-line description. # but take care not to remove the initial '##' doxygen marker if self.args.autobrief: safetyCounter = 0 while self.docLines and self.docLines[0].lstrip('#').strip() == '': del self.docLines[0] self.docLines.append('') safetyCounter += 1 if safetyCounter >= len(self.docLines): # Escape the effectively empty docstring. break if len(self.docLines) == 1 or (len(self.docLines) >= 2 and ( self.docLines[1].strip(whitespace + '#') == '' or self.docLines[1].strip(whitespace + '#').startswith('@'))): self.docLines[0] = "## @brief {0}".format(self.docLines[0].lstrip('#')) if len(self.docLines) > 1 and self.docLines[1] == '# @par': self.docLines[1] = '#' # safety catch up for starting with doxygen marker even if first DocString Line is empty # and has been removed in former processings for autobrief if safetyCounter > 0 and not self.docLines[0].lstrip().startswith('##'): self.docLines[0] = '##' + self.docLines[0] if defLines: # make all docstring comments on same indentation as their enclosing object's indention level # but remove this added indent within the docstring if needed match = AstWalker.__indentRE.match(defLines[0]) indentStr = match.group(1) if match else '' self.docLines = [AstWalker.__newlineRE.sub(indentStr + '#', docLine) for docLine in self.docLines] if self.args.equalIndent and indentStr: # remove the same amount of indent within the docLine part indentPartRE = regexpCompile("{istr}#+({istr})".format(istr=indentStr)) for (index, docLine) in enumerate(self.docLines): docIndentPart = indentPartRE.match(docLine) if docIndentPart is None: # no match continue # print (f"match line {docstringStart + index} from # {docIndentPart.start(1)} to {docIndentPart.end(1)}") self.docLines[index] = docLine[:docIndentPart.start(1)] + docLine[docIndentPart.end(1):] # Taking away a docstring from an interface method definition sometimes # leaves broken code as the docstring may be the only code in it. # Here we manually insert a pass statement to rectify this problem. if typeName != 'Module': if docstringStart < len(self.lines): match = AstWalker.__indentRE.match(self.lines[docstringStart]) indentStr = match.group(1) if match else '' else: indentStr = '' containingNodes = kwargs.get('containingNodes', []) or [] fullPathNamespace = self._getFullPathName(containingNodes) parentType = fullPathNamespace[-2][1] if parentType == 'interface' and typeName == 'FunctionDef' \ or fullPathNamespace[-1][1] == 'interface': # defLines should always end with some kind of new line -> insert two os correct ones defLines[-1] = '{0}{1}{1}{2}pass'.format(defLines[-1].rstrip(), linesep, indentStr) elif self.args.autobrief and typeName == 'ClassDef': # If we're parsing docstrings separate out class attribute # definitions to get better Doxygen output. for firstVarLineNum, firstVarLine in enumerate(self.docLines): if '@property\t' in firstVarLine: break lastVarLineNum = len(self.docLines) if lastVarLineNum > 0 and '@property\t' in firstVarLine: while lastVarLineNum > firstVarLineNum: lastVarLineNum -= 1 if '@property\t' in self.docLines[lastVarLineNum]: break lastVarLineNum += 1 if firstVarLineNum < len(self.docLines): indentLineNum = endLineNum indentStr = '' while not indentStr and indentLineNum < len(self.lines): match = AstWalker.__indentRE.match(self.lines[indentLineNum]) indentStr = match.group(1) if match else '' indentLineNum += 1 varLines = ['{0}{1}'.format(linesep, docLine).replace( linesep, linesep + indentStr) for docLine in self.docLines[ firstVarLineNum: lastVarLineNum]] defLines.extend(varLines) self.docLines[firstVarLineNum: lastVarLineNum] = [] # After the property shuffling we will need to relocate # any existing namespace information. namespaceLoc = defLines[-1].find(linesep + '# @namespace') if namespaceLoc >= 0: self.docLines[-1] += defLines[-1][namespaceLoc:] defLines[-1] = defLines[-1][:namespaceLoc] # For classes and functions, apply our changes and reverse the # order of the declaration and docstring, and for modules just # apply our changes. if typeName != 'Module': self.lines[startLineNum: endLineNum] = self.docLines + defLines else: self.lines[startLineNum: endLineNum] = defLines + self.docLines return endLineNum @staticmethod def _checkMemberName(name): """ See if a member name indicates that it should be private. Private variables in Python (starting with a double underscore but not ending in a double underscore) and bed lumps (variables that are not really private but are by common convention treated as protected because they begin with a single underscore) get Doxygen tags labeling them appropriately. """ assert isinstance(name, str) restrictionLevel = None if not name.endswith('__'): if name.startswith('__'): restrictionLevel = 'private' elif name.startswith('_'): restrictionLevel = 'protected' return restrictionLevel def _processMembers(self, node, contextTag): """ Mark up members if they should be private. If the name indicates it should be private or protected, apply the appropriate Doxygen tags. """ restrictionLevel = self._checkMemberName(node.name) if restrictionLevel: workTag = '{0}{1}# @{2}'.format(contextTag, linesep, restrictionLevel) else: workTag = contextTag return workTag def generic_visit(self, node, **kwargs): """ Extract useful information from relevant nodes including docstrings. This is virtually identical to the standard version contained in NodeVisitor. It is only overridden because we're tracking extra information (the hierarchy of containing nodes) not preserved in the original. """ for field, value in iter_fields(node): if isinstance(value, list): for item in value: if isinstance(item, AST): self.visit(item, containingNodes=kwargs['containingNodes']) elif isinstance(value, AST): self.visit(value, containingNodes=kwargs['containingNodes']) def visit(self, node, **kwargs): """ Visit a node and extract useful information from it. This is virtually identical to the standard version contained in NodeVisitor. It is only overridden because we're tracking extra information (the hierarchy of containing nodes) not preserved in the original. """ containingNodes = kwargs.get('containingNodes', []) method = 'visit_' + node.__class__.__name__ visitor = getattr(self, method, self.generic_visit) return visitor(node, containingNodes=containingNodes) def _getFullPathName(self, containingNodes): """ Return the full node hierarchy rooted at module name. The list representing the full path through containing nodes (starting with the module itself) is returned. """ assert isinstance(containingNodes, list) return [(self.args.fullPathNamespace, 'module')] + containingNodes def visit_Module(self, node, **kwargs): """ Handle the module-level docstring. Process the module-level docstring and create appropriate Doxygen tags if autobrief option is set. """ containingNodes = kwargs.get('containingNodes', []) if self.args.debug: stderr.write("# Module {0}{1}".format(self.args.fullPathNamespace, linesep)) if get_docstring(node): if self.args.topLevelNamespace: fullPathNamespace = self._getFullPathName(containingNodes) contextTag = '.'.join(pathTuple[0] for pathTuple in fullPathNamespace) tail = '@namespace {0}'.format(contextTag) else: tail = '' self._processDocstring(node, tail) # Visit any contained nodes (in this case pretty much everything). self.generic_visit(node, containingNodes=containingNodes) def visit_Assign(self, node, **kwargs): """ Handle assignments within code. Variable assignments in Python are used to represent interface attributes in addition to basic variables. If an assignment appears to be an attribute, it gets labeled as such for Doxygen. If a variable name uses Python mangling or is just a bed lump, it is labeled as private for Doxygen. """ lineNum = node.lineno - 1 # Assignments have one Doxygen-significant special case: # interface attributes. match = AstWalker.__attributeRE.match(self.lines[lineNum]) if match: self.lines[lineNum] = '{0}## @property {1}{2}{0}# {3}{2}' \ '{0}# @hideinitializer{2}{4}{2}'.format( match.group(1), match.group(2), linesep, match.group(3), self.lines[lineNum].rstrip() ) if self.args.debug: stderr.write("# Attribute {0.id}{1}".format(node.targets[0], linesep)) if isinstance(node.targets[0], Name): match = AstWalker.__indentRE.match(self.lines[lineNum]) indentStr = match.group(1) if match else '' restrictionLevel = self._checkMemberName(node.targets[0].id) if restrictionLevel: self.lines[lineNum] = '{0}## @var {1}{2}{0}' \ '# @hideinitializer{2}{0}# @{3}{2}{4}{2}'.format( indentStr, node.targets[0].id, linesep, restrictionLevel, self.lines[lineNum].rstrip() ) # Visit any contained nodes. self.generic_visit(node, containingNodes=kwargs['containingNodes']) def visit_Call(self, node, **kwargs): """ Handle function calls within code. Function calls in Python are used to represent interface implementations in addition to their normal use. If a call appears to mark an implementation, it gets labeled as such for Doxygen. """ lineNum = node.lineno - 1 # Function calls have one Doxygen-significant special case: interface # implementations. match = AstWalker.__implementsRE.match(self.lines[lineNum]) if match: self.lines[lineNum] = '{0}## @implements {1}{2}{0}{3}{2}'.format( match.group(1), match.group(2), linesep, self.lines[lineNum].rstrip()) if self.args.debug: stderr.write("# Implements {0}{1}".format(match.group(1), linesep)) # Visit any contained nodes. self.generic_visit(node, containingNodes=kwargs['containingNodes']) def visit_FunctionDef(self, node, **kwargs): """ Handle function definitions within code. Process a function's docstring, keeping well aware of the function's context and whether or not it's part of an interface definition. """ if self.args.debug: stderr.write("# Function {0.name}{1}".format(node, linesep)) # if it's a property, rewrite the definition to something Doxygen understands # (We'll use the getter for the documentation) if node.decorator_list: match = AstWalker.__indentRE.match(self.lines[node.lineno - 1]) indentStr = match.group(1) if match else '' if getattr(node.decorator_list[0], "id", None) == "property": self.lines[node.lineno - 1] = indentStr + "{} = property".format(node.name) + \ linesep + indentStr + "## \\private" + linesep + self.lines[node.lineno - 1] if getattr(node.decorator_list[0], "attr", None) == "setter": self.lines[node.lineno - 1] = indentStr + "## \\private" + linesep + self.lines[node.lineno - 1] # Push either 'interface' or 'class' onto our containing nodes # hierarchy so we can keep track of context. This will let us tell # if a function is nested within another function or even if a class # is nested within a function. containingNodes = kwargs.get('containingNodes') or [] containingNodes.append((node.name, 'function')) if self.args.topLevelNamespace: fullPathNamespace = self._getFullPathName(containingNodes) contextTag = '.'.join(pathTuple[0] for pathTuple in fullPathNamespace) modifiedContextTag = self._processMembers(node, contextTag) tail = '@namespace {0}'.format(modifiedContextTag) else: tail = self._processMembers(node, '') if get_docstring(node): last_doc_line_number = self._processDocstring( node, tail, containingNodes=containingNodes) if self.args.keepDecorators: self._shift_decorators_below_docstring(node, last_doc_line_number) # Visit any contained nodes. self.generic_visit(node, containingNodes=containingNodes) # Remove the item we pushed onto the containing nodes hierarchy. containingNodes.pop() visit_AsyncFunctionDef = visit_FunctionDef def visit_ClassDef(self, node, **kwargs): """ Handle class definitions within code. Process the docstring. Note though that in Python Class definitions are used to define interfaces in addition to classes. If a class definition appears to be an interface definition tag it as an interface definition for Doxygen. Otherwise tag it as a class definition for Doxygen. """ lineNum = node.lineno - 1 # Push either 'interface' or 'class' onto our containing nodes # hierarchy so we can keep track of context. This will let us tell # if a function is a method or an interface method definition or if # a class is fully contained within another class. containingNodes = kwargs.get('containingNodes') or [] if not self.args.object_respect: # Remove object class of the inherited class list to avoid that all # new-style class inherits from object in the hierarchy class line = self.lines[lineNum] match = AstWalker.__classRE.match(line) if match: if match.group(2) == 'object': self.lines[lineNum] = line[:match.start(2)] + line[match.end(2):] match = AstWalker.__interfaceRE.match(self.lines[lineNum]) if match: if self.args.debug: stderr.write("# Interface {0.name}{1}".format(node, linesep)) containingNodes.append((node.name, 'interface')) else: if self.args.debug: stderr.write("# Class {0.name}{1}".format(node, linesep)) containingNodes.append((node.name, 'class')) if self.args.topLevelNamespace: fullPathNamespace = self._getFullPathName(containingNodes) contextTag = '.'.join(pathTuple[0] for pathTuple in fullPathNamespace) tail = '@namespace {0}'.format(contextTag) else: tail = '' # Class definitions have one Doxygen-significant special case: # interface definitions. if match: contextTag = '{0}{1}# @interface {2}'.format(tail, linesep, match.group(1)) else: contextTag = tail contextTag = self._processMembers(node, contextTag) if get_docstring(node): last_doc_line_number = self._processDocstring( node, contextTag, containingNodes=containingNodes) if self.args.keepDecorators: self._shift_decorators_below_docstring(node, last_doc_line_number) # Visit any contained nodes. self.generic_visit(node, containingNodes=containingNodes) # Remove the item we pushed onto the containing nodes hierarchy. containingNodes.pop() # With Python 3.8, a function visit_Constant() was added to ast.NodeVisitor # This adds an overload of this function that can take additional # arguments, but ignores them and calls the function from NodeVisitor. # See also https://github.com/Feneric/doxypypy/issues/70 def visit_Constant(self, node, **kwargs): """Handle constant definitions within code.""" super(AstWalker, self).visit_Constant(node) def _shift_decorators_below_docstring(self, node, last_doc_line_number): if node.decorator_list: # get the decorators of this function and put them after DocString -> needs doxygen 1.9 or higher # as decorators must be one line before function name, restructuring should be possible # print (str(node.decorator_list) + str(node.decorator_list[0].id) + str(node.decorator_list[0].lineno)) for decorator in node.decorator_list: # first in list is last decorator called ... -> thus first line with decorator org_line_number = decorator.lineno - 1 new_line_number = last_doc_line_number - 1 self.lines[org_line_number:new_line_number] = self.lines[org_line_number + 1:new_line_number] \ + [self.lines[org_line_number]] def parseLines(self): """Form an AST for the code and produce a new version of the source.""" inAst = parse(''.join(self.lines), self.args.filename) # Visit all the nodes in our tree and apply Doxygen tags to the source. self.visit(inAst) def getLines(self): """Return the modified file once processing has been completed.""" # Note: some processing steps insert new lines within one lines.line... # so actually all lineseps need to be replaced within one line, even in the middle of a line ... return linesep.join(line.rstrip() for line in self.lines) def main(): """ Start it up. Starts the parser on the file given by the filename as the first argument on the command line. """ def argParse(): """ Parse command line options. Generally we're supporting all the command line options that doxypy.py supports in an analogous way to make it easy to switch back and forth. We additionally support a top-level namespace argument that is used to trim away excess path information. """ prog = basename(argv[0]) parser = ArgumentParser(prog=prog, usage="%(prog)s [options] filename") parser.add_argument( "filename", help="Input file name" ) parser.add_argument( "-a", "--autobrief", action="store_true", dest="autobrief", help="parse the docstring for @brief description and other information" ) parser.add_argument( "-c", "--autocode", action="store_true", dest="autocode", help="parse the docstring for code samples" ) parser.add_argument( "-n", "--ns", action="store", type=str, dest="topLevelNamespace", help="specify a top-level namespace that will be used to trim paths" ) parser.add_argument( "-t", "--tablength", action="store", type=int, dest="tablength", default=4, help="specify a tab length in spaces; only needed if tabs are used" ) parser.add_argument( "-s", "--stripinit", action="store_true", dest="stripinit", help="strip __init__ from namespace" ) parser.add_argument( "-O", "--object-respect", action="store_true", dest="object_respect", help="By default, doxypypy hides object class from class dependencies" "even if class inherits explictilty from objects (new-style class)," "this option disable this." ) parser.add_argument( "-e", "--equalIndent", action="store_true", dest="equalIndent", help="Make indention level of docstrings matching with their enclosing" "definitions one." ) parser.add_argument( "-k", "--keepDecorators", action="store_true", dest="keepDecorators", help="Decorators are usually ignored by doxypypy and thus are before the" "doxygen docString output and not before it's definition string." "With this option decorators are kept before it's definition string" "(function or class names). But this requires dogygen 1.9 or higher." ) group = parser.add_argument_group("Debug Options") group.add_argument( "-d", "--debug", action="store_true", dest="debug", help="enable debug output on stderr" ) # Parse options based on our definition. args = parser.parse_args() # Just abort immediately if we are don't have an input file. if not args.filename: stderr.write("No filename given." + linesep) sysExit(-1) # Turn the full path filename into a full path module location. fullPathNamespace = args.filename.replace(sep, '.')[:-3] # Use any provided top-level namespace argument to trim off excess. realNamespace = fullPathNamespace if args.topLevelNamespace: namespaceStart = fullPathNamespace.find(args.topLevelNamespace) if namespaceStart >= 0: realNamespace = fullPathNamespace[namespaceStart:] if args.stripinit: realNamespace = realNamespace.replace('.__init__', '') args.fullPathNamespace = realNamespace return args # Figure out what is being requested. args = argParse() # Figure out encoding of input file. numOfSampleBytes = min(getsize(args.filename), 32) sampleBytes = open(args.filename, 'rb').read(numOfSampleBytes) sampleByteAnalysis = detect(sampleBytes) encoding = sampleByteAnalysis['encoding'] or 'ascii' # Switch to generic versions to strip the BOM automatically. if sampleBytes.startswith(BOM_UTF8): encoding = 'UTF-8-SIG' if encoding.startswith("UTF-16"): encoding = "UTF-16" elif encoding.startswith("UTF-32"): encoding = "UTF-32" # Read contents of input file. if encoding == 'ascii': inFile = open(args.filename) else: inFile = codecsOpen(args.filename, encoding=encoding) lines = inFile.readlines() inFile.close() # Create the abstract syntax tree for the input file. astWalker = AstWalker(lines, args) astWalker.parseLines() # Output the modified source. # There is a "feature" in print on Windows. If linesep is # passed, it will generate 0x0D 0x0D 0x0A each line which # screws up Doxygen since it's expected 0x0D 0x0A line endings. for line in astWalker.getLines().split(linesep): print(line.rstrip()) # See if we're running as a script. if __name__ == "__main__": main() ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1675629870.5175488 doxypypy-0.8.8.7/doxypypy/test/0000775000175000017500000000000014370012457015160 5ustar00ericeric././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/__init__.py0000664000175000017500000000021414150504334017262 0ustar00ericeric# -*- coding: utf-8 -*- # We want to ensure that "all" doesn't include our samples that we # run tests against. __all__ = ["test_doxypypy"] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638149379.0 doxypypy-0.8.8.7/doxypypy/test/sample_async.out.py0000664000175000017500000000215614151026403021013 0ustar00ericeric# -*- coding: utf-8 -*- ## @brief An asynchronous function and an asynchronous method. # #Here we're testing out some straightforward Python 3 async #examples. # # @namespace sample_async ## @brief A sample non-asynchronous function. # # @namespace sample_async.non_asynchronous_function def non_asynchronous_function(): return "Not async." ## @brief A sample asynchronous function. # # @namespace sample_async.asynchronous_function async def asynchronous_function(): return "Async" ## @brief A sample class with an async method. # # Nothing special, just a basic Python 3 class that has an # async method in it. # # @namespace sample_async.ClassWithAsyncMethod class ClassWithAsyncMethod(): ## @brief This is a regular, non-async method. # # @namespace sample_async.ClassWithAsyncMethod.non_asynchronous_method def non_asynchronous_method(self): return "Not async." ## @brief This is an asynchronous method. # # @namespace sample_async.ClassWithAsyncMethod.asynchronous_method async def asynchronous_method(self): return "Async" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638149379.0 doxypypy-0.8.8.7/doxypypy/test/sample_async.outbare.py0000664000175000017500000000141514151026403021642 0ustar00ericeric# -*- coding: utf-8 -*- ## #An asynchronous function and an asynchronous method. # #Here we're testing out some straightforward Python 3 async #examples. # ## # A sample non-asynchronous function. # def non_asynchronous_function(): return "Not async." ## # A sample asynchronous function. # async def asynchronous_function(): return "Async" ## # A sample class with an async method. # # Nothing special, just a basic Python 3 class that has an # async method in it. # class ClassWithAsyncMethod(): ## # This is a regular, non-async method. # def non_asynchronous_method(self): return "Not async." ## # This is an asynchronous method. # async def asynchronous_method(self): return "Async" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638149379.0 doxypypy-0.8.8.7/doxypypy/test/sample_async.outnc.py0000664000175000017500000000215614151026403021334 0ustar00ericeric# -*- coding: utf-8 -*- ## @brief An asynchronous function and an asynchronous method. # #Here we're testing out some straightforward Python 3 async #examples. # # @namespace sample_async ## @brief A sample non-asynchronous function. # # @namespace sample_async.non_asynchronous_function def non_asynchronous_function(): return "Not async." ## @brief A sample asynchronous function. # # @namespace sample_async.asynchronous_function async def asynchronous_function(): return "Async" ## @brief A sample class with an async method. # # Nothing special, just a basic Python 3 class that has an # async method in it. # # @namespace sample_async.ClassWithAsyncMethod class ClassWithAsyncMethod(): ## @brief This is a regular, non-async method. # # @namespace sample_async.ClassWithAsyncMethod.non_asynchronous_method def non_asynchronous_method(self): return "Not async." ## @brief This is an asynchronous method. # # @namespace sample_async.ClassWithAsyncMethod.asynchronous_method async def asynchronous_method(self): return "Async" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638149379.0 doxypypy-0.8.8.7/doxypypy/test/sample_async.outnn.py0000664000175000017500000000145714151026403021352 0ustar00ericeric# -*- coding: utf-8 -*- ## @brief An asynchronous function and an asynchronous method. # #Here we're testing out some straightforward Python 3 async #examples. # ## @brief A sample non-asynchronous function. # def non_asynchronous_function(): return "Not async." ## @brief A sample asynchronous function. # async def asynchronous_function(): return "Async" ## @brief A sample class with an async method. # # Nothing special, just a basic Python 3 class that has an # async method in it. # class ClassWithAsyncMethod(): ## @brief This is a regular, non-async method. # def non_asynchronous_method(self): return "Not async." ## @brief This is an asynchronous method. # async def asynchronous_method(self): return "Async" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638149077.0 doxypypy-0.8.8.7/doxypypy/test/sample_async.py0000664000175000017500000000146314151025725020213 0ustar00ericeric# -*- coding: utf-8 -*- """ An asynchronous function and an asynchronous method. Here we're testing out some straightforward Python 3 async examples. """ def non_asynchronous_function(): """ A sample non-asynchronous function. """ return "Not async." async def asynchronous_function(): """ A sample asynchronous function. """ return "Async" class ClassWithAsyncMethod(): """ A sample class with an async method. Nothing special, just a basic Python 3 class that has an async method in it. """ def non_asynchronous_method(self): """ This is a regular, non-async method. """ return "Not async." async def asynchronous_method(self): """ This is an asynchronous method. """ return "Async" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_docexample.out.py0000664000175000017500000000312614150504334022020 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## @brief Documentation Example # #This is the example used in the doxypypy documentation. #It demonstrates basic docstring usage (including doctests). # # @namespace sample_docexample ## @brief Does nothing more than demonstrate syntax. # # This is an example of how a Pythonic human-readable docstring can # get parsed by doxypypy and marked up with Doxygen commands as a # regular input filter to Doxygen. # # # @param arg1 A positional argument. # @param arg2 Another positional argument. # # # @param kwarg A keyword argument. # # @return # A string holding the result. # # # @exception ZeroDivisionError # @exception AssertionError # @exception ValueError. # # @b Examples # @code # >>> myfunction(2, 3) # '5 - 0, whatever.' # >>> myfunction(5, 0, 'oops.') # Traceback (most recent call last): # ... # ZeroDivisionError: integer division or modulo by zero # >>> myfunction(4, 1, 'got it.') # '5 - 4, got it.' # >>> myfunction(23.5, 23, 'oh well.') # Traceback (most recent call last): # ... # AssertionError # >>> myfunction(5, 50, 'too big.') # Traceback (most recent call last): # ... # ValueError # @endcode # # @namespace sample_docexample.myfunction def myfunction(arg1, arg2, kwarg='whatever.'): assert isinstance(arg1, int) if arg2 > 23: raise ValueError return '{0} - {1}, {2}'.format(arg1 + arg2, arg1 / arg2, kwarg) if __name__ == "__main__": import doctest doctest.testmod() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_docexample.outbare.py0000664000175000017500000000277014150504334022656 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## #Documentation Example # #This is the example used in the doxypypy documentation. #It demonstrates basic docstring usage (including doctests). # ## # Does nothing more than demonstrate syntax. # # This is an example of how a Pythonic human-readable docstring can # get parsed by doxypypy and marked up with Doxygen commands as a # regular input filter to Doxygen. # # Args: # arg1: A positional argument. # arg2: Another positional argument. # # Kwargs: # kwarg: A keyword argument. # # Returns: # A string holding the result. # # Raises: # ZeroDivisionError, AssertionError, & ValueError. # # Examples: # >>> myfunction(2, 3) # '5 - 0, whatever.' # >>> myfunction(5, 0, 'oops.') # Traceback (most recent call last): # ... # ZeroDivisionError: integer division or modulo by zero # >>> myfunction(4, 1, 'got it.') # '5 - 4, got it.' # >>> myfunction(23.5, 23, 'oh well.') # Traceback (most recent call last): # ... # AssertionError # >>> myfunction(5, 50, 'too big.') # Traceback (most recent call last): # ... # ValueError # def myfunction(arg1, arg2, kwarg='whatever.'): assert isinstance(arg1, int) if arg2 > 23: raise ValueError return '{0} - {1}, {2}'.format(arg1 + arg2, arg1 / arg2, kwarg) if __name__ == "__main__": import doctest doctest.testmod() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_docexample.outnc.py0000664000175000017500000000307614150504334022345 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## @brief Documentation Example # #This is the example used in the doxypypy documentation. #It demonstrates basic docstring usage (including doctests). # # @namespace sample_docexample ## @brief Does nothing more than demonstrate syntax. # # This is an example of how a Pythonic human-readable docstring can # get parsed by doxypypy and marked up with Doxygen commands as a # regular input filter to Doxygen. # # # @param arg1 A positional argument. # @param arg2 Another positional argument. # # # @param kwarg A keyword argument. # # @return # A string holding the result. # # # @exception ZeroDivisionError # @exception AssertionError # @exception ValueError. # # @par Examples # >>> myfunction(2, 3) # '5 - 0, whatever.' # >>> myfunction(5, 0, 'oops.') # Traceback (most recent call last): # ... # ZeroDivisionError integer division or modulo by zero # >>> myfunction(4, 1, 'got it.') # '5 - 4, got it.' # >>> myfunction(23.5, 23, 'oh well.') # Traceback (most recent call last): # ... # AssertionError # >>> myfunction(5, 50, 'too big.') # Traceback (most recent call last): # ... # ValueError # # @namespace sample_docexample.myfunction def myfunction(arg1, arg2, kwarg='whatever.'): assert isinstance(arg1, int) if arg2 > 23: raise ValueError return '{0} - {1}, {2}'.format(arg1 + arg2, arg1 / arg2, kwarg) if __name__ == "__main__": import doctest doctest.testmod() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_docexample.outnn.py0000664000175000017500000000301514150504334022351 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## @brief Documentation Example # #This is the example used in the doxypypy documentation. #It demonstrates basic docstring usage (including doctests). # ## @brief Does nothing more than demonstrate syntax. # # This is an example of how a Pythonic human-readable docstring can # get parsed by doxypypy and marked up with Doxygen commands as a # regular input filter to Doxygen. # # # @param arg1 A positional argument. # @param arg2 Another positional argument. # # # @param kwarg A keyword argument. # # @return # A string holding the result. # # # @exception ZeroDivisionError # @exception AssertionError # @exception ValueError. # # @b Examples # @code # >>> myfunction(2, 3) # '5 - 0, whatever.' # >>> myfunction(5, 0, 'oops.') # Traceback (most recent call last): # ... # ZeroDivisionError: integer division or modulo by zero # >>> myfunction(4, 1, 'got it.') # '5 - 4, got it.' # >>> myfunction(23.5, 23, 'oh well.') # Traceback (most recent call last): # ... # AssertionError # >>> myfunction(5, 50, 'too big.') # Traceback (most recent call last): # ... # ValueError # @endcode # def myfunction(arg1, arg2, kwarg='whatever.'): assert isinstance(arg1, int) if arg2 > 23: raise ValueError return '{0} - {1}, {2}'.format(arg1 + arg2, arg1 / arg2, kwarg) if __name__ == "__main__": import doctest doctest.testmod() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_docexample.py0000775000175000017500000000273614150504334021223 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- """ Documentation Example This is the example used in the doxypypy documentation. It demonstrates basic docstring usage (including doctests). """ def myfunction(arg1, arg2, kwarg='whatever.'): """ Does nothing more than demonstrate syntax. This is an example of how a Pythonic human-readable docstring can get parsed by doxypypy and marked up with Doxygen commands as a regular input filter to Doxygen. Args: arg1: A positional argument. arg2: Another positional argument. Kwargs: kwarg: A keyword argument. Returns: A string holding the result. Raises: ZeroDivisionError, AssertionError, & ValueError. Examples: >>> myfunction(2, 3) '5 - 0, whatever.' >>> myfunction(5, 0, 'oops.') Traceback (most recent call last): ... ZeroDivisionError: integer division or modulo by zero >>> myfunction(4, 1, 'got it.') '5 - 4, got it.' >>> myfunction(23.5, 23, 'oh well.') Traceback (most recent call last): ... AssertionError >>> myfunction(5, 50, 'too big.') Traceback (most recent call last): ... ValueError """ assert isinstance(arg1, int) if arg2 > 23: raise ValueError return '{0} - {1}, {2}'.format(arg1 + arg2, arg1 / arg2, kwarg) if __name__ == "__main__": import doctest doctest.testmod() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_google.out.py0000664000175000017500000000470314150504334021155 0ustar00ericeric#!/usr/bin/env python ## @brief Google Python Style Guide SampleClass # #This is basically as close a copy of the Python examples in the Google #Python Style Guide as possible while still being valid code. # @note this is a note # @note this is also a note # #http://google-styleguide.googlecode.com/svn/trunk/pyguide.html?showone=Comments#Comments # # @namespace sample_google ## @brief Fetches rows from a Bigtable. # # Retrieves rows pertaining to the given keys from the Table instance # represented by big_table. Silly things may happen if # other_silly_variable is not None. # # # @param big_table An open Bigtable Table instance. # @param keys A sequence of strings representing the key of each table row # to fetch. # @param other_silly_variable Another optional variable, that has a much # longer name than the other args, and which does nothing. # # @return # A dict mapping keys to the corresponding table row data # fetched. Each row is represented as a tuple of strings. For # example: # # @code # {'Serak': ('Rigel VII', 'Preparer'), # 'Zim': ('Irk', 'Invader'), # 'Lrrr': ('Omicron Persei 8', 'Emperor')} # # @endcode # If a key from the keys argument is missing from the dictionary, # then that row was not found in the table. # # # @exception IOError An error occurred accessing the bigtable.Table object. # # @namespace sample_google.fetch_bigtable_rows def fetch_bigtable_rows(big_table, keys, other_silly_variable=None): pass ## @brief Summary of class here. # # Longer class information.... # Longer class information.... # # # # @namespace sample_google.SampleClass class SampleClass(): ## @property likes_spam # A boolean indicating if we like SPAM or not. ## @property eggs # An integer count of the eggs we have laid. ## @brief Inits SampleClass with blah. # @namespace sample_google.SampleClass.__init__ def __init__(self, likes_spam=False): self.likes_spam = likes_spam self.eggs = 0 ## @brief Performs operation blah. # @namespace sample_google.SampleClass.public_method def public_method(self): pass i = None # We use a weighted dictionary search to find out where i is in # the array. We extrapolate position based on the largest num # in the array and the array size and then do binary search to # get the exact number. if i & (i-1) == 0: # true iff i is a power of 2 pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_google.outbare.py0000664000175000017500000000425614150504334022012 0ustar00ericeric#!/usr/bin/env python ## #Google Python Style Guide SampleClass # #This is basically as close a copy of the Python examples in the Google #Python Style Guide as possible while still being valid code. #NOTE: this is a note #NOTE: this is also a note # #http://google-styleguide.googlecode.com/svn/trunk/pyguide.html?showone=Comments#Comments # ##Fetches rows from a Bigtable. # # Retrieves rows pertaining to the given keys from the Table instance # represented by big_table. Silly things may happen if # other_silly_variable is not None. # # Args: # big_table: An open Bigtable Table instance. # keys: A sequence of strings representing the key of each table row # to fetch. # other_silly_variable: Another optional variable, that has a much # longer name than the other args, and which does nothing. # # Returns: # A dict mapping keys to the corresponding table row data # fetched. Each row is represented as a tuple of strings. For # example: # # {'Serak': ('Rigel VII', 'Preparer'), # 'Zim': ('Irk', 'Invader'), # 'Lrrr': ('Omicron Persei 8', 'Emperor')} # # If a key from the keys argument is missing from the dictionary, # then that row was not found in the table. # # Raises: # IOError: An error occurred accessing the bigtable.Table object. # def fetch_bigtable_rows(big_table, keys, other_silly_variable=None): pass ##Summary of class here. # # Longer class information.... # Longer class information.... # # Attributes: # likes_spam: A boolean indicating if we like SPAM or not. # eggs: An integer count of the eggs we have laid. # class SampleClass(): ##Inits SampleClass with blah. def __init__(self, likes_spam=False): self.likes_spam = likes_spam self.eggs = 0 ##Performs operation blah. def public_method(self): pass i = None # We use a weighted dictionary search to find out where i is in # the array. We extrapolate position based on the largest num # in the array and the array size and then do binary search to # get the exact number. if i & (i-1) == 0: # true iff i is a power of 2 pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_google.outnc.py0000664000175000017500000000466014150504334021500 0ustar00ericeric#!/usr/bin/env python ## @brief Google Python Style Guide SampleClass # #This is basically as close a copy of the Python examples in the Google #Python Style Guide as possible while still being valid code. # @note this is a note # @note this is also a note # #http://google-styleguide.googlecode.com/svn/trunk/pyguide.html?showone=Comments#Comments # # @namespace sample_google ## @brief Fetches rows from a Bigtable. # # Retrieves rows pertaining to the given keys from the Table instance # represented by big_table. Silly things may happen if # other_silly_variable is not None. # # # @param big_table An open Bigtable Table instance. # @param keys A sequence of strings representing the key of each table row # to fetch. # @param other_silly_variable Another optional variable, that has a much # longer name than the other args, and which does nothing. # # @return # A dict mapping keys to the corresponding table row data # fetched. Each row is represented as a tuple of strings. For # example: # # {'Serak': ('Rigel VII', 'Preparer'), # 'Zim': ('Irk', 'Invader'), # 'Lrrr': ('Omicron Persei 8', 'Emperor')} # # If a key from the keys argument is missing from the dictionary, # then that row was not found in the table. # # # @exception IOError An error occurred accessing the bigtable.Table object. # # @namespace sample_google.fetch_bigtable_rows def fetch_bigtable_rows(big_table, keys, other_silly_variable=None): pass ## @brief Summary of class here. # # Longer class information.... # Longer class information.... # # # # @namespace sample_google.SampleClass class SampleClass(): ## @property likes_spam # A boolean indicating if we like SPAM or not. ## @property eggs # An integer count of the eggs we have laid. ## @brief Inits SampleClass with blah. # @namespace sample_google.SampleClass.__init__ def __init__(self, likes_spam=False): self.likes_spam = likes_spam self.eggs = 0 ## @brief Performs operation blah. # @namespace sample_google.SampleClass.public_method def public_method(self): pass i = None # We use a weighted dictionary search to find out where i is in # the array. We extrapolate position based on the largest num # in the array and the array size and then do binary search to # get the exact number. if i & (i-1) == 0: # true iff i is a power of 2 pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_google.outnn.py0000664000175000017500000000434514150504334021513 0ustar00ericeric#!/usr/bin/env python ## @brief Google Python Style Guide SampleClass # #This is basically as close a copy of the Python examples in the Google #Python Style Guide as possible while still being valid code. # @note this is a note # @note this is also a note # #http://google-styleguide.googlecode.com/svn/trunk/pyguide.html?showone=Comments#Comments # ## @brief Fetches rows from a Bigtable. # # Retrieves rows pertaining to the given keys from the Table instance # represented by big_table. Silly things may happen if # other_silly_variable is not None. # # # @param big_table An open Bigtable Table instance. # @param keys A sequence of strings representing the key of each table row # to fetch. # @param other_silly_variable Another optional variable, that has a much # longer name than the other args, and which does nothing. # # @return # A dict mapping keys to the corresponding table row data # fetched. Each row is represented as a tuple of strings. For # example: # # @code # {'Serak': ('Rigel VII', 'Preparer'), # 'Zim': ('Irk', 'Invader'), # 'Lrrr': ('Omicron Persei 8', 'Emperor')} # # @endcode # If a key from the keys argument is missing from the dictionary, # then that row was not found in the table. # # # @exception IOError An error occurred accessing the bigtable.Table object. # def fetch_bigtable_rows(big_table, keys, other_silly_variable=None): pass ## @brief Summary of class here. # # Longer class information.... # Longer class information.... # # # class SampleClass(): ## @property likes_spam # A boolean indicating if we like SPAM or not. ## @property eggs # An integer count of the eggs we have laid. ## @brief Inits SampleClass with blah. def __init__(self, likes_spam=False): self.likes_spam = likes_spam self.eggs = 0 ## @brief Performs operation blah. def public_method(self): pass i = None # We use a weighted dictionary search to find out where i is in # the array. We extrapolate position based on the largest num # in the array and the array size and then do binary search to # get the exact number. if i & (i-1) == 0: # true iff i is a power of 2 pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_google.py0000664000175000017500000000426414150504334020351 0ustar00ericeric#!/usr/bin/env python """ Google Python Style Guide SampleClass This is basically as close a copy of the Python examples in the Google Python Style Guide as possible while still being valid code. NOTE: this is a note NOTE: this is also a note http://google-styleguide.googlecode.com/svn/trunk/pyguide.html?showone=Comments#Comments """ def fetch_bigtable_rows(big_table, keys, other_silly_variable=None): """Fetches rows from a Bigtable. Retrieves rows pertaining to the given keys from the Table instance represented by big_table. Silly things may happen if other_silly_variable is not None. Args: big_table: An open Bigtable Table instance. keys: A sequence of strings representing the key of each table row to fetch. other_silly_variable: Another optional variable, that has a much longer name than the other args, and which does nothing. Returns: A dict mapping keys to the corresponding table row data fetched. Each row is represented as a tuple of strings. For example: {'Serak': ('Rigel VII', 'Preparer'), 'Zim': ('Irk', 'Invader'), 'Lrrr': ('Omicron Persei 8', 'Emperor')} If a key from the keys argument is missing from the dictionary, then that row was not found in the table. Raises: IOError: An error occurred accessing the bigtable.Table object. """ pass class SampleClass(object): """Summary of class here. Longer class information.... Longer class information.... Attributes: likes_spam: A boolean indicating if we like SPAM or not. eggs: An integer count of the eggs we have laid. """ def __init__(self, likes_spam=False): """Inits SampleClass with blah.""" self.likes_spam = likes_spam self.eggs = 0 def public_method(self): """Performs operation blah.""" pass i = None # We use a weighted dictionary search to find out where i is in # the array. We extrapolate position based on the largest num # in the array and the array size and then do binary search to # get the exact number. if i & (i-1) == 0: # true iff i is a power of 2 pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_interfaces.out.py0000664000175000017500000000761714150504334022033 0ustar00ericeric# -*- coding: utf-8 -*- ## @brief Typical interfaces definition. # #Here we're just trying to make some typical interface definitions #to better test the doxypypy filter. # # @namespace sample_interfaces from zope.interface import Interface, Attribute # Public API Interfaces ## @brief The zeroth sample interface. # # Nothing special, just a sample interface to help test the # filter. This is a special case commonly known as a "marker # interface" that declares neither methods nor attributes. # # @namespace sample_interfaces.INul # @interface INul class INul(Interface): pass ## @brief The first sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has just a single method. # # @namespace sample_interfaces.IUnu # @interface IUnu class IUnu(Interface): pass ## @brief The first method offered for the first interface. # @namespace sample_interfaces.IUnu.unuMethod def unuMethod(unuArg, *args): pass ## @brief The second sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has multiple methods. # # @namespace sample_interfaces.IDu # @interface IDu class IDu(Interface): pass ## @brief The first method offered for the second interface. # @namespace sample_interfaces.IDu.duMethod def duMethod(duArg1, duArg2): pass ## @brief The second method offered for the second interface. # @namespace sample_interfaces.IDu.duMethod2 def duMethod2(duArg1, **kwargs): pass ## @brief The third sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has just a single attribute. # # @namespace sample_interfaces.ITri # @interface ITri class ITri(Interface): pass ## @property triAttr # the first attribute for the third interface # @hideinitializer triAttr = Attribute('the first attribute for the third interface') ## @brief The fourth sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has multiple attributes. # # @namespace sample_interfaces.IKvar # @interface IKvar class IKvar(Interface): pass ## @property kvarAttr1 # the first attribute for the fourth interface # @hideinitializer kvarAttr1 = Attribute('the first attribute for the fourth interface') ## @property kvarAttr2 # the second attribute for the fourth interface # @hideinitializer kvarAttr2 = Attribute('the second attribute for the fourth interface') ## @brief The fifth sample interface. # # Nothing special, just a sample interface to help test the # filter. This one opens things up a little and has multiple # attributes and methods. # # @namespace sample_interfaces.IKvin # @interface IKvin class IKvin(Interface): pass ## @property kvinAttr1 # the first attribute for the fifth interface # @hideinitializer kvinAttr1 = Attribute('the first attribute for the fifth interface') ## @property kvinAttr2 # the second attribute for the fifth interface # @hideinitializer kvinAttr2 = Attribute('the second attribute for the fifth interface') ## @brief The first method offered for the fifth interface. # @namespace sample_interfaces.IKvin.kvinMethod def kvinMethod(kvinArg1, kvinArg2, *args, **kwargs): pass ## @brief The second method offered for the fifth interface. # @namespace sample_interfaces.IKvin.kvinMethod2 def kvinMethod2(kvinArg1, kvinArg2='default'): pass ## @property kvinAttr3 # the third attribute for the fifth interface # @hideinitializer kvinAttr3 = Attribute('the third attribute for the fifth interface') ## @brief The third method offered for the fifth interface. # @namespace sample_interfaces.IKvin.kvinMethod3 def kvinMethod3(kvinArg1, kvinArg2='default'): pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_interfaces.outbare.py0000664000175000017500000000642114150504334022655 0ustar00ericeric# -*- coding: utf-8 -*- ## #Typical interfaces definition. # #Here we're just trying to make some typical interface definitions #to better test the doxypypy filter. # from zope.interface import Interface, Attribute # Public API Interfaces ## # The zeroth sample interface. # # Nothing special, just a sample interface to help test the # filter. This is a special case commonly known as a "marker # interface" that declares neither methods nor attributes. # # # @interface INul class INul(Interface): pass ## # The first sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has just a single method. # # # @interface IUnu class IUnu(Interface): pass ##The first method offered for the first interface. def unuMethod(unuArg, *args): pass ## # The second sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has multiple methods. # # # @interface IDu class IDu(Interface): pass ##The first method offered for the second interface. def duMethod(duArg1, duArg2): pass ##The second method offered for the second interface. def duMethod2(duArg1, **kwargs): pass ## # The third sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has just a single attribute. # # # @interface ITri class ITri(Interface): pass ## @property triAttr # the first attribute for the third interface # @hideinitializer triAttr = Attribute('the first attribute for the third interface') ## # The fourth sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has multiple attributes. # # # @interface IKvar class IKvar(Interface): pass ## @property kvarAttr1 # the first attribute for the fourth interface # @hideinitializer kvarAttr1 = Attribute('the first attribute for the fourth interface') ## @property kvarAttr2 # the second attribute for the fourth interface # @hideinitializer kvarAttr2 = Attribute('the second attribute for the fourth interface') ## # The fifth sample interface. # # Nothing special, just a sample interface to help test the # filter. This one opens things up a little and has multiple # attributes and methods. # # # @interface IKvin class IKvin(Interface): pass ## @property kvinAttr1 # the first attribute for the fifth interface # @hideinitializer kvinAttr1 = Attribute('the first attribute for the fifth interface') ## @property kvinAttr2 # the second attribute for the fifth interface # @hideinitializer kvinAttr2 = Attribute('the second attribute for the fifth interface') ##The first method offered for the fifth interface. def kvinMethod(kvinArg1, kvinArg2, *args, **kwargs): pass ##The second method offered for the fifth interface. def kvinMethod2(kvinArg1, kvinArg2='default'): pass ## @property kvinAttr3 # the third attribute for the fifth interface # @hideinitializer kvinAttr3 = Attribute('the third attribute for the fifth interface') ##The third method offered for the fifth interface. def kvinMethod3(kvinArg1, kvinArg2='default'): pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_interfaces.outnc.py0000664000175000017500000000761714150504334022354 0ustar00ericeric# -*- coding: utf-8 -*- ## @brief Typical interfaces definition. # #Here we're just trying to make some typical interface definitions #to better test the doxypypy filter. # # @namespace sample_interfaces from zope.interface import Interface, Attribute # Public API Interfaces ## @brief The zeroth sample interface. # # Nothing special, just a sample interface to help test the # filter. This is a special case commonly known as a "marker # interface" that declares neither methods nor attributes. # # @namespace sample_interfaces.INul # @interface INul class INul(Interface): pass ## @brief The first sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has just a single method. # # @namespace sample_interfaces.IUnu # @interface IUnu class IUnu(Interface): pass ## @brief The first method offered for the first interface. # @namespace sample_interfaces.IUnu.unuMethod def unuMethod(unuArg, *args): pass ## @brief The second sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has multiple methods. # # @namespace sample_interfaces.IDu # @interface IDu class IDu(Interface): pass ## @brief The first method offered for the second interface. # @namespace sample_interfaces.IDu.duMethod def duMethod(duArg1, duArg2): pass ## @brief The second method offered for the second interface. # @namespace sample_interfaces.IDu.duMethod2 def duMethod2(duArg1, **kwargs): pass ## @brief The third sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has just a single attribute. # # @namespace sample_interfaces.ITri # @interface ITri class ITri(Interface): pass ## @property triAttr # the first attribute for the third interface # @hideinitializer triAttr = Attribute('the first attribute for the third interface') ## @brief The fourth sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has multiple attributes. # # @namespace sample_interfaces.IKvar # @interface IKvar class IKvar(Interface): pass ## @property kvarAttr1 # the first attribute for the fourth interface # @hideinitializer kvarAttr1 = Attribute('the first attribute for the fourth interface') ## @property kvarAttr2 # the second attribute for the fourth interface # @hideinitializer kvarAttr2 = Attribute('the second attribute for the fourth interface') ## @brief The fifth sample interface. # # Nothing special, just a sample interface to help test the # filter. This one opens things up a little and has multiple # attributes and methods. # # @namespace sample_interfaces.IKvin # @interface IKvin class IKvin(Interface): pass ## @property kvinAttr1 # the first attribute for the fifth interface # @hideinitializer kvinAttr1 = Attribute('the first attribute for the fifth interface') ## @property kvinAttr2 # the second attribute for the fifth interface # @hideinitializer kvinAttr2 = Attribute('the second attribute for the fifth interface') ## @brief The first method offered for the fifth interface. # @namespace sample_interfaces.IKvin.kvinMethod def kvinMethod(kvinArg1, kvinArg2, *args, **kwargs): pass ## @brief The second method offered for the fifth interface. # @namespace sample_interfaces.IKvin.kvinMethod2 def kvinMethod2(kvinArg1, kvinArg2='default'): pass ## @property kvinAttr3 # the third attribute for the fifth interface # @hideinitializer kvinAttr3 = Attribute('the third attribute for the fifth interface') ## @brief The third method offered for the fifth interface. # @namespace sample_interfaces.IKvin.kvinMethod3 def kvinMethod3(kvinArg1, kvinArg2='default'): pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_interfaces.outnn.py0000664000175000017500000000656214150504334022365 0ustar00ericeric# -*- coding: utf-8 -*- ## @brief Typical interfaces definition. # #Here we're just trying to make some typical interface definitions #to better test the doxypypy filter. # from zope.interface import Interface, Attribute # Public API Interfaces ## @brief The zeroth sample interface. # # Nothing special, just a sample interface to help test the # filter. This is a special case commonly known as a "marker # interface" that declares neither methods nor attributes. # # # @interface INul class INul(Interface): pass ## @brief The first sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has just a single method. # # # @interface IUnu class IUnu(Interface): pass ## @brief The first method offered for the first interface. def unuMethod(unuArg, *args): pass ## @brief The second sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has multiple methods. # # # @interface IDu class IDu(Interface): pass ## @brief The first method offered for the second interface. def duMethod(duArg1, duArg2): pass ## @brief The second method offered for the second interface. def duMethod2(duArg1, **kwargs): pass ## @brief The third sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has just a single attribute. # # # @interface ITri class ITri(Interface): pass ## @property triAttr # the first attribute for the third interface # @hideinitializer triAttr = Attribute('the first attribute for the third interface') ## @brief The fourth sample interface. # # Nothing special, just a sample interface to help test the # filter. This one has multiple attributes. # # # @interface IKvar class IKvar(Interface): pass ## @property kvarAttr1 # the first attribute for the fourth interface # @hideinitializer kvarAttr1 = Attribute('the first attribute for the fourth interface') ## @property kvarAttr2 # the second attribute for the fourth interface # @hideinitializer kvarAttr2 = Attribute('the second attribute for the fourth interface') ## @brief The fifth sample interface. # # Nothing special, just a sample interface to help test the # filter. This one opens things up a little and has multiple # attributes and methods. # # # @interface IKvin class IKvin(Interface): pass ## @property kvinAttr1 # the first attribute for the fifth interface # @hideinitializer kvinAttr1 = Attribute('the first attribute for the fifth interface') ## @property kvinAttr2 # the second attribute for the fifth interface # @hideinitializer kvinAttr2 = Attribute('the second attribute for the fifth interface') ## @brief The first method offered for the fifth interface. def kvinMethod(kvinArg1, kvinArg2, *args, **kwargs): pass ## @brief The second method offered for the fifth interface. def kvinMethod2(kvinArg1, kvinArg2='default'): pass ## @property kvinAttr3 # the third attribute for the fifth interface # @hideinitializer kvinAttr3 = Attribute('the third attribute for the fifth interface') ## @brief The third method offered for the fifth interface. def kvinMethod3(kvinArg1, kvinArg2='default'): pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_interfaces.py0000664000175000017500000000500514150504334021212 0ustar00ericeric# -*- coding: utf-8 -*- """ Typical interfaces definition. Here we're just trying to make some typical interface definitions to better test the doxypypy filter. """ from zope.interface import Interface, Attribute # Public API Interfaces class INul(Interface): """ The zeroth sample interface. Nothing special, just a sample interface to help test the filter. This is a special case commonly known as a "marker interface" that declares neither methods nor attributes. """ class IUnu(Interface): """ The first sample interface. Nothing special, just a sample interface to help test the filter. This one has just a single method. """ def unuMethod(unuArg, *args): """The first method offered for the first interface.""" class IDu(Interface): """ The second sample interface. Nothing special, just a sample interface to help test the filter. This one has multiple methods. """ def duMethod(duArg1, duArg2): """The first method offered for the second interface.""" def duMethod2(duArg1, **kwargs): """The second method offered for the second interface.""" class ITri(Interface): """ The third sample interface. Nothing special, just a sample interface to help test the filter. This one has just a single attribute. """ triAttr = Attribute('the first attribute for the third interface') class IKvar(Interface): """ The fourth sample interface. Nothing special, just a sample interface to help test the filter. This one has multiple attributes. """ kvarAttr1 = Attribute('the first attribute for the fourth interface') kvarAttr2 = Attribute('the second attribute for the fourth interface') class IKvin(Interface): """ The fifth sample interface. Nothing special, just a sample interface to help test the filter. This one opens things up a little and has multiple attributes and methods. """ kvinAttr1 = Attribute('the first attribute for the fifth interface') kvinAttr2 = Attribute('the second attribute for the fifth interface') def kvinMethod(kvinArg1, kvinArg2, *args, **kwargs): """The first method offered for the fifth interface.""" def kvinMethod2(kvinArg1, kvinArg2='default'): """The second method offered for the fifth interface.""" kvinAttr3 = Attribute('the third attribute for the fifth interface') def kvinMethod3(kvinArg1, kvinArg2='default'): """The third method offered for the fifth interface.""" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_maze.out.py0000664000175000017500000000251614150504334020635 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## @brief Generate a simple maze pattern. # #Tip of the hat to both the original Commodore 64 program and the book #"10 Print Chr$(205.5+rnd(1)); Goto 10" that it inspired. # #Note that this is neither the shortest nor the most faithful way to #write this program in Python. Rather it is being used as a simple #example for the doxypypy Doxygen input filter for Python and makes use #of features like keyword arguments and generators and has a docstring #that documents them both appropriately. # # @namespace sample_maze from sys import stdout from random import choice ## @brief Generates a single block of a maze. # # This simple generator randomly picks a character from a list (the two # diagonal lines by default) and returns it on each iteration. # # # @param blockOptions The list of characters to choose from. # # @return # A single character chosen from blockOptions. # # @namespace sample_maze.generateBlock def generateBlock(blockOptions=u"╱╲"): while True: yield choice(blockOptions) # Establish our block generator and generate a series of blocks. blockGenerator = generateBlock() blockCount = 0 while blockCount < 3200: blockCount += 1 print(next(blockGenerator)), # Deal with Python's extra space print weirdness. stdout.softspace = False ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_maze.outbare.py0000664000175000017500000000242014150504334021461 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## #Generate a simple maze pattern. # #Tip of the hat to both the original Commodore 64 program and the book #"10 Print Chr$(205.5+rnd(1)); Goto 10" that it inspired. # #Note that this is neither the shortest nor the most faithful way to #write this program in Python. Rather it is being used as a simple #example for the doxypypy Doxygen input filter for Python and makes use #of features like keyword arguments and generators and has a docstring #that documents them both appropriately. # from sys import stdout from random import choice ## # Generates a single block of a maze. # # This simple generator randomly picks a character from a list (the two # diagonal lines by default) and returns it on each iteration. # # Kwargs: # blockOptions -- The list of characters to choose from. # # Yields: # A single character chosen from blockOptions. # def generateBlock(blockOptions=u"╱╲"): while True: yield choice(blockOptions) # Establish our block generator and generate a series of blocks. blockGenerator = generateBlock() blockCount = 0 while blockCount < 3200: blockCount += 1 print(next(blockGenerator)), # Deal with Python's extra space print weirdness. stdout.softspace = False ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_maze.outnc.py0000664000175000017500000000251614150504334021156 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## @brief Generate a simple maze pattern. # #Tip of the hat to both the original Commodore 64 program and the book #"10 Print Chr$(205.5+rnd(1)); Goto 10" that it inspired. # #Note that this is neither the shortest nor the most faithful way to #write this program in Python. Rather it is being used as a simple #example for the doxypypy Doxygen input filter for Python and makes use #of features like keyword arguments and generators and has a docstring #that documents them both appropriately. # # @namespace sample_maze from sys import stdout from random import choice ## @brief Generates a single block of a maze. # # This simple generator randomly picks a character from a list (the two # diagonal lines by default) and returns it on each iteration. # # # @param blockOptions The list of characters to choose from. # # @return # A single character chosen from blockOptions. # # @namespace sample_maze.generateBlock def generateBlock(blockOptions=u"╱╲"): while True: yield choice(blockOptions) # Establish our block generator and generate a series of blocks. blockGenerator = generateBlock() blockCount = 0 while blockCount < 3200: blockCount += 1 print(next(blockGenerator)), # Deal with Python's extra space print weirdness. stdout.softspace = False ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_maze.outnn.py0000664000175000017500000000241614150504334021170 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## @brief Generate a simple maze pattern. # #Tip of the hat to both the original Commodore 64 program and the book #"10 Print Chr$(205.5+rnd(1)); Goto 10" that it inspired. # #Note that this is neither the shortest nor the most faithful way to #write this program in Python. Rather it is being used as a simple #example for the doxypypy Doxygen input filter for Python and makes use #of features like keyword arguments and generators and has a docstring #that documents them both appropriately. # from sys import stdout from random import choice ## @brief Generates a single block of a maze. # # This simple generator randomly picks a character from a list (the two # diagonal lines by default) and returns it on each iteration. # # # @param blockOptions The list of characters to choose from. # # @return # A single character chosen from blockOptions. # def generateBlock(blockOptions=u"╱╲"): while True: yield choice(blockOptions) # Establish our block generator and generate a series of blocks. blockGenerator = generateBlock() blockCount = 0 while blockCount < 3200: blockCount += 1 print(next(blockGenerator)), # Deal with Python's extra space print weirdness. stdout.softspace = False ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_maze.py0000775000175000017500000000241214150504334020025 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generate a simple maze pattern. Tip of the hat to both the original Commodore 64 program and the book "10 Print Chr$(205.5+rnd(1)); Goto 10" that it inspired. Note that this is neither the shortest nor the most faithful way to write this program in Python. Rather it is being used as a simple example for the doxypypy Doxygen input filter for Python and makes use of features like keyword arguments and generators and has a docstring that documents them both appropriately. """ from sys import stdout from random import choice def generateBlock(blockOptions=u"╱╲"): """ Generates a single block of a maze. This simple generator randomly picks a character from a list (the two diagonal lines by default) and returns it on each iteration. Kwargs: blockOptions -- The list of characters to choose from. Yields: A single character chosen from blockOptions. """ while True: yield choice(blockOptions) # Establish our block generator and generate a series of blocks. blockGenerator = generateBlock() blockCount = 0 while blockCount < 3200: blockCount += 1 print(next(blockGenerator)), # Deal with Python's extra space print weirdness. stdout.softspace = False ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_pep.out.py0000664000175000017500000000071314150504334020462 0ustar00ericeric#!/usr/bin/env python # As close as possible to a direct copy of the sample in PEP 257 and still # be valid code. Simple as can be. complex_zero = 0j ## @brief Form a complex number. # # # @param real the real part (default 0.0) # @param imag the imaginary part (default 0.0) # # # @namespace sample_pep.complex def complex(real=0.0, imag=0.0): if imag == 0.0 and real == 0.0: return complex_zero else: return complex(real, imag) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_pep.outbare.py0000664000175000017500000000066514150504334021322 0ustar00ericeric#!/usr/bin/env python # As close as possible to a direct copy of the sample in PEP 257 and still # be valid code. Simple as can be. complex_zero = 0j ##Form a complex number. # # Keyword arguments: # real -- the real part (default 0.0) # imag -- the imaginary part (default 0.0) # # def complex(real=0.0, imag=0.0): if imag == 0.0 and real == 0.0: return complex_zero else: return complex(real, imag) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_pep.outnc.py0000664000175000017500000000071314150504334021003 0ustar00ericeric#!/usr/bin/env python # As close as possible to a direct copy of the sample in PEP 257 and still # be valid code. Simple as can be. complex_zero = 0j ## @brief Form a complex number. # # # @param real the real part (default 0.0) # @param imag the imaginary part (default 0.0) # # # @namespace sample_pep.complex def complex(real=0.0, imag=0.0): if imag == 0.0 and real == 0.0: return complex_zero else: return complex(real, imag) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_pep.outnn.py0000664000175000017500000000065314150504334021021 0ustar00ericeric#!/usr/bin/env python # As close as possible to a direct copy of the sample in PEP 257 and still # be valid code. Simple as can be. complex_zero = 0j ## @brief Form a complex number. # # # @param real the real part (default 0.0) # @param imag the imaginary part (default 0.0) # # def complex(real=0.0, imag=0.0): if imag == 0.0 and real == 0.0: return complex_zero else: return complex(real, imag) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_pep.py0000664000175000017500000000067314150504334017661 0ustar00ericeric#!/usr/bin/env python # As close as possible to a direct copy of the sample in PEP 257 and still # be valid code. Simple as can be. complex_zero = 0j def complex(real=0.0, imag=0.0): """Form a complex number. Keyword arguments: real -- the real part (default 0.0) imag -- the imaginary part (default 0.0) """ if imag == 0.0 and real == 0.0: return complex_zero else: return complex(real, imag) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_privacy.out.py0000664000175000017500000004726114150504334021364 0ustar00ericeric# -*- coding: utf-8 -*- ## @brief Typical class with private members. # #Here we're just trying to make a fairly straightforward class #that has some private (Python-enforced private, name-mangled) #and protected (by convention only, a.k.a. "bed lump") #variables. # # @namespace sample_privacy __notPrivateModuleAttr__ = 1 ## @var __privateModuleAttr # @hideinitializer # @private __privateModuleAttr = 2 ## @var _protectedModuleAttr # @hideinitializer # @protected _protectedModuleAttr = 3 ## @brief A sample new-style class. # # Nothing special, just a basic new-style class that has some # private and protected members in it. # # @namespace sample_privacy.NewStyleSample class NewStyleSample(): __notPrivateClassAttr__ = 1 ## @var __privateClassAttr # @hideinitializer # @private __privateClassAttr = 2 ## @var _protectedClassAttr # @hideinitializer # @protected _protectedClassAttr = 3 ## @brief This constructor won't be private. # # @namespace sample_privacy.NewStyleSample.__init__ def __init__(self): self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief This will be not be private. # # @namespace sample_privacy.NewStyleSample.__notPrivateClassMethod__ def __notPrivateClassMethod__(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be private. # # @namespace sample_privacy.NewStyleSample.__privateClassMethod # @private def __privateClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be protected. # # @namespace sample_privacy.NewStyleSample._protectedClassMethod # @protected def _protectedClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be public. # # @namespace sample_privacy.NewStyleSample.publicClassMethod def publicClassMethod(self): public = 0 __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.public = public self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr @staticmethod ## @brief This static method will be public. # # @namespace sample_privacy.NewStyleSample.publicClassStaticMethod def publicClassStaticMethod(): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 return __notPrivateAttr__ + __privateAttr + _protectedAttr @classmethod ## @brief This class method will be public. # # @namespace sample_privacy.NewStyleSample.publicClassClassMethod def publicClassClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief An inner not private class. # # Nothing special, just a not private helper class. # # @namespace sample_privacy.NewStyleSample.__innerNotPrivate__ class __innerNotPrivate__(): ## @brief This constructor won't be private. # # @namespace sample_privacy.NewStyleSample.__innerNotPrivate__.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner protected class. # # Nothing special, just a protected helper class. # # @namespace sample_privacy.NewStyleSample.__innerProtected # @private class __innerProtected(): ## @brief This constructor won't be private. # # @namespace sample_privacy.NewStyleSample.__innerProtected.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner private class. # # Nothing special, just a private helper class. # # @namespace sample_privacy.NewStyleSample.__innerPrivate # @private class __innerPrivate(): ## @brief This constructor won't be private. # # @namespace sample_privacy.NewStyleSample.__innerPrivate.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief A sample old-style class. # # Nothing special, just a basic old-style class that has some # private and protected members in it. # # @namespace sample_privacy.OldStyleSample class OldStyleSample(): __notPrivateClassAttr__ = 1 ## @var __privateClassAttr # @hideinitializer # @private __privateClassAttr = 2 ## @var _protectedClassAttr # @hideinitializer # @protected _protectedClassAttr = 3 ## @brief This constructor won't be private. # # @namespace sample_privacy.OldStyleSample.__init__ def __init__(self): self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief This will be not be private. # # @namespace sample_privacy.OldStyleSample.__notPrivateClassMethod__ def __notPrivateClassMethod__(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be private. # # @namespace sample_privacy.OldStyleSample.__privateClassMethod # @private def __privateClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be protected. # # @namespace sample_privacy.OldStyleSample._protectedClassMethod # @protected def _protectedClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be public. # # @namespace sample_privacy.OldStyleSample.publicClassMethod def publicClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr @staticmethod ## @brief This static method will be public. # # @namespace sample_privacy.OldStyleSample.publicClassStaticMethod def publicClassStaticMethod(): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 return __notPrivateAttr__ + __privateAttr + _protectedAttr @classmethod ## @brief This class method will be public. # # @namespace sample_privacy.OldStyleSample.publicClassClassMethod def publicClassClassMethod(self): public = 0 __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.public = public self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief An inner not private class. # # Nothing special, just a not private helper class. # # @namespace sample_privacy.OldStyleSample.__innerNotPrivate__ class __innerNotPrivate__(): ## @brief This constructor won't be private. # # @namespace sample_privacy.OldStyleSample.__innerNotPrivate__.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner protected class. # # Nothing special, just a protected helper class. # # @namespace sample_privacy.OldStyleSample.__innerProtected # @private class __innerProtected(): ## @brief This constructor won't be private. # # @namespace sample_privacy.OldStyleSample.__innerProtected.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner private class. # # Nothing special, just a private helper class. # # @namespace sample_privacy.OldStyleSample.__innerPrivate # @private class __innerPrivate(): ## @brief This constructor won't be private. # # @namespace sample_privacy.OldStyleSample.__innerPrivate.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief A sample function. # # Nothing special, just a basic function that has some private # and protected variables in it. # # @namespace sample_privacy.Function def Function(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## @brief This will not be private. # # @namespace sample_privacy.Function.__notPrivateFunction__ def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be private. # # @namespace sample_privacy.Function.__privateNestedFunction # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be protected. # # @namespace sample_privacy.Function._protectedNestedFunction # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be public. # # @namespace sample_privacy.Function.publicNestedFunction def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ## @brief A sample protected function. # # Nothing special, just a basic protected function that has some # private and protected variables in it. # # @namespace sample_privacy._ProtectedFunction # @protected def _ProtectedFunction(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## @brief This will not be private. # # @namespace sample_privacy._ProtectedFunction.__notPrivateFunction__ def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be private. # # @namespace sample_privacy._ProtectedFunction.__privateNestedFunction # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be protected. # # @namespace sample_privacy._ProtectedFunction._protectedNestedFunction # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be public. # # @namespace sample_privacy._ProtectedFunction.publicNestedFunction def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ## @brief A sample private function. # # Nothing special, just a basic private function that has some # private and protected variables in it. # # @namespace sample_privacy.__PrivateFunction # @private def __PrivateFunction(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## @brief This will not be private. # # @namespace sample_privacy.__PrivateFunction.__notPrivateFunction__ def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be private. # # @namespace sample_privacy.__PrivateFunction.__privateNestedFunction # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be protected. # # @namespace sample_privacy.__PrivateFunction._protectedNestedFunction # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be public. # # @namespace sample_privacy.__PrivateFunction.publicNestedFunction def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_privacy.outbare.py0000664000175000017500000004150014150504334022204 0ustar00ericeric# -*- coding: utf-8 -*- ## #Typical class with private members. # #Here we're just trying to make a fairly straightforward class #that has some private (Python-enforced private, name-mangled) #and protected (by convention only, a.k.a. "bed lump") #variables. # __notPrivateModuleAttr__ = 1 ## @var __privateModuleAttr # @hideinitializer # @private __privateModuleAttr = 2 ## @var _protectedModuleAttr # @hideinitializer # @protected _protectedModuleAttr = 3 ## # A sample new-style class. # # Nothing special, just a basic new-style class that has some # private and protected members in it. # class NewStyleSample(): __notPrivateClassAttr__ = 1 ## @var __privateClassAttr # @hideinitializer # @private __privateClassAttr = 2 ## @var _protectedClassAttr # @hideinitializer # @protected _protectedClassAttr = 3 ## # This constructor won't be private. # def __init__(self): self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## # This will be not be private. # def __notPrivateClassMethod__(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## # This will be private. # # # @private def __privateClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## # This will be protected. # # # @protected def _protectedClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## # This will be public. # def publicClassMethod(self): public = 0 __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.public = public self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr @staticmethod ## # This static method will be public. # def publicClassStaticMethod(): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 return __notPrivateAttr__ + __privateAttr + _protectedAttr @classmethod ## # This class method will be public. # def publicClassClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # An inner not private class. # # Nothing special, just a not private helper class. # class __innerNotPrivate__(): ## # This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## # An inner protected class. # # Nothing special, just a protected helper class. # # # @private class __innerProtected(): ## # This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## # An inner private class. # # Nothing special, just a private helper class. # # # @private class __innerPrivate(): ## # This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## # A sample old-style class. # # Nothing special, just a basic old-style class that has some # private and protected members in it. # class OldStyleSample(): __notPrivateClassAttr__ = 1 ## @var __privateClassAttr # @hideinitializer # @private __privateClassAttr = 2 ## @var _protectedClassAttr # @hideinitializer # @protected _protectedClassAttr = 3 ## # This constructor won't be private. # def __init__(self): self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## # This will be not be private. # def __notPrivateClassMethod__(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## # This will be private. # # # @private def __privateClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## # This will be protected. # # # @protected def _protectedClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## # This will be public. # def publicClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr @staticmethod ## # This static method will be public. # def publicClassStaticMethod(): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 return __notPrivateAttr__ + __privateAttr + _protectedAttr @classmethod ## # This class method will be public. # def publicClassClassMethod(self): public = 0 __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.public = public self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # An inner not private class. # # Nothing special, just a not private helper class. # class __innerNotPrivate__(): ## # This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## # An inner protected class. # # Nothing special, just a protected helper class. # # # @private class __innerProtected(): ## # This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## # An inner private class. # # Nothing special, just a private helper class. # # # @private class __innerPrivate(): ## # This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## # A sample function. # # Nothing special, just a basic function that has some private # and protected variables in it. # def Function(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## # This will not be private. # def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # This will be private. # # # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # This will be protected. # # # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # This will be public. # def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ## # A sample protected function. # # Nothing special, just a basic protected function that has some # private and protected variables in it. # # # @protected def _ProtectedFunction(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## # This will not be private. # def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # This will be private. # # # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # This will be protected. # # # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # This will be public. # def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ## # A sample private function. # # Nothing special, just a basic private function that has some # private and protected variables in it. # # # @private def __PrivateFunction(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## # This will not be private. # def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # This will be private. # # # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # This will be protected. # # # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## # This will be public. # def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_privacy.outnc.py0000664000175000017500000004726114150504334021705 0ustar00ericeric# -*- coding: utf-8 -*- ## @brief Typical class with private members. # #Here we're just trying to make a fairly straightforward class #that has some private (Python-enforced private, name-mangled) #and protected (by convention only, a.k.a. "bed lump") #variables. # # @namespace sample_privacy __notPrivateModuleAttr__ = 1 ## @var __privateModuleAttr # @hideinitializer # @private __privateModuleAttr = 2 ## @var _protectedModuleAttr # @hideinitializer # @protected _protectedModuleAttr = 3 ## @brief A sample new-style class. # # Nothing special, just a basic new-style class that has some # private and protected members in it. # # @namespace sample_privacy.NewStyleSample class NewStyleSample(): __notPrivateClassAttr__ = 1 ## @var __privateClassAttr # @hideinitializer # @private __privateClassAttr = 2 ## @var _protectedClassAttr # @hideinitializer # @protected _protectedClassAttr = 3 ## @brief This constructor won't be private. # # @namespace sample_privacy.NewStyleSample.__init__ def __init__(self): self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief This will be not be private. # # @namespace sample_privacy.NewStyleSample.__notPrivateClassMethod__ def __notPrivateClassMethod__(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be private. # # @namespace sample_privacy.NewStyleSample.__privateClassMethod # @private def __privateClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be protected. # # @namespace sample_privacy.NewStyleSample._protectedClassMethod # @protected def _protectedClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be public. # # @namespace sample_privacy.NewStyleSample.publicClassMethod def publicClassMethod(self): public = 0 __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.public = public self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr @staticmethod ## @brief This static method will be public. # # @namespace sample_privacy.NewStyleSample.publicClassStaticMethod def publicClassStaticMethod(): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 return __notPrivateAttr__ + __privateAttr + _protectedAttr @classmethod ## @brief This class method will be public. # # @namespace sample_privacy.NewStyleSample.publicClassClassMethod def publicClassClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief An inner not private class. # # Nothing special, just a not private helper class. # # @namespace sample_privacy.NewStyleSample.__innerNotPrivate__ class __innerNotPrivate__(): ## @brief This constructor won't be private. # # @namespace sample_privacy.NewStyleSample.__innerNotPrivate__.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner protected class. # # Nothing special, just a protected helper class. # # @namespace sample_privacy.NewStyleSample.__innerProtected # @private class __innerProtected(): ## @brief This constructor won't be private. # # @namespace sample_privacy.NewStyleSample.__innerProtected.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner private class. # # Nothing special, just a private helper class. # # @namespace sample_privacy.NewStyleSample.__innerPrivate # @private class __innerPrivate(): ## @brief This constructor won't be private. # # @namespace sample_privacy.NewStyleSample.__innerPrivate.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief A sample old-style class. # # Nothing special, just a basic old-style class that has some # private and protected members in it. # # @namespace sample_privacy.OldStyleSample class OldStyleSample(): __notPrivateClassAttr__ = 1 ## @var __privateClassAttr # @hideinitializer # @private __privateClassAttr = 2 ## @var _protectedClassAttr # @hideinitializer # @protected _protectedClassAttr = 3 ## @brief This constructor won't be private. # # @namespace sample_privacy.OldStyleSample.__init__ def __init__(self): self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief This will be not be private. # # @namespace sample_privacy.OldStyleSample.__notPrivateClassMethod__ def __notPrivateClassMethod__(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be private. # # @namespace sample_privacy.OldStyleSample.__privateClassMethod # @private def __privateClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be protected. # # @namespace sample_privacy.OldStyleSample._protectedClassMethod # @protected def _protectedClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be public. # # @namespace sample_privacy.OldStyleSample.publicClassMethod def publicClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr @staticmethod ## @brief This static method will be public. # # @namespace sample_privacy.OldStyleSample.publicClassStaticMethod def publicClassStaticMethod(): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 return __notPrivateAttr__ + __privateAttr + _protectedAttr @classmethod ## @brief This class method will be public. # # @namespace sample_privacy.OldStyleSample.publicClassClassMethod def publicClassClassMethod(self): public = 0 __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.public = public self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief An inner not private class. # # Nothing special, just a not private helper class. # # @namespace sample_privacy.OldStyleSample.__innerNotPrivate__ class __innerNotPrivate__(): ## @brief This constructor won't be private. # # @namespace sample_privacy.OldStyleSample.__innerNotPrivate__.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner protected class. # # Nothing special, just a protected helper class. # # @namespace sample_privacy.OldStyleSample.__innerProtected # @private class __innerProtected(): ## @brief This constructor won't be private. # # @namespace sample_privacy.OldStyleSample.__innerProtected.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner private class. # # Nothing special, just a private helper class. # # @namespace sample_privacy.OldStyleSample.__innerPrivate # @private class __innerPrivate(): ## @brief This constructor won't be private. # # @namespace sample_privacy.OldStyleSample.__innerPrivate.__init__ def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief A sample function. # # Nothing special, just a basic function that has some private # and protected variables in it. # # @namespace sample_privacy.Function def Function(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## @brief This will not be private. # # @namespace sample_privacy.Function.__notPrivateFunction__ def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be private. # # @namespace sample_privacy.Function.__privateNestedFunction # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be protected. # # @namespace sample_privacy.Function._protectedNestedFunction # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be public. # # @namespace sample_privacy.Function.publicNestedFunction def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ## @brief A sample protected function. # # Nothing special, just a basic protected function that has some # private and protected variables in it. # # @namespace sample_privacy._ProtectedFunction # @protected def _ProtectedFunction(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## @brief This will not be private. # # @namespace sample_privacy._ProtectedFunction.__notPrivateFunction__ def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be private. # # @namespace sample_privacy._ProtectedFunction.__privateNestedFunction # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be protected. # # @namespace sample_privacy._ProtectedFunction._protectedNestedFunction # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be public. # # @namespace sample_privacy._ProtectedFunction.publicNestedFunction def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ## @brief A sample private function. # # Nothing special, just a basic private function that has some # private and protected variables in it. # # @namespace sample_privacy.__PrivateFunction # @private def __PrivateFunction(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## @brief This will not be private. # # @namespace sample_privacy.__PrivateFunction.__notPrivateFunction__ def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be private. # # @namespace sample_privacy.__PrivateFunction.__privateNestedFunction # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be protected. # # @namespace sample_privacy.__PrivateFunction._protectedNestedFunction # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be public. # # @namespace sample_privacy.__PrivateFunction.publicNestedFunction def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_privacy.outnn.py0000664000175000017500000004170414150504334021714 0ustar00ericeric# -*- coding: utf-8 -*- ## @brief Typical class with private members. # #Here we're just trying to make a fairly straightforward class #that has some private (Python-enforced private, name-mangled) #and protected (by convention only, a.k.a. "bed lump") #variables. # __notPrivateModuleAttr__ = 1 ## @var __privateModuleAttr # @hideinitializer # @private __privateModuleAttr = 2 ## @var _protectedModuleAttr # @hideinitializer # @protected _protectedModuleAttr = 3 ## @brief A sample new-style class. # # Nothing special, just a basic new-style class that has some # private and protected members in it. # class NewStyleSample(): __notPrivateClassAttr__ = 1 ## @var __privateClassAttr # @hideinitializer # @private __privateClassAttr = 2 ## @var _protectedClassAttr # @hideinitializer # @protected _protectedClassAttr = 3 ## @brief This constructor won't be private. # def __init__(self): self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief This will be not be private. # def __notPrivateClassMethod__(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be private. # # # @private def __privateClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be protected. # # # @protected def _protectedClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be public. # def publicClassMethod(self): public = 0 __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.public = public self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr @staticmethod ## @brief This static method will be public. # def publicClassStaticMethod(): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 return __notPrivateAttr__ + __privateAttr + _protectedAttr @classmethod ## @brief This class method will be public. # def publicClassClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief An inner not private class. # # Nothing special, just a not private helper class. # class __innerNotPrivate__(): ## @brief This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner protected class. # # Nothing special, just a protected helper class. # # # @private class __innerProtected(): ## @brief This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner private class. # # Nothing special, just a private helper class. # # # @private class __innerPrivate(): ## @brief This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief A sample old-style class. # # Nothing special, just a basic old-style class that has some # private and protected members in it. # class OldStyleSample(): __notPrivateClassAttr__ = 1 ## @var __privateClassAttr # @hideinitializer # @private __privateClassAttr = 2 ## @var _protectedClassAttr # @hideinitializer # @protected _protectedClassAttr = 3 ## @brief This constructor won't be private. # def __init__(self): self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief This will be not be private. # def __notPrivateClassMethod__(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be private. # # # @private def __privateClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be protected. # # # @protected def _protectedClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr ## @brief This will be public. # def publicClassMethod(self): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr @staticmethod ## @brief This static method will be public. # def publicClassStaticMethod(): __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 return __notPrivateAttr__ + __privateAttr + _protectedAttr @classmethod ## @brief This class method will be public. # def publicClassClassMethod(self): public = 0 __notPrivateAttr__ = 1 ## @var __privateAttr # @hideinitializer # @private __privateAttr = 2 ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = 3 self.public = public self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief An inner not private class. # # Nothing special, just a not private helper class. # class __innerNotPrivate__(): ## @brief This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner protected class. # # Nothing special, just a protected helper class. # # # @private class __innerProtected(): ## @brief This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief An inner private class. # # Nothing special, just a private helper class. # # # @private class __innerPrivate(): ## @brief This constructor won't be private. # def __init__(self): self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 ## @brief A sample function. # # Nothing special, just a basic function that has some private # and protected variables in it. # def Function(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## @brief This will not be private. # def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be private. # # # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be protected. # # # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be public. # def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ## @brief A sample protected function. # # Nothing special, just a basic protected function that has some # private and protected variables in it. # # # @protected def _ProtectedFunction(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## @brief This will not be private. # def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be private. # # # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be protected. # # # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be public. # def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ## @brief A sample private function. # # Nothing special, just a basic private function that has some # private and protected variables in it. # # # @private def __PrivateFunction(): __notPrivateFunctionAttr__ = 1 ## @var __privateFunctionAttr # @hideinitializer # @private __privateFunctionAttr = 2 ## @var _protectedFunctionAttr # @hideinitializer # @protected _protectedFunctionAttr = 3 ## @brief This will not be private. # def __notPrivateFunction__(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be private. # # # @private def __privateNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be protected. # # # @protected def _protectedNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr ## @brief This will be public. # def publicNestedFunction(): __notPrivateAttr__ = __notPrivateFunctionAttr__ ## @var __privateAttr # @hideinitializer # @private __privateAttr = __privateFunctionAttr ## @var _protectedAttr # @hideinitializer # @protected _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_privacy.py0000664000175000017500000003035214150504334020547 0ustar00ericeric# -*- coding: utf-8 -*- """ Typical class with private members. Here we're just trying to make a fairly straightforward class that has some private (Python-enforced private, name-mangled) and protected (by convention only, a.k.a. "bed lump") variables. """ __notPrivateModuleAttr__ = 1 __privateModuleAttr = 2 _protectedModuleAttr = 3 class NewStyleSample(object): """ A sample new-style class. Nothing special, just a basic new-style class that has some private and protected members in it. """ __notPrivateClassAttr__ = 1 __privateClassAttr = 2 _protectedClassAttr = 3 def __init__(self): """ This constructor won't be private. """ self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 def __notPrivateClassMethod__(self): """ This will be not be private. """ __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr def __privateClassMethod(self): """ This will be private. """ __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr def _protectedClassMethod(self): """ This will be protected. """ __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr def publicClassMethod(self): """ This will be public. """ public = 0 __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 self.public = public self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr @staticmethod def publicClassStaticMethod(): """ This static method will be public. """ __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 return __notPrivateAttr__ + __privateAttr + _protectedAttr @classmethod def publicClassClassMethod(self): """ This class method will be public. """ __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr class __innerNotPrivate__(object): """ An inner not private class. Nothing special, just a not private helper class. """ def __init__(self): """ This constructor won't be private. """ self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 class __innerProtected(object): """ An inner protected class. Nothing special, just a protected helper class. """ def __init__(self): """ This constructor won't be private. """ self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 class __innerPrivate(object): """ An inner private class. Nothing special, just a private helper class. """ def __init__(self): """ This constructor won't be private. """ self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 class OldStyleSample(): """ A sample old-style class. Nothing special, just a basic old-style class that has some private and protected members in it. """ __notPrivateClassAttr__ = 1 __privateClassAttr = 2 _protectedClassAttr = 3 def __init__(self): """ This constructor won't be private. """ self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 def __notPrivateClassMethod__(self): """ This will be not be private. """ __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr def __privateClassMethod(self): """ This will be private. """ __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr def _protectedClassMethod(self): """ This will be protected. """ __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr def publicClassMethod(self): """ This will be public. """ __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr @staticmethod def publicClassStaticMethod(): """ This static method will be public. """ __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 return __notPrivateAttr__ + __privateAttr + _protectedAttr @classmethod def publicClassClassMethod(self): """ This class method will be public. """ public = 0 __notPrivateAttr__ = 1 __privateAttr = 2 _protectedAttr = 3 self.public = public self.__notPrivateAttr__ = __notPrivateAttr__ self.__privateAttr = __privateAttr self._protectedAttr = _protectedAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr class __innerNotPrivate__(): """ An inner not private class. Nothing special, just a not private helper class. """ def __init__(self): """ This constructor won't be private. """ self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 class __innerProtected(): """ An inner protected class. Nothing special, just a protected helper class. """ def __init__(self): """ This constructor won't be private. """ self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 class __innerPrivate(): """ An inner private class. Nothing special, just a private helper class. """ def __init__(self): """ This constructor won't be private. """ self.public = 0 self.__notPrivateAttr__ = 1 self.__privateAttr = 2 self._protectedAttr = 3 def Function(): """ A sample function. Nothing special, just a basic function that has some private and protected variables in it. """ __notPrivateFunctionAttr__ = 1 __privateFunctionAttr = 2 _protectedFunctionAttr = 3 def __notPrivateFunction__(): """ This will not be private. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr def __privateNestedFunction(): """ This will be private. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr def _protectedNestedFunction(): """ This will be protected. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr def publicNestedFunction(): """ This will be public. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction def _ProtectedFunction(): """ A sample protected function. Nothing special, just a basic protected function that has some private and protected variables in it. """ __notPrivateFunctionAttr__ = 1 __privateFunctionAttr = 2 _protectedFunctionAttr = 3 def __notPrivateFunction__(): """ This will not be private. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr def __privateNestedFunction(): """ This will be private. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr def _protectedNestedFunction(): """ This will be protected. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr def publicNestedFunction(): """ This will be public. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction def __PrivateFunction(): """ A sample private function. Nothing special, just a basic private function that has some private and protected variables in it. """ __notPrivateFunctionAttr__ = 1 __privateFunctionAttr = 2 _protectedFunctionAttr = 3 def __notPrivateFunction__(): """ This will not be private. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr def __privateNestedFunction(): """ This will be private. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr def _protectedNestedFunction(): """ This will be protected. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr def publicNestedFunction(): """ This will be public. """ __notPrivateAttr__ = __notPrivateFunctionAttr__ __privateAttr = __privateFunctionAttr _protectedAttr = _protectedFunctionAttr return __notPrivateAttr__ + __privateAttr + _protectedAttr return __notPrivateFunction__ + __privateNestedFunction \ + _protectedNestedFunction + publicNestedFunction ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rawdocstring.out.py0000664000175000017500000000414114150504334022403 0ustar00ericeric#!/usr/bin/env python # encoding: utf-8 ## @brief Raw docstrings sample module. # #Tests support for raw docstrings, which are necessary when docstrings contain #escape sequences. # #E.g. TeX-maths: #@f[ # \exp(x) = \sum_{k=0}^{\infty} \frac{x^k}{k!} #@f] # #Related to issue #8 [1]. # #[1]: https://github.com/Feneric/doxypypy/issues/8 # # @namespace sample_rawdocstring ## @brief Calculate the square-root of four. # # @return # @f$ \sqrt{4} @f$. # # @namespace sample_rawdocstring.sqrt4 def sqrt4(): return 2 ## @brief Invert the given number. # # # @param x Invert this number \f$x\f$. # # @return # @f$\frac{1}{x}@f$. # # @namespace sample_rawdocstring.invert def invert(x): return 1/x ## @brief Stores a polynomial. # # Here, a polynomial is defined as a finite series of the form # @f[ # a_0 + a_1 x + a_2 x^2 + \cdots + a_N x^N, # @f] # where \f$ a_k \f$, for \f$k=0,\ldots,N\f$, are real coefficients, and # \f$N\f$ is the degree of the polynomial. # # # # @namespace sample_rawdocstring.Polynomial class Polynomial(): ## @property coefficients # A list of coefficients. ## @brief Initialize a polynomial instance. # # # @param coefficients A list of coefficients. Beginning with \f$a_0\f$, # and ending with \f$a_N\f$. # # @namespace sample_rawdocstring.Polynomial.__init__ def __init__(self, coefficients): self.coefficients = coefficients ## @brief Find the real roots of the polynomial. # # I.e. all real numbers @f$ x_i @f$ for which # \f[ # a_0 + a_1 x_i + a_2 {x_i}^2 + \cdots + a_N {x_i}^N = 0. # \f] # # @return # A list of all real roots, or an empty list if there are none. # # \todo Implement this method. # # @namespace sample_rawdocstring.Polynomial.find_roots def find_roots(self): pass ## @brief Demonstrate polynomial class. # @namespace sample_rawdocstring.main def main(): p = Polynomial([0, 1, 0, 2]) print(p.coefficients) if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rawdocstring.outbare.py0000664000175000017500000000344114150504334023237 0ustar00ericeric#!/usr/bin/env python # encoding: utf-8 ## #Raw docstrings sample module. # #Tests support for raw docstrings, which are necessary when docstrings contain #escape sequences. # #E.g. TeX-maths: #@f[ # \exp(x) = \sum_{k=0}^{\infty} \frac{x^k}{k!} #@f] # #Related to issue #8 [1]. # #[1]: https://github.com/Feneric/doxypypy/issues/8 # ##Calculate the square-root of four. # # Returns: # @f$ \sqrt{4} @f$. # def sqrt4(): return 2 ##Invert the given number. # # Args: # x: Invert this number \f$x\f$. # # Returns: # @f$\frac{1}{x}@f$. # def invert(x): return 1/x ##Stores a polynomial. # # Here, a polynomial is defined as a finite series of the form # @f[ # a_0 + a_1 x + a_2 x^2 + \cdots + a_N x^N, # @f] # where \f$ a_k \f$, for \f$k=0,\ldots,N\f$, are real coefficients, and # \f$N\f$ is the degree of the polynomial. # # Attributes: # coefficients: A list of coefficients. # class Polynomial(): ##Initialize a polynomial instance. # # Args: # coefficients: A list of coefficients. Beginning with \f$a_0\f$, # and ending with \f$a_N\f$. # def __init__(self, coefficients): self.coefficients = coefficients ##Find the real roots of the polynomial. # # I.e. all real numbers @f$ x_i @f$ for which # \f[ # a_0 + a_1 x_i + a_2 {x_i}^2 + \cdots + a_N {x_i}^N = 0. # \f] # # Returns: # A list of all real roots, or an empty list if there are none. # # \todo Implement this method. # def find_roots(self): pass ##Demonstrate polynomial class. def main(): p = Polynomial([0, 1, 0, 2]) print(p.coefficients) if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rawdocstring.outnc.py0000664000175000017500000000414114150504334022724 0ustar00ericeric#!/usr/bin/env python # encoding: utf-8 ## @brief Raw docstrings sample module. # #Tests support for raw docstrings, which are necessary when docstrings contain #escape sequences. # #E.g. TeX-maths: #@f[ # \exp(x) = \sum_{k=0}^{\infty} \frac{x^k}{k!} #@f] # #Related to issue #8 [1]. # #[1]: https://github.com/Feneric/doxypypy/issues/8 # # @namespace sample_rawdocstring ## @brief Calculate the square-root of four. # # @return # @f$ \sqrt{4} @f$. # # @namespace sample_rawdocstring.sqrt4 def sqrt4(): return 2 ## @brief Invert the given number. # # # @param x Invert this number \f$x\f$. # # @return # @f$\frac{1}{x}@f$. # # @namespace sample_rawdocstring.invert def invert(x): return 1/x ## @brief Stores a polynomial. # # Here, a polynomial is defined as a finite series of the form # @f[ # a_0 + a_1 x + a_2 x^2 + \cdots + a_N x^N, # @f] # where \f$ a_k \f$, for \f$k=0,\ldots,N\f$, are real coefficients, and # \f$N\f$ is the degree of the polynomial. # # # # @namespace sample_rawdocstring.Polynomial class Polynomial(): ## @property coefficients # A list of coefficients. ## @brief Initialize a polynomial instance. # # # @param coefficients A list of coefficients. Beginning with \f$a_0\f$, # and ending with \f$a_N\f$. # # @namespace sample_rawdocstring.Polynomial.__init__ def __init__(self, coefficients): self.coefficients = coefficients ## @brief Find the real roots of the polynomial. # # I.e. all real numbers @f$ x_i @f$ for which # \f[ # a_0 + a_1 x_i + a_2 {x_i}^2 + \cdots + a_N {x_i}^N = 0. # \f] # # @return # A list of all real roots, or an empty list if there are none. # # \todo Implement this method. # # @namespace sample_rawdocstring.Polynomial.find_roots def find_roots(self): pass ## @brief Demonstrate polynomial class. # @namespace sample_rawdocstring.main def main(): p = Polynomial([0, 1, 0, 2]) print(p.coefficients) if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rawdocstring.outnn.py0000664000175000017500000000345314150504334022744 0ustar00ericeric#!/usr/bin/env python # encoding: utf-8 ## @brief Raw docstrings sample module. # #Tests support for raw docstrings, which are necessary when docstrings contain #escape sequences. # #E.g. TeX-maths: #@f[ # \exp(x) = \sum_{k=0}^{\infty} \frac{x^k}{k!} #@f] # #Related to issue #8 [1]. # #[1]: https://github.com/Feneric/doxypypy/issues/8 # ## @brief Calculate the square-root of four. # # @return # @f$ \sqrt{4} @f$. # def sqrt4(): return 2 ## @brief Invert the given number. # # # @param x Invert this number \f$x\f$. # # @return # @f$\frac{1}{x}@f$. # def invert(x): return 1/x ## @brief Stores a polynomial. # # Here, a polynomial is defined as a finite series of the form # @f[ # a_0 + a_1 x + a_2 x^2 + \cdots + a_N x^N, # @f] # where \f$ a_k \f$, for \f$k=0,\ldots,N\f$, are real coefficients, and # \f$N\f$ is the degree of the polynomial. # # # class Polynomial(): ## @property coefficients # A list of coefficients. ## @brief Initialize a polynomial instance. # # # @param coefficients A list of coefficients. Beginning with \f$a_0\f$, # and ending with \f$a_N\f$. # def __init__(self, coefficients): self.coefficients = coefficients ## @brief Find the real roots of the polynomial. # # I.e. all real numbers @f$ x_i @f$ for which # \f[ # a_0 + a_1 x_i + a_2 {x_i}^2 + \cdots + a_N {x_i}^N = 0. # \f] # # @return # A list of all real roots, or an empty list if there are none. # # \todo Implement this method. # def find_roots(self): pass ## @brief Demonstrate polynomial class. def main(): p = Polynomial([0, 1, 0, 2]) print(p.coefficients) if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rawdocstring.py0000664000175000017500000000341114150504334021574 0ustar00ericeric#!/usr/bin/env python # encoding: utf-8 r""" Raw docstrings sample module. Tests support for raw docstrings, which are necessary when docstrings contain escape sequences. E.g. TeX-maths: @f[ \exp(x) = \sum_{k=0}^{\infty} \frac{x^k}{k!} @f] Related to issue #8 [1]. [1]: https://github.com/Feneric/doxypypy/issues/8 """ def sqrt4(): r"""Calculate the square-root of four. Returns: @f$ \sqrt{4} @f$. """ return 2 def invert(x): r"""Invert the given number. Args: x: Invert this number \f$x\f$. Returns: @f$\frac{1}{x}@f$. """ return 1/x class Polynomial(object): r"""Stores a polynomial. Here, a polynomial is defined as a finite series of the form @f[ a_0 + a_1 x + a_2 x^2 + \cdots + a_N x^N, @f] where \f$ a_k \f$, for \f$k=0,\ldots,N\f$, are real coefficients, and \f$N\f$ is the degree of the polynomial. Attributes: coefficients: A list of coefficients. """ def __init__(self, coefficients): r"""Initialize a polynomial instance. Args: coefficients: A list of coefficients. Beginning with \f$a_0\f$, and ending with \f$a_N\f$. """ self.coefficients = coefficients def find_roots(self): r"""Find the real roots of the polynomial. I.e. all real numbers @f$ x_i @f$ for which \f[ a_0 + a_1 x_i + a_2 {x_i}^2 + \cdots + a_N {x_i}^N = 0. \f] Returns: A list of all real roots, or an empty list if there are none. \todo Implement this method. """ pass def main(): """Demonstrate polynomial class.""" p = Polynomial([0, 1, 0, 2]) print(p.coefficients) if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rstexample.out.py0000664000175000017500000000407014150504334022062 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## @brief Test some restrucutred Text docstrings. # #It should process them into valid doxygen tags and formatings. # # @namespace sample_rstexample import sys ## @brief ExampleClass just for testing rst docstrings. # # It's meant to be processed as regular text. # # with literal code section # which is just treated as is. # by doxygen. # until it ends on former paragraph indent. # # Here is a new regular text. # # # @namespace sample_rstexample.ExampleClass class ExampleClass: ## @brief Just inits a ExampleClass object. # # @namespace sample_rstexample.ExampleClass.__init__ def __init__(self): self.member = "Value" ## @brief And here is a typical method. # # With parameters # #@param new Which holds some random string. # @n type of new: str #@param other For random number input # @n type of other: int #@param yet_another Yet another number for input. # @n type of yet_another: int, optional paramter, Default = 0 # #@return Just some result as example number # @n return type of : int # # @namespace sample_rstexample.ExampleClass.methodExample def methodExample(self, new : str, other: int, yet_another : int = 0) -> int: self.member = "NewValue" + new return 2 + other ## @brief This function should work even on module level. # #@param arg [in] Some thingumabob to this function. with alternative type description. #@return Nothing # # But describe a table of other things. # # Table 1 # With entries | Heads | Cols # ---------------| ---------| -------- # 1. Entry | Big | First # 2. Entry | Smaller | Third # 3. Entry | Rare | Even # - | - | - # # And other textes too. # # @namespace sample_rstexample.generic_function def generic_function(arg : int): print(arg) a = arg arg = a ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rstexample.outbare.py0000664000175000017500000000352214150504334022715 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## #Test some restrucutred Text docstrings. # #It should process them into valid doxygen tags and formatings. # import sys ## # ExampleClass just for testing rst docstrings. # # It's meant to be processed as regular text. # # with literal code section # which is just treated as is. # by doxygen. # until it ends on former paragraph indent. # # Here is a new regular text. # # class ExampleClass: ## # Just inits a ExampleClass object. # def __init__(self): self.member = "Value" ## # And here is a typical method. # # With parameters # # :param new: Which holds some random string. # :type new: str # :param other: For random number input # :type other: int # :param yet_another: Yet another number for input. # :type yet_another: int, optional paramter, Default = 0 # # :return: Just some result as example number # :rtype: int # def methodExample(self, new : str, other: int, yet_another : int = 0) -> int: self.member = "NewValue" + new return 2 + other ## # This function should work even on module level. # # :param [in] arg: Some thingumabob to this function. with alternative type description. # :return: Nothing # # But describe a table of other things. # # =============== ========= ======== # With entries Heads Cols # =============== ========= ======== # 1. Entry Big First # 2. Entry Smaller Third # 3. Entry Rare Even # =============== ========= ======== # # And other textes too. # def generic_function(arg : int): print(arg) a = arg arg = a ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rstexample.outeq.py0000664000175000017500000000346214150504334022414 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## @brief Test some restrucutred Text docstrings. # #It should process them into valid doxygen tags and formatings. # import sys ## @brief ExampleClass just for testing rst docstrings. # # It's meant to be processed as regular text. # # with literal code section # which is just treated as is. # by doxygen. # until it ends on former paragraph indent. # # Here is a new regular text. # # class ExampleClass: ## @brief Just inits a ExampleClass object. # def __init__(self): self.member = "Value" ## @brief And here is a typical method. # # With parameters # #@param new Which holds some random string. # @n type of new: str #@param other For random number input # @n type of other: int #@param yet_another Yet another number for input. # @n type of yet_another: int, optional paramter, Default = 0 # #@return Just some result as example number # @n return type of : int # def methodExample(self, new : str, other: int, yet_another : int = 0) -> int: self.member = "NewValue" + new return 2 + other ## @brief This function should work even on module level. # #@param arg [in] Some thingumabob to this function. with alternative type description. #@return Nothing # # But describe a table of other things. # # Table 1 # With entries | Heads | Cols # ---------------| ---------| -------- # 1. Entry | Big | First # 2. Entry | Smaller | Third # 3. Entry | Rare | Even # - | - | - # # And other textes too. # def generic_function(arg : int): print(arg) a = arg arg = a ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rstexample.outnc.py0000664000175000017500000000407014150504334022403 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## @brief Test some restrucutred Text docstrings. # #It should process them into valid doxygen tags and formatings. # # @namespace sample_rstexample import sys ## @brief ExampleClass just for testing rst docstrings. # # It's meant to be processed as regular text. # # with literal code section # which is just treated as is. # by doxygen. # until it ends on former paragraph indent. # # Here is a new regular text. # # # @namespace sample_rstexample.ExampleClass class ExampleClass: ## @brief Just inits a ExampleClass object. # # @namespace sample_rstexample.ExampleClass.__init__ def __init__(self): self.member = "Value" ## @brief And here is a typical method. # # With parameters # #@param new Which holds some random string. # @n type of new: str #@param other For random number input # @n type of other: int #@param yet_another Yet another number for input. # @n type of yet_another: int, optional paramter, Default = 0 # #@return Just some result as example number # @n return type of : int # # @namespace sample_rstexample.ExampleClass.methodExample def methodExample(self, new : str, other: int, yet_another : int = 0) -> int: self.member = "NewValue" + new return 2 + other ## @brief This function should work even on module level. # #@param arg [in] Some thingumabob to this function. with alternative type description. #@return Nothing # # But describe a table of other things. # # Table 1 # With entries | Heads | Cols # ---------------| ---------| -------- # 1. Entry | Big | First # 2. Entry | Smaller | Third # 3. Entry | Rare | Even # - | - | - # # And other textes too. # # @namespace sample_rstexample.generic_function def generic_function(arg : int): print(arg) a = arg arg = a ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rstexample.outnn.py0000664000175000017500000000350614150504334022421 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- ## @brief Test some restrucutred Text docstrings. # #It should process them into valid doxygen tags and formatings. # import sys ## @brief ExampleClass just for testing rst docstrings. # # It's meant to be processed as regular text. # # with literal code section # which is just treated as is. # by doxygen. # until it ends on former paragraph indent. # # Here is a new regular text. # # class ExampleClass: ## @brief Just inits a ExampleClass object. # def __init__(self): self.member = "Value" ## @brief And here is a typical method. # # With parameters # #@param new Which holds some random string. # @n type of new: str #@param other For random number input # @n type of other: int #@param yet_another Yet another number for input. # @n type of yet_another: int, optional paramter, Default = 0 # #@return Just some result as example number # @n return type of : int # def methodExample(self, new : str, other: int, yet_another : int = 0) -> int: self.member = "NewValue" + new return 2 + other ## @brief This function should work even on module level. # #@param arg [in] Some thingumabob to this function. with alternative type description. #@return Nothing # # But describe a table of other things. # # Table 1 # With entries | Heads | Cols # ---------------| ---------| -------- # 1. Entry | Big | First # 2. Entry | Smaller | Third # 3. Entry | Rare | Even # - | - | - # # And other textes too. # def generic_function(arg : int): print(arg) a = arg arg = a ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_rstexample.py0000664000175000017500000000356314150504334021262 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test some restrucutred Text docstrings. It should process them into valid doxygen tags and formatings. """ import sys class ExampleClass: """ ExampleClass just for testing rst docstrings. It's meant to be processed as regular text. with literal code section which is just treated as is. by doxygen. until it ends on former paragraph indent. Here is a new regular text. """ def __init__(self): """ Just inits a ExampleClass object. """ self.member = "Value" def methodExample(self, new : str, other: int, yet_another : int = 0) -> int: """ And here is a typical method. With parameters :param new: Which holds some random string. :type new: str :param other: For random number input :type other: int :param yet_another: Yet another number for input. :type yet_another: int, optional paramter, Default = 0 :return: Just some result as example number :rtype: int """ self.member = "NewValue" + new return 2 + other def generic_function(arg : int): """ This function should work even on module level. :param [in] arg: Some thingumabob to this function. with alternative type description. :return: Nothing But describe a table of other things. =============== ========= ======== With entries Heads Cols =============== ========= ======== 1. Entry Big First 2. Entry Smaller Third 3. Entry Rare Even =============== ========= ======== And other textes too. """ print(arg) a = arg arg = a ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_sections.out.py0000664000175000017500000000210114150504334021516 0ustar00ericeric#!/usr/bin/env python # encoding: utf-8 ## @brief Sample documentation the arbitrary section handling. # #Related to issue #7 [1]. # #[1]: https://github.com/Feneric/doxypypy/issues/7 # # @namespace sample_sections ## @brief A simple function of two arguments. # # This function takes two arguments, but does absolutely nothing with them. # However, it sends out a friendly greeting to the world. # # # @param arg1 The first argument # @param arg2 The second argument # # @return # A string stating "Hello World" # # @b Examples # @code # >>> function(1, 2) # "Hello World" # >>> function('a', 'b') # "Hello World" # @endcode # # @par Intent # The intent is to demonstrate sections like this one within docstrings. # How they behave with multiple lines. # @par # And how they behave with multiple paragraphs. # That contain multiple lines. # # Paragraphs standing by themselves without indentation, should be left alone. # # @namespace sample_sections.function def function(arg1, arg2): return "Hello World" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_sections.outbare.py0000664000175000017500000000174614150504334022366 0ustar00ericeric#!/usr/bin/env python # encoding: utf-8 ## #Sample documentation the arbitrary section handling. # #Related to issue #7 [1]. # #[1]: https://github.com/Feneric/doxypypy/issues/7 # ##A simple function of two arguments. # # This function takes two arguments, but does absolutely nothing with them. # However, it sends out a friendly greeting to the world. # # Args: # arg1: The first argument # arg2: The second argument # # Returns: # A string stating "Hello World" # # Examples: # >>> function(1, 2) # "Hello World" # >>> function('a', 'b') # "Hello World" # # Intent: # The intent is to demonstrate sections like this one within docstrings. # How they behave with multiple lines. # # And how they behave with multiple paragraphs. # That contain multiple lines. # # Paragraphs standing by themselves without indentation, should be left alone. # def function(arg1, arg2): return "Hello World" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_sections.outnc.py0000664000175000017500000000206014150504334022043 0ustar00ericeric#!/usr/bin/env python # encoding: utf-8 ## @brief Sample documentation the arbitrary section handling. # #Related to issue #7 [1]. # #[1]: https://github.com/Feneric/doxypypy/issues/7 # # @namespace sample_sections ## @brief A simple function of two arguments. # # This function takes two arguments, but does absolutely nothing with them. # However, it sends out a friendly greeting to the world. # # # @param arg1 The first argument # @param arg2 The second argument # # @return # A string stating "Hello World" # # @par Examples # >>> function(1, 2) # "Hello World" # >>> function('a', 'b') # "Hello World" # # @par Intent # The intent is to demonstrate sections like this one within docstrings. # How they behave with multiple lines. # @par # And how they behave with multiple paragraphs. # That contain multiple lines. # # Paragraphs standing by themselves without indentation, should be left alone. # # @namespace sample_sections.function def function(arg1, arg2): return "Hello World" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_sections.outnn.py0000664000175000017500000000177614150504334022073 0ustar00ericeric#!/usr/bin/env python # encoding: utf-8 ## @brief Sample documentation the arbitrary section handling. # #Related to issue #7 [1]. # #[1]: https://github.com/Feneric/doxypypy/issues/7 # ## @brief A simple function of two arguments. # # This function takes two arguments, but does absolutely nothing with them. # However, it sends out a friendly greeting to the world. # # # @param arg1 The first argument # @param arg2 The second argument # # @return # A string stating "Hello World" # # @b Examples # @code # >>> function(1, 2) # "Hello World" # >>> function('a', 'b') # "Hello World" # @endcode # # @par Intent # The intent is to demonstrate sections like this one within docstrings. # How they behave with multiple lines. # @par # And how they behave with multiple paragraphs. # That contain multiple lines. # # Paragraphs standing by themselves without indentation, should be left alone. # def function(arg1, arg2): return "Hello World" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_sections.py0000664000175000017500000000172614150504334020724 0ustar00ericeric#!/usr/bin/env python # encoding: utf-8 """ Sample documentation the arbitrary section handling. Related to issue #7 [1]. [1]: https://github.com/Feneric/doxypypy/issues/7 """ def function(arg1, arg2): """A simple function of two arguments. This function takes two arguments, but does absolutely nothing with them. However, it sends out a friendly greeting to the world. Args: arg1: The first argument arg2: The second argument Returns: A string stating "Hello World" Examples: >>> function(1, 2) "Hello World" >>> function('a', 'b') "Hello World" Intent: The intent is to demonstrate sections like this one within docstrings. How they behave with multiple lines. And how they behave with multiple paragraphs. That contain multiple lines. Paragraphs standing by themselves without indentation, should be left alone. """ return "Hello World" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf16bebom.out.py0000664000175000017500000000064014150504334021647 0ustar00ericeric#!/bin/env python # UTF-16-BE Python File with a BOM ## @brief A UTF-16BE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # # @namespace sample_utf16bebom print('Hello, I am in UTF-16BE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf16bebom.outbare.py0000664000175000017500000000057014150504334022503 0ustar00ericeric#!/bin/env python # UTF-16-BE Python File with a BOM ## #A UTF-16BE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # #Note: # See how doxypypy converts this note and the # following warning. # #Warning: # Be sure to save this file in the proper encoding. # print('Hello, I am in UTF-16BE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf16bebom.outnc.py0000664000175000017500000000064014150504334022170 0ustar00ericeric#!/bin/env python # UTF-16-BE Python File with a BOM ## @brief A UTF-16BE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # # @namespace sample_utf16bebom print('Hello, I am in UTF-16BE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf16bebom.outnn.py0000664000175000017500000000060114150504334022200 0ustar00ericeric#!/bin/env python # UTF-16-BE Python File with a BOM ## @brief A UTF-16BE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # print('Hello, I am in UTF-16BE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf16bebom.py0000664000175000017500000000134214150504334021041 0ustar00ericericþÿ#!/bin/env python # UTF-16-BE Python File with a BOM """ A UTF-16BE File identified by BOM. This doesn't have much to it, but it identifies itself using a BOM rather than a coding line. Note: See how doxypypy converts this note and the following warning. Warning: Be sure to save this file in the proper encoding. """ print('Hello, I am in UTF-16BE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf16lebom.out.py0000664000175000017500000000064014150504334021661 0ustar00ericeric#!/bin/env python # UTF-16-LE Python File with a BOM ## @brief A UTF-16LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # # @namespace sample_utf16lebom print('Hello, I am in UTF-16LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf16lebom.outbare.py0000664000175000017500000000057014150504334022515 0ustar00ericeric#!/bin/env python # UTF-16-LE Python File with a BOM ## #A UTF-16LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # #Note: # See how doxypypy converts this note and the # following warning. # #Warning: # Be sure to save this file in the proper encoding. # print('Hello, I am in UTF-16LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf16lebom.outnc.py0000664000175000017500000000064014150504334022202 0ustar00ericeric#!/bin/env python # UTF-16-LE Python File with a BOM ## @brief A UTF-16LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # # @namespace sample_utf16lebom print('Hello, I am in UTF-16LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf16lebom.outnn.py0000664000175000017500000000060114150504334022212 0ustar00ericeric#!/bin/env python # UTF-16-LE Python File with a BOM ## @brief A UTF-16LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # print('Hello, I am in UTF-16LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf16lebom.py0000664000175000017500000000134214150504334021053 0ustar00ericericÿþ#!/bin/env python # UTF-16-LE Python File with a BOM """ A UTF-16LE File identified by BOM. This doesn't have much to it, but it identifies itself using a BOM rather than a coding line. Note: See how doxypypy converts this note and the following warning. Warning: Be sure to save this file in the proper encoding. """ print('Hello, I am in UTF-16LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf32bebom.out.py0000664000175000017500000000064014150504334021645 0ustar00ericeric#!/bin/env python # UTF-16-LE Python File with a BOM ## @brief A UTF-16LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # # @namespace sample_utf32bebom print('Hello, I am in UTF-16LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf32bebom.outbare.py0000664000175000017500000000057014150504334022501 0ustar00ericeric#!/bin/env python # UTF-16-LE Python File with a BOM ## #A UTF-16LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # #Note: # See how doxypypy converts this note and the # following warning. # #Warning: # Be sure to save this file in the proper encoding. # print('Hello, I am in UTF-16LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf32bebom.outnc.py0000664000175000017500000000064014150504334022166 0ustar00ericeric#!/bin/env python # UTF-16-LE Python File with a BOM ## @brief A UTF-16LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # # @namespace sample_utf32bebom print('Hello, I am in UTF-16LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf32bebom.outnn.py0000664000175000017500000000060114150504334022176 0ustar00ericeric#!/bin/env python # UTF-16-LE Python File with a BOM ## @brief A UTF-16LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # print('Hello, I am in UTF-16LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf32bebom.py0000664000175000017500000000270414150504334021042 0ustar00ericericþÿ#!/bin/env python # UTF-16-LE Python File with a BOM """ A UTF-16LE File identified by BOM. This doesn't have much to it, but it identifies itself using a BOM rather than a coding line. Note: See how doxypypy converts this note and the following warning. Warning: Be sure to save this file in the proper encoding. """ print('Hello, I am in UTF-16LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf32lebom.out.py0000664000175000017500000000064014150504334021657 0ustar00ericeric#!/bin/env python # UTF-32-LE Python File with a BOM ## @brief A UTF-32LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # # @namespace sample_utf32lebom print('Hello, I am in UTF-32LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf32lebom.outbare.py0000664000175000017500000000057014150504334022513 0ustar00ericeric#!/bin/env python # UTF-32-LE Python File with a BOM ## #A UTF-32LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # #Note: # See how doxypypy converts this note and the # following warning. # #Warning: # Be sure to save this file in the proper encoding. # print('Hello, I am in UTF-32LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf32lebom.outnc.py0000664000175000017500000000064014150504334022200 0ustar00ericeric#!/bin/env python # UTF-32-LE Python File with a BOM ## @brief A UTF-32LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # # @namespace sample_utf32lebom print('Hello, I am in UTF-32LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf32lebom.outnn.py0000664000175000017500000000060114150504334022210 0ustar00ericeric#!/bin/env python # UTF-32-LE Python File with a BOM ## @brief A UTF-32LE File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # print('Hello, I am in UTF-32LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf32lebom.py0000664000175000017500000000270414150504334021054 0ustar00ericericÿþ#!/bin/env python # UTF-32-LE Python File with a BOM """ A UTF-32LE File identified by BOM. This doesn't have much to it, but it identifies itself using a BOM rather than a coding line. Note: See how doxypypy converts this note and the following warning. Warning: Be sure to save this file in the proper encoding. """ print('Hello, I am in UTF-32LE encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf8bom.out.py0000664000175000017500000000062314150504334021262 0ustar00ericeric#!/bin/env python # UTF-8 Python File with a BOM ## @brief A UTF-8 File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # # @namespace sample_utf8bom print('Hello, I am in UTF-8 encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf8bom.outbare.py0000664000175000017500000000055614150504334022121 0ustar00ericeric#!/bin/env python # UTF-8 Python File with a BOM ## #A UTF-8 File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # #Note: # See how doxypypy converts this note and the # following warning. # #Warning: # Be sure to save this file in the proper encoding. # print('Hello, I am in UTF-8 encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf8bom.outnc.py0000664000175000017500000000062314150504334021603 0ustar00ericeric#!/bin/env python # UTF-8 Python File with a BOM ## @brief A UTF-8 File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # # @namespace sample_utf8bom print('Hello, I am in UTF-8 encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf8bom.outnn.py0000664000175000017500000000056714150504334021625 0ustar00ericeric#!/bin/env python # UTF-8 Python File with a BOM ## @brief A UTF-8 File identified by BOM. # #This doesn't have much to it, but it identifies itself #using a BOM rather than a coding line. # # @note # See how doxypypy converts this note and the # following warning. # # @warning # Be sure to save this file in the proper encoding. # print('Hello, I am in UTF-8 encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638041820.0 doxypypy-0.8.8.7/doxypypy/test/sample_utf8bom.py0000664000175000017500000000055114150504334020454 0ustar00ericeric#!/bin/env python # UTF-8 Python File with a BOM """ A UTF-8 File identified by BOM. This doesn't have much to it, but it identifies itself using a BOM rather than a coding line. Note: See how doxypypy converts this note and the following warning. Warning: Be sure to save this file in the proper encoding. """ print('Hello, I am in UTF-8 encoding.') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638149674.0 doxypypy-0.8.8.7/doxypypy/test/test_doxypypy.py0000775000175000017500000007036414151027052020505 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tests the doxypypy filter. These tests may all be executed by running tox from the root level of the project. """ import unittest from argparse import Namespace from os import linesep, sep from os.path import basename, splitext from ast import parse from codecs import open as codecsOpen from sys import version_info from pytest import mark from ..doxypypy import AstWalker class TestDoxypypy(unittest.TestCase): """ Define our doxypypy tests. """ maxDiff = None __Options = Namespace( autobrief=True, autocode=True, debug=False, fullPathNamespace='dummy', topLevelNamespace='dummy', tablength=4, filename='dummy.py', object_respect=False, equalIndent=False, keepDecorators=False ) __dummySrc = [ "print('testing: one, two, three, & four') " + linesep, "print('is five.')\t" + linesep ] __strippedDummySrc = linesep.join([ "print('testing: one, two, three, & four')", "print('is five.')" ]) __sampleBasics = [ { 'name': 'onelinefunction', 'visitor': 'visit_FunctionDef', 'inputCode': '''def testFunctionOneLine(): """Here is the brief."""''', 'expectedOutput': [ '## @brief Here is the brief.\n# @namespace dummy.testFunctionOneLine', 'def testFunctionOneLine():' ] }, { 'name': 'onelineclass', 'visitor': 'visit_ClassDef', 'inputCode': '''class testClassOneLine(object): """Here is the brief."""''', 'expectedOutput': [ '## @brief Here is the brief.\n# @namespace dummy.testClassOneLine', 'class testClassOneLine():' ] }, { 'name': 'basicfunction', 'visitor': 'visit_FunctionDef', 'inputCode': '''def testFunctionBrief(): """Here is the brief. Here is the body. Unlike the brief it has multiple lines."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#', '# Here is the body. Unlike the brief', '# it has multiple lines.\n# @namespace dummy.testFunctionBrief', 'def testFunctionBrief():' ] }, { 'name': 'basicclass', 'visitor': 'visit_ClassDef', 'inputCode': '''class testClassBrief(object): """Here is the brief. Here is the body. Unlike the brief it has multiple lines."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#', '# Here is the body. Unlike the brief', '# it has multiple lines.\n# @namespace dummy.testClassBrief', 'class testClassBrief():' ] }, { 'name': 'basicfunctionnobrief', 'visitor': 'visit_FunctionDef', 'inputCode': '''def testFunctionNoBrief(): """Here is the body. It's not a brief as it has multiple lines."""''', 'expectedOutput': [ "##Here is the body. It's not a brief as", '# it has multiple lines.\n# @namespace dummy.testFunctionNoBrief', 'def testFunctionNoBrief():' ] }, { 'name': 'basicclassnobrief', 'visitor': 'visit_ClassDef', 'inputCode': '''class testClassNoBrief(object): """Here is the body. It's not a brief as it has multiple lines."""''', 'expectedOutput': [ "##Here is the body. It's not a brief as", '# it has multiple lines.\n# @namespace dummy.testClassNoBrief', 'class testClassNoBrief():' ] } ] __sampleArgs = [ { 'name': 'onearg', 'visitor': 'visit_FunctionDef', 'inputCode': '''def testFunctionArg(arg): """Here is the brief. Args: arg -- a test argument."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#', '# @param\t\targ\ta test argument.\n# @namespace dummy.testFunctionArg', 'def testFunctionArg(arg):' ] }, { 'name': 'multipleargs', 'visitor': 'visit_FunctionDef', 'inputCode': '''def testFunctionArgs(arg1, arg2, arg3): """Here is the brief. Arguments: arg1: a test argument. arg2: another test argument. arg3: yet another test argument."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#', '# @param\t\targ1\ta test argument.', '# @param\t\targ2\tanother test argument.', '# @param\t\targ3\tyet another test argument.\n# @namespace dummy.testFunctionArgs', 'def testFunctionArgs(arg1, arg2, arg3):' ] }, { 'name': 'multiplelineargs', 'visitor': 'visit_FunctionDef', 'inputCode': '''def testFunctionArgsMulti( arg1, arg2, arg3 ): """Here is the brief. Arguments: arg1: a test argument. arg2: another test argument. arg3: yet another test argument."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#', '# @param\t\targ1\ta test argument.', '# @param\t\targ2\tanother test argument.', '# @param\t\targ3\tyet another test argument.\n# @namespace dummy.testFunctionArgsMulti', 'def testFunctionArgsMulti(', ' arg1,', ' arg2,', ' arg3', ' ):' ] } ] __sampleAttrs = [ { 'name': 'oneattr', 'visitor': 'visit_ClassDef', 'inputCode': '''class testClassAttr(object): """Here is the brief. Attributes: attr -- a test attribute."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#\n# @namespace dummy.testClassAttr', 'class testClassAttr():', '\n## @property\t\tattr\n# a test attribute.' ] }, { 'name': 'multipleattrs', 'visitor': 'visit_ClassDef', 'inputCode': '''class testClassArgs(object): """Here is the brief. Attributes: attr1: a test attribute. attr2: another test attribute. attr3: yet another test attribute."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#\n# @namespace dummy.testClassArgs', 'class testClassArgs():', '\n## @property\t\tattr1\n# a test attribute.', '\n## @property\t\tattr2\n# another test attribute.', '\n## @property\t\tattr3\n# yet another test attribute.' ] } ] __sampleReturns = [ { 'name': 'returns', 'visitor': 'visit_FunctionDef', 'inputCode': '''def testFunctionReturns(): """Here is the brief. Returns: Good stuff."""''', 'expectedOutput': [ '## @brief Here is the brief.', '# @return', '# Good stuff.\n# @namespace dummy.testFunctionReturns', 'def testFunctionReturns():' ] }, { 'name': 'yields', 'visitor': 'visit_FunctionDef', 'inputCode': '''def testFunctionYields(): """Here is the brief. Yields: Good stuff."""''', 'expectedOutput': [ '## @brief Here is the brief.', '# @return', '# Good stuff.\n# @namespace dummy.testFunctionYields', 'def testFunctionYields():' ] } ] __sampleRaises = [ { 'name': 'oneraises', 'visitor': 'visit_FunctionDef', 'inputCode': '''def testFunctionRaisesOne(): """Here is the brief. Raises: MyException: bang bang a boom."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#', '# @exception\t\tMyException\tbang bang a boom.\n# @namespace dummy.testFunctionRaisesOne', 'def testFunctionRaisesOne():' ] }, { 'name': 'multipleraises', 'visitor': 'visit_FunctionDef', 'inputCode': '''def testFunctionRaisesMultiple(): """Here is the brief. Raises: MyException1 -- bang bang a boom. MyException2 -- crash. MyException3 -- splatter."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#', '# @exception\t\tMyException1\tbang bang a boom.', '# @exception\t\tMyException2\tcrash.', '# @exception\t\tMyException3\tsplatter.\n# @namespace dummy.testFunctionRaisesMultiple', 'def testFunctionRaisesMultiple():' ] }, { 'name': 'oneraisesclass', 'visitor': 'visit_ClassDef', 'inputCode': '''class testClassRaisesOne(object): """Here is the brief. Raises: MyException: bang bang a boom."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#', '# @exception\t\tMyException\tbang bang a boom.\n# @namespace dummy.testClassRaisesOne', 'class testClassRaisesOne():' ] }, { 'name': 'multipleraisesclass', 'visitor': 'visit_ClassDef', 'inputCode': '''class testClassRaisesMultiple(object): """Here is the brief. Raises: MyException1 -- bang bang a boom. MyException2 -- crash. MyException3 -- splatter."""''', 'expectedOutput': [ '## @brief Here is the brief.', '#', '# @exception\t\tMyException1\tbang bang a boom.', '# @exception\t\tMyException2\tcrash.', '# @exception\t\tMyException3\tsplatter.\n# @namespace dummy.testClassRaisesMultiple', 'class testClassRaisesMultiple():' ] } ] __linesep_for_source = ''' ''' """ detect the line ending within test string constants above -> as git can check out \n on windows too it's git configuration dependent if these line endings are OS specific or just \n. """ def setUp(self): """ Sets up a temporary AST for use with our unit tests. """ self.options = TestDoxypypy.__Options self.dummyWalker = AstWalker(TestDoxypypy.__dummySrc, self.options) def test_stripOutAnds(self): """ Test the stripOutAnds method. """ testPairs = { 'This and that.': 'This that.', 'This & that.': 'This that.', 'This, that, & more.': 'This, that, more.', 'This and that & etc.': 'This that etc.', 'Handy.': 'Handy.', 'This, that, &c.': 'This, that, &c.' } for pair in testPairs.items(): self.assertEqual(self.dummyWalker._stripOutAnds(pair[0]), pair[1]) def test_endCodeIfNeeded(self): """ Test the endCodeIfNeeded method. """ testPairs = { ('unu', False): ('unu', False), ('du', True): ('# @endcode' + linesep + 'du', False), ('tri kvar', True): ('# @endcode' + linesep + 'tri kvar', False), ('kvin \t', True): ('# @endcode' + linesep + 'kvin', False) } for pair in testPairs.items(): self.assertEqual(self.dummyWalker._endCodeIfNeeded(*pair[0]), pair[1]) def test_checkIfCode(self): """ Tests the checkIfCode method on the code side. """ testPairs = [ ( [ 'This is prose, not code.', '...', '>>> print("Now we have code.")' ], [ 'This is prose, not code.', '...{0}# @code{0}'.format(linesep), '>>> print("Now we have code.")' ] ), ( [ 'This is prose, not code.', 'Traceback: frobnotz failure', '>>> print("Now we have code.")' ], [ 'This is prose, not code.', 'Traceback: frobnotz failure{0}# @code{0}'.format(linesep), '>>> print("Now we have code.")' ] ), ( [ 'This is prose, not code.', '>>> print("Now we have code.")' ], [ 'This is prose, not code.{0}# @code{0}'.format(linesep), '>>> print("Now we have code.")' ] ), ( [ 'This is prose, not code.', 'This is still prose, not code.', 'Another line of prose to really be sure.', 'Ditto again, still prose.', '>>> print("Now we have code.")' ], [ 'This is prose, not code.', 'This is still prose, not code.', 'Another line of prose to really be sure.', 'Ditto again, still prose.{0}# @code{0}'.format(linesep), '>>> print("Now we have code.")' ] ) ] for testLines, outputLines in testPairs: inCodeBlockObj = [False] codeChecker = self.dummyWalker._checkIfCode(inCodeBlockObj) for lineNum, line in enumerate(testLines): codeChecker.send((line, testLines, lineNum)) self.assertEqual(testLines, outputLines) def test_checkIfProse(self): """ Tests the checkIfCode method on the prose side. """ testPairs = [ ( [ '...', 'This is prose, not code.' ], [ '...{0}# @endcode{0}'.format(linesep), 'This is prose, not code.' ] ), ( [ 'Traceback: frobnotz error', 'This is prose, not code.' ], [ 'Traceback: frobnotz error{0}# @endcode{0}'.format(linesep), 'This is prose, not code.' ] ), ( [ '>>> print("Code.")', 'This is prose, not code.' ], [ '>>> print("Code."){0}# @endcode{0}'.format(linesep), 'This is prose, not code.' ] ), ( [ '>>> myVar = 23', '>>> print(myVar)', '', 'This is prose, not code.' ], [ '>>> myVar = 23', '>>> print(myVar)', '{0}# @endcode{0}'.format(linesep), 'This is prose, not code.' ] ), ( [ '>>> myVar = 23', '>>> print(myVar)', '>>> myVar += 5', '>>> print(myVar)', '', 'This is prose, not code.' ], [ '>>> myVar = 23', '>>> print(myVar)', '>>> myVar += 5', '>>> print(myVar)', '{0}# @endcode{0}'.format(linesep), 'This is prose, not code.' ] ) ] for testLines, outputLines in testPairs: inCodeBlockObj = [True] proseChecker = self.dummyWalker._checkIfCode(inCodeBlockObj) for lineNum, line in enumerate(testLines): proseChecker.send((line, testLines, lineNum)) self.assertEqual(testLines, outputLines) def test_checkMemberName(self): """ Test the checkMemberName method. """ testPairs = { 'public': None, '_protected': 'protected', '_stillProtected_': 'protected', '__private': 'private', '__stillPrivate_': 'private', '__notPrivate__': None } for pair in testPairs.items(): self.assertEqual(self.dummyWalker._checkMemberName(pair[0]), pair[1]) def test_getFullPathName(self): """ Test the getFullPathName method. """ self.assertEqual(self.dummyWalker._getFullPathName([('one', 'class')]), [('dummy', 'module'), ('one', 'class')]) def test_getLines(self): """ Test the getLines method. """ self.assertEqual(self.dummyWalker.getLines(), TestDoxypypy.__strippedDummySrc) def test_parseLines(self): """ Test the parseLines method. """ # For our sample data parseLines doesn't change anything. self.dummyWalker.parseLines() self.assertEqual(self.dummyWalker.getLines(), TestDoxypypy.__strippedDummySrc) def snippetComparison(self, sampleSnippets): """ Compare docstring parsing for a list of code snippets. """ options_name = self.options.filename for snippetTest in sampleSnippets: self.options.filename = snippetTest['name'] + '.py' testWalker = AstWalker(snippetTest['inputCode'].split(self.__linesep_for_source), self.options) funcAst = parse(snippetTest['inputCode']) getattr(testWalker, snippetTest['visitor'])(funcAst.body[0]) testWalker.lines[:] = [line.replace(linesep, self.__linesep_for_source) for line in testWalker.lines] self.assertEqual(testWalker.lines, snippetTest['expectedOutput']) self.options.filename = options_name def test_sampleBasics(self): """ Tests the proper handling of basic docstrings. """ self.snippetComparison(TestDoxypypy.__sampleBasics) def test_sampleArgs(self): """ Tests the proper handling of arguments in function docstrings. """ self.snippetComparison(TestDoxypypy.__sampleArgs) def test_sampleAttrs(self): """ Tests the proper handling of attributes in class docstrings. """ self.snippetComparison(TestDoxypypy.__sampleAttrs) def test_sampleReturns(self): """ Tests the proper handling of returns and yields in function docstrings. """ self.snippetComparison(TestDoxypypy.__sampleReturns) def test_sampleRaises(self): """ Tests the proper handling of raises in function and class docstrings. """ self.snippetComparison(TestDoxypypy.__sampleRaises) @staticmethod def readAndParseFile(options, encoding="ASCII"): """ Helper function to read and parse a given file and create an AST walker. """ inFilename = options.filename # Read contents of input file. if encoding == 'ASCII': inFile = open(inFilename) else: inFile = codecsOpen(inFilename, encoding=encoding) lines = inFile.readlines() inFile.close() # Create the abstract syntax tree for the input file. testWalker = AstWalker(lines, options) testWalker.parseLines() # Output the modified source. return testWalker.getLines() def compareAgainstGoldStandard(self, inFilename, encoding="ASCII", equalIndent=False): """ Compare the results against expectations. Read and process the input file and compare its output against the gold standard. """ inFilenameBase = splitext(basename(inFilename))[0] fullPathNamespace = inFilenameBase.replace(sep, '.') if not equalIndent: trials = ( ('.out', Namespace( autobrief=True, autocode=True, debug=False, fullPathNamespace=fullPathNamespace, topLevelNamespace=inFilenameBase, tablength=4, filename=inFilename, object_respect=False, equalIndent=equalIndent, keepDecorators=False )), ('.outnc', Namespace( autobrief=True, autocode=False, debug=False, fullPathNamespace=fullPathNamespace, topLevelNamespace=inFilenameBase, tablength=4, filename=inFilename, object_respect=False, equalIndent=equalIndent, keepDecorators=False )), ('.outnn', Namespace( autobrief=True, autocode=True, debug=False, fullPathNamespace=fullPathNamespace, topLevelNamespace=None, tablength=4, filename=inFilename, object_respect=False, equalIndent=equalIndent, keepDecorators=False )), ('.outbare', Namespace( autobrief=False, autocode=False, debug=False, fullPathNamespace=fullPathNamespace, topLevelNamespace=None, tablength=4, filename=inFilename, object_respect=False, equalIndent=equalIndent, keepDecorators=False )) ) else: trials = (('.outeq', Namespace( autobrief=True, autocode=True, debug=False, fullPathNamespace=fullPathNamespace, topLevelNamespace=None, tablength=4, filename=inFilename, object_respect=True, equalIndent=equalIndent, keepDecorators=False )),) for options in trials: output = self.readAndParseFile(options[1], encoding=encoding) goldFilename = splitext(inFilename)[0] + options[0] + '.py' goldFile = open(goldFilename) goldContentLines = goldFile.readlines() goldFile.close() # We have to go through some extra processing to ensure line # endings match across platforms. goldContent = linesep.join(line.rstrip() for line in goldContentLines) self.assertEqual(output.rstrip(linesep), goldContent.rstrip(linesep)) def test_pepProcessing(self): """ Test the basic example included in PEP 257. """ sampleName = 'doxypypy/test/sample_pep.py' self.compareAgainstGoldStandard(sampleName) @mark.skipif(version_info < (3, 0), reason="different behavior for Python 2") def test_privacyProcessing(self): """ Test an example with different combinations of public, protected, and private. """ sampleName = 'doxypypy/test/sample_privacy.py' self.compareAgainstGoldStandard(sampleName) def test_googleProcessing(self): """ Test the examples in the Google Python Style Guide. """ sampleName = 'doxypypy/test/sample_google.py' self.compareAgainstGoldStandard(sampleName) def test_rawdocstringProcessing(self): """ Test raw docstrings. """ sampleName = 'doxypypy/test/sample_rawdocstring.py' self.compareAgainstGoldStandard(sampleName) def test_sectionsProcessing(self): """ Test arbitrary sections handling. """ sampleName = 'doxypypy/test/sample_sections.py' self.compareAgainstGoldStandard(sampleName) def test_docExampleProcessing(self): """ Test the basic example used in the doxypypy docs. """ sampleName = 'doxypypy/test/sample_docexample.py' self.compareAgainstGoldStandard(sampleName) def test_interfaceProcessing(self): """ Test an example with ZOPE style interfaces. """ sampleName = 'doxypypy/test/sample_interfaces.py' self.compareAgainstGoldStandard(sampleName) def test_maze(self): """ Test a basic example inspired by the Commodore one-liner. """ sampleName = 'doxypypy/test/sample_maze.py' self.compareAgainstGoldStandard(sampleName) def test_utf8_bom(self): """ Test a trivial UTF-8 file with a BOM. """ sampleName = 'doxypypy/test/sample_utf8bom.py' self.compareAgainstGoldStandard(sampleName, encoding="UTF-8-SIG") def test_utf16be_bom(self): """ Test a trivial UTF-16-BE file with a BOM. """ sampleName = 'doxypypy/test/sample_utf16bebom.py' self.compareAgainstGoldStandard(sampleName, encoding="UTF-16") def test_utf16le_bom(self): """ Test a trivial UTF-16-LE file with a BOM. """ sampleName = 'doxypypy/test/sample_utf16lebom.py' self.compareAgainstGoldStandard(sampleName, encoding="UTF-16") def test_utf32be_bom(self): """ Test a trivial UTF-32-BE file with a BOM. """ sampleName = 'doxypypy/test/sample_utf32bebom.py' self.compareAgainstGoldStandard(sampleName, encoding="UTF-32") def test_utf32le_bom(self): """ Test a trivial UTF-32-LE file with a BOM. """ sampleName = 'doxypypy/test/sample_utf32lebom.py' self.compareAgainstGoldStandard(sampleName, encoding="UTF-32") @mark.skipif(version_info < (3, 0), reason="not supported in Python 2") def test_rstProcessing(self): """ Test the examples for rst styles. """ sampleName = 'doxypypy/test/sample_rstexample.py' self.compareAgainstGoldStandard(sampleName) @mark.skipif(version_info < (3, 0), reason="not supported in Python 2") def test_indentProcessing(self): """ Test the examples with rst and indentation reduction. """ sampleName = 'doxypypy/test/sample_rstexample.py' self.compareAgainstGoldStandard(sampleName, equalIndent=True) @mark.skipif(version_info < (3, 0), reason="not supported in Python 2") def test_asyncProcessing(self): """ Test the examples with async functions and methods. """ sampleName = 'doxypypy/test/sample_async.py' self.compareAgainstGoldStandard(sampleName) if __name__ == '__main__': # When executed from the command line, run all the tests via unittest. # e.g. from root of this repository: (this makes relative module import resolving easier ...) # python -m unittest doxypypy.test.test_doxypypy # python -m unittest doxypypy.test.test_doxypypy.TestDoxypypy.test_sampleArgs -v --locals # from unittest import main main() ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1675629870.509549 doxypypy-0.8.8.7/doxypypy.egg-info/0000775000175000017500000000000014370012457015673 5ustar00ericeric././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1675629870.0 doxypypy-0.8.8.7/doxypypy.egg-info/PKG-INFO0000664000175000017500000002022414370012456016767 0ustar00ericericMetadata-Version: 2.1 Name: doxypypy Version: 0.8.8.7 Summary: A Doxygen filter for Python Home-page: https://github.com/Feneric/doxypypy Author: Eric W. Brown Keywords: Doxygen filter Python documentation Classifier: Development Status :: 4 - Beta Classifier: Environment :: Console Classifier: Environment :: Plugins Classifier: Intended Audience :: Developers Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2) Classifier: Natural Language :: English Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX Classifier: Operating System :: Unix Classifier: Programming Language :: Python Classifier: Topic :: Software Development :: Documentation Provides-Extra: testing License-File: LICENSE.txt doxypypy ======== *A more Pythonic version of doxypy, a Doxygen filter for Python.* Intent ------ For now Doxygen_ has limited support for Python. It recognizes Python comments, but otherwise treats the language as being more or less like Java. It doesn't understand basic Python syntax constructs like docstrings, keyword arguments, generators, nested functions, decorators, or lambda expressions. It likewise doesn't understand conventional constructs like doctests or ZOPE-style interfaces. It does however support inline filters that can be used to make input source code a little more like what it's expecting. The excellent doxypy_ makes it possible to embed Doxygen commands in Python docstrings, and have those docstrings converted to Doxygen-recognized comments on the fly per Doxygen's regular input filtering process. It however does not address any of the other previously mentioned areas of difficulty. This project started off as a fork of doxypy but quickly became quite distinct. It shares little (if any) of the same code at this point (but maintains the original license just in case). It is meant to support all the same command line options as doxypy, but handle additional Python syntax beyond docstrings. Additional Syntax Supported --------------------------- Python can have functions and classes within both functions and classes. Doxygen best understands this concept via its notion of namespaces. This filter thus can supply Doxygen tags marking namespaces on every function and class. This addresses the issue of Doxygen merging inner functions' documentation with the documentation of the parent. Python class members whose names begin with a double-underscore are mangled and kept private by the language. Doxygen does not understand this natively yet, so this filter additionally provides Doxygen tags to label such variables as private. Python frequently embeds doctests within docstrings. This filter makes it trivial to mark off such sections of the docstring so they get displayed as code. ZOPE-style interfaces overload class definitions to be interface definitions, use embedded variable assignments to identify attributes, and use specific function calls to indicate interface adherence. Furthermore, they frequently don't have any code beyond their docstrings, so naively removing docstrings would result in broken Python. This filter has basic understanding of these interfaces and treats them accordingly, supplying Doxygen tags as appropriate. Fundamentally Python docstrings are meant for humans and not machines, and ought not to have special mark-up beyond conventional structured text. This filter heuristically examines Python docstrings, and ones like the sample for complex in `PEP 257`_ or that generally follow the stricter `Google Python Style Guide`_ will get appropriate Doxygen tags automatically added. How It Works ------------ This project takes a radically different approach than doxypy. Rather than use regular expressions tied to a state machine to figure out syntax, Python's own Abstract Syntax Tree module is used to extract items of interest. If the `autobrief` option is enabled, docstrings are parsed via a set of regular expressions and a producer / consumer pair of coroutines. Example ------- This filter will correctly process code like the following working (albeit contrived) example: .. code-block:: python def myfunction(arg1, arg2, kwarg='whatever.'): """ Does nothing more than demonstrate syntax. This is an example of how a Pythonic human-readable docstring can get parsed by doxypypy and marked up with Doxygen commands as a regular input filter to Doxygen. Args: arg1: A positional argument. arg2: Another positional argument. Kwargs: kwarg: A keyword argument. Returns: A string holding the result. Raises: ZeroDivisionError, AssertionError, & ValueError. Examples: >>> myfunction(2, 3) '5 - 0, whatever.' >>> myfunction(5, 0, 'oops.') Traceback (most recent call last): ... ZeroDivisionError: integer division or modulo by zero >>> myfunction(4, 1, 'got it.') '5 - 4, got it.' >>> myfunction(23.5, 23, 'oh well.') Traceback (most recent call last): ... AssertionError >>> myfunction(5, 50, 'too big.') Traceback (most recent call last): ... ValueError """ assert isinstance(arg1, int) if arg2 > 23: raise ValueError return '{0} - {1}, {2}'.format(arg1 + arg2, arg1 / arg2, kwarg) There are a few points to note: 1. No special tags are used. Best practice human-readable section headers are enough. 2. Some flexibility is allowed. Most common names for sections are accepted, and items and descriptions may be separated by either colons or dashes. 3. The brief must be the first item and be no longer than one line. 4. Everything thrown into an examples section will be treated as code, so it's the perfect place for doctests. Additional more comprehensive examples can be found in the test area. Installing doxypypy ------------------- One can use either :code:`pip` or :code:`easy_install` for installation. Running either: .. code-block:: shell pip install doxypypy or: .. code-block:: shell easy_install doxypypy with administrator privileges should do the trick. Many Linux distributions have packages for doxypypy, so if you are using Linux you may find it more convenient to use :code:`aptitude`, :code:`apt`, :code:`apt-get`, :code:`yum`, :code:`dnf`, etc. as appropriate for your system to install the version tested by the distribution maintainer. It will often be available as separate packages for both Python 3 and Python 2. Previewing doxypypy Output -------------------------- After successful installation, doxypypy can be run from the command line to preview the filtered results with: .. code-block:: shell doxypypy -a -c file.py Typically you'll want to redirect output to a file for viewing in a text editor: .. code-block:: shell doxypypy -a -c file.py > file.py.out Invoking doxypypy from Doxygen ------------------------------ To make Doxygen run your Python code through doxypypy, set the FILTER\_PATTERNS tag in your Doxyfile as follows: .. code-block:: shell FILTER_PATTERNS = *.py=py_filter `py_filter` must be available in your path as a shell script (or Windows batch file). If you wish to run `py_filter` in a particular directory you can include the full or relative path. For Unix-like operating systems, `py_filter` should like something like this: .. code-block:: shell #!/bin/bash doxypypy -a -c $1 In Windows, the batch file should be named `py_filter.bat`, and need only contain the one line: .. code-block:: shell doxypypy -a -c %1 Running Doxygen as usual should now run all Python code through doxypypy. Be sure to carefully browse the Doxygen output the first time to make sure that Doxygen properly found and executed doxypypy. .. _Doxygen: http://www.stack.nl/~dimitri/doxygen/ .. _doxypy: https://github.com/Feneric/doxypy .. _PEP 257: http://www.python.org/dev/peps/pep-0257/ .. _Google Python Style Guide: https://google.github.io/styleguide/pyguide.html?showone=Comments#Comments ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1675629870.0 doxypypy-0.8.8.7/doxypypy.egg-info/SOURCES.txt0000664000175000017500000000622614370012456017564 0ustar00ericericLICENSE.txt MANIFEST.in README.rst setup.py doxypypy/__init__.py doxypypy/doxypypy.py doxypypy.egg-info/PKG-INFO doxypypy.egg-info/SOURCES.txt doxypypy.egg-info/dependency_links.txt doxypypy.egg-info/entry_points.txt doxypypy.egg-info/requires.txt doxypypy.egg-info/top_level.txt doxypypy/test/__init__.py doxypypy/test/sample_async.out.py doxypypy/test/sample_async.outbare.py doxypypy/test/sample_async.outnc.py doxypypy/test/sample_async.outnn.py doxypypy/test/sample_async.py doxypypy/test/sample_docexample.out.py doxypypy/test/sample_docexample.outbare.py doxypypy/test/sample_docexample.outnc.py doxypypy/test/sample_docexample.outnn.py doxypypy/test/sample_docexample.py doxypypy/test/sample_google.out.py doxypypy/test/sample_google.outbare.py doxypypy/test/sample_google.outnc.py doxypypy/test/sample_google.outnn.py doxypypy/test/sample_google.py doxypypy/test/sample_interfaces.out.py doxypypy/test/sample_interfaces.outbare.py doxypypy/test/sample_interfaces.outnc.py doxypypy/test/sample_interfaces.outnn.py doxypypy/test/sample_interfaces.py doxypypy/test/sample_maze.out.py doxypypy/test/sample_maze.outbare.py doxypypy/test/sample_maze.outnc.py doxypypy/test/sample_maze.outnn.py doxypypy/test/sample_maze.py doxypypy/test/sample_pep.out.py doxypypy/test/sample_pep.outbare.py doxypypy/test/sample_pep.outnc.py doxypypy/test/sample_pep.outnn.py doxypypy/test/sample_pep.py doxypypy/test/sample_privacy.out.py doxypypy/test/sample_privacy.outbare.py doxypypy/test/sample_privacy.outnc.py doxypypy/test/sample_privacy.outnn.py doxypypy/test/sample_privacy.py doxypypy/test/sample_rawdocstring.out.py doxypypy/test/sample_rawdocstring.outbare.py doxypypy/test/sample_rawdocstring.outnc.py doxypypy/test/sample_rawdocstring.outnn.py doxypypy/test/sample_rawdocstring.py doxypypy/test/sample_rstexample.out.py doxypypy/test/sample_rstexample.outbare.py doxypypy/test/sample_rstexample.outeq.py doxypypy/test/sample_rstexample.outnc.py doxypypy/test/sample_rstexample.outnn.py doxypypy/test/sample_rstexample.py doxypypy/test/sample_sections.out.py doxypypy/test/sample_sections.outbare.py doxypypy/test/sample_sections.outnc.py doxypypy/test/sample_sections.outnn.py doxypypy/test/sample_sections.py doxypypy/test/sample_utf16bebom.out.py doxypypy/test/sample_utf16bebom.outbare.py doxypypy/test/sample_utf16bebom.outnc.py doxypypy/test/sample_utf16bebom.outnn.py doxypypy/test/sample_utf16bebom.py doxypypy/test/sample_utf16lebom.out.py doxypypy/test/sample_utf16lebom.outbare.py doxypypy/test/sample_utf16lebom.outnc.py doxypypy/test/sample_utf16lebom.outnn.py doxypypy/test/sample_utf16lebom.py doxypypy/test/sample_utf32bebom.out.py doxypypy/test/sample_utf32bebom.outbare.py doxypypy/test/sample_utf32bebom.outnc.py doxypypy/test/sample_utf32bebom.outnn.py doxypypy/test/sample_utf32bebom.py doxypypy/test/sample_utf32lebom.out.py doxypypy/test/sample_utf32lebom.outbare.py doxypypy/test/sample_utf32lebom.outnc.py doxypypy/test/sample_utf32lebom.outnn.py doxypypy/test/sample_utf32lebom.py doxypypy/test/sample_utf8bom.out.py doxypypy/test/sample_utf8bom.outbare.py doxypypy/test/sample_utf8bom.outnc.py doxypypy/test/sample_utf8bom.outnn.py doxypypy/test/sample_utf8bom.py doxypypy/test/test_doxypypy.py././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1675629870.0 doxypypy-0.8.8.7/doxypypy.egg-info/dependency_links.txt0000664000175000017500000000000114370012456021740 0ustar00ericeric ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1675629870.0 doxypypy-0.8.8.7/doxypypy.egg-info/entry_points.txt0000664000175000017500000000006414370012456021170 0ustar00ericeric[console_scripts] doxypypy = doxypypy.doxypypy:main ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1675629870.0 doxypypy-0.8.8.7/doxypypy.egg-info/requires.txt0000664000175000017500000000003614370012456020271 0ustar00ericericchardet [testing] pytest tox ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1675629870.0 doxypypy-0.8.8.7/doxypypy.egg-info/top_level.txt0000664000175000017500000000001114370012456020414 0ustar00ericericdoxypypy ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1675629870.5175488 doxypypy-0.8.8.7/setup.cfg0000664000175000017500000000004614370012457014115 0ustar00ericeric[egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1675629165.0 doxypypy-0.8.8.7/setup.py0000775000175000017500000000260314370011155014004 0ustar00ericeric#!/usr/bin/env python # -*- coding: utf-8 -*- """Setup file for the doxypypy package.""" from setuptools import setup, find_packages from os.path import dirname, join from os import chdir if dirname(__file__): chdir(dirname(__file__)) setup( name='doxypypy', version='0.8.8.7', description='A Doxygen filter for Python', long_description=open(join(dirname(__file__), 'README.rst')).read(), keywords='Doxygen filter Python documentation', author='Eric W. Brown', url='https://github.com/Feneric/doxypypy', packages=find_packages(), install_requires=[ 'chardet' ], test_suite='doxypypy.test.test_doxypypy', extras_require={ 'testing': ['pytest', 'tox'], }, entry_points={ 'console_scripts': [ 'doxypypy = doxypypy.doxypypy:main' ] }, classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Plugins', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', 'Natural Language :: English', 'Operating System :: MacOS :: MacOS X', 'Operating System :: POSIX', 'Operating System :: Unix', 'Programming Language :: Python', 'Topic :: Software Development :: Documentation' ] )