doc_template.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())
def __init__(self, class_docs, free_docs)
Definition: doc_template.py:33
def get_free_docs(self, free_func_name)
Definition: doc_template.py:50
def __eq__(self, other)
Definition: doc_template.py:16
def __init__(self, tree)
Definition: doc_template.py:5
Definition: pytypes.h:1301
def get_free_docs_keys_list(self)
Definition: doc_template.py:65
def get_free_docs_values_list(self)
Definition: doc_template.py:71
def get_class_docs_keys_list(self)
Definition: doc_template.py:62
def get_class_docs_values_list(self)
Definition: doc_template.py:68
def get_class_docs(self, class_name)
Definition: doc_template.py:38
def get_tree(self)
Definition: doc_template.py:8


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:41:59