blob: 3b0a580d6117a3be67b6d92b89d64ca7f45340d1 [file] [log] [blame]
piotr437f5462014-02-04 17:57:25 +01001#
2# Copyright 2010 Free Software Foundation, Inc.
3#
Vasil Velichkov1789ae22019-08-13 20:32:05 +00004# This file was generated by gr_modtool, a tool from the GNU Radio framework
5# This file is a part of gr-gsm
piotr437f5462014-02-04 17:57:25 +01006#
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"""
23Python interface to contents of doxygen xml documentation.
24
25Example use:
26See the contents of the example folder for the C++ and
27doxygen-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
35Get 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
40Get all functions.
41
42>>> print([mem.name() for mem in di.in_category(DoxyFunction)])
43[u'aadvarky_enough', u'main']
44
45Check if an object is present.
46
47>>> di.has_member(u'Aadvark')
48True
49>>> di.has_member(u'Fish')
50False
51
52Get an item by name and check its properties.
53
54>>> aad = di.get_member(u'Aadvark')
55>>> print(aad.brief_description)
56Models the mammal Aadvark.
57>>> print(aad.detailed_description)
58Sadly the model is incomplete and cannot capture all aspects of an aadvark yet.
59<BLANKLINE>
60This 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
64u'Outputs the vital aadvark statistics.'
65
66"""
Vasil Velichkov1789ae22019-08-13 20:32:05 +000067from __future__ import unicode_literals
piotr437f5462014-02-04 17:57:25 +010068
Vasil Velichkov1789ae22019-08-13 20:32:05 +000069from .doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther
piotr437f5462014-02-04 17:57:25 +010070
71def _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
82if __name__ == "__main__":
83 _test()
84