piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 1 | # |
| 2 | # Copyright 2010 Free Software Foundation, Inc. |
| 3 | # |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 4 | # This file was generated by gr_modtool, a tool from the GNU Radio framework |
| 5 | # This file is a part of gr-gsm |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 6 | # |
| 7 | # GNU Radio is free software; you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; either version 3, or (at your option) |
| 10 | # any later version. |
| 11 | # |
| 12 | # GNU Radio is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with GNU Radio; see the file COPYING. If not, write to |
| 19 | # the Free Software Foundation, Inc., 51 Franklin Street, |
| 20 | # Boston, MA 02110-1301, USA. |
| 21 | # |
| 22 | """ |
| 23 | Python interface to contents of doxygen xml documentation. |
| 24 | |
| 25 | Example use: |
| 26 | See the contents of the example folder for the C++ and |
| 27 | doxygen-generated xml used in this example. |
| 28 | |
| 29 | >>> # Parse the doxygen docs. |
| 30 | >>> import os |
| 31 | >>> this_dir = os.path.dirname(globals()['__file__']) |
| 32 | >>> xml_path = this_dir + "/example/xml/" |
| 33 | >>> di = DoxyIndex(xml_path) |
| 34 | |
| 35 | Get a list of all top-level objects. |
| 36 | |
| 37 | >>> print([mem.name() for mem in di.members()]) |
| 38 | [u'Aadvark', u'aadvarky_enough', u'main'] |
| 39 | |
| 40 | Get all functions. |
| 41 | |
| 42 | >>> print([mem.name() for mem in di.in_category(DoxyFunction)]) |
| 43 | [u'aadvarky_enough', u'main'] |
| 44 | |
| 45 | Check if an object is present. |
| 46 | |
| 47 | >>> di.has_member(u'Aadvark') |
| 48 | True |
| 49 | >>> di.has_member(u'Fish') |
| 50 | False |
| 51 | |
| 52 | Get an item by name and check its properties. |
| 53 | |
| 54 | >>> aad = di.get_member(u'Aadvark') |
| 55 | >>> print(aad.brief_description) |
| 56 | Models the mammal Aadvark. |
| 57 | >>> print(aad.detailed_description) |
| 58 | Sadly the model is incomplete and cannot capture all aspects of an aadvark yet. |
| 59 | <BLANKLINE> |
| 60 | This line is uninformative and is only to test line breaks in the comments. |
| 61 | >>> [mem.name() for mem in aad.members()] |
| 62 | [u'aadvarkness', u'print', u'Aadvark', u'get_aadvarkness'] |
| 63 | >>> aad.get_member(u'print').brief_description |
| 64 | u'Outputs the vital aadvark statistics.' |
| 65 | |
| 66 | """ |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 67 | from __future__ import unicode_literals |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 68 | |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 69 | from .doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 70 | |
| 71 | def _test(): |
| 72 | import os |
| 73 | this_dir = os.path.dirname(globals()['__file__']) |
| 74 | xml_path = this_dir + "/example/xml/" |
| 75 | di = DoxyIndex(xml_path) |
| 76 | # Get the Aadvark class |
| 77 | aad = di.get_member('Aadvark') |
| 78 | aad.brief_description |
| 79 | import doctest |
| 80 | return doctest.testmod() |
| 81 | |
| 82 | if __name__ == "__main__": |
| 83 | _test() |
| 84 | |