docs.py
Go to the documentation of this file.
1 import xml.etree.ElementTree as ET
2 
3 
4 class Doc():
5  def __init__(self, tree):
6  self.tree = tree
7 
8  def get_tree(self):
9  """Get this Doc's tree.
10 
11  Returns:
12  The xml.etree.ElementTree object of the documentation.
13  """
14  return self.tree
15 
16  def __eq__(self, other):
17  if other is None or other.get_tree() is None:
18  return None
19 
20  return ET.tostring(self.tree.getroot()) == \
21  ET.tostring(other.get_tree().getroot())
22 
23 
24 class ClassDoc(Doc):
25  pass
26 
27 
28 class FreeDoc(Doc):
29  pass
30 
31 
32 class Docs():
33  def __init__(self, class_docs, free_docs):
34  # These are dicts that map file_path -> Doc
35  self.class_docs = class_docs
36  self.free_docs = free_docs
37 
38  def get_class_docs(self, class_name):
39  '''Get the documentation for the class.
40 
41  Arguments:
42  class_name -- the name of the class
43 
44  Returns:
45  The ClassDoc with the class's documentation. None if the class does not
46  exist.
47  '''
48  return self.class_docs.get(class_name)
49 
50  def get_free_docs(self, free_func_name):
51  '''Get the documentation for a free function.
52 
53  Arguments:
54  free_func_name -- the name of the free function
55 
56  Returns:
57  The FreeDoc with the free function's documentation. None if the class
58  does not exist.
59  '''
60  return self.free_docs.get(free_func_name)
61 
63  return list(self.class_docs)
64 
66  return list(self.free_docs)
67 
69  return list(self.class_docs.values())
70 
72  return list(self.free_docs.values())
docs.Docs.free_docs
free_docs
Definition: docs.py:36
list
Definition: pytypes.h:2166
docs.Doc.tree
tree
Definition: docs.py:6
docs.ClassDoc
Definition: docs.py:24
docs.Doc.__init__
def __init__(self, tree)
Definition: docs.py:5
different_sigmas::values
HybridValues values
Definition: testHybridBayesNet.cpp:245
docs.Docs.get_class_docs_keys_list
def get_class_docs_keys_list(self)
Definition: docs.py:62
docs.Docs.get_free_docs
def get_free_docs(self, free_func_name)
Definition: docs.py:50
docs.Doc
Definition: docs.py:4
docs.Docs.class_docs
class_docs
Definition: docs.py:35
docs.Docs.__init__
def __init__(self, class_docs, free_docs)
Definition: docs.py:33
docs.Docs
Definition: docs.py:32
docs.Docs.get_free_docs_keys_list
def get_free_docs_keys_list(self)
Definition: docs.py:65
docs.Docs.get_class_docs
def get_class_docs(self, class_name)
Definition: docs.py:38
docs.Docs.get_class_docs_values_list
def get_class_docs_values_list(self)
Definition: docs.py:68
docs.Docs.get_free_docs_values_list
def get_free_docs_values_list(self)
Definition: docs.py:71
get
Container::iterator get(Container &c, Position position)
Definition: stdlist_overload.cpp:29
docs.Doc.__eq__
def __eq__(self, other)
Definition: docs.py:16
docs.Doc.get_tree
def get_tree(self)
Definition: docs.py:8


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:13