MCPcopy Create free account
hub / github.com/aws/aws-cli / flush_structure

Method flush_structure

awscli/botocore/docs/bcdoc/restdoc.py:197–213  ·  view source on GitHub ↗

Flushes a doc structure to a ReSTructed string The document is flushed out in a DFS style where sections and their subsections' values are added to the string as they are visited.

(self)

Source from the content-addressed store, hash-verified

195 del self._structure[name]
196
197 def flush_structure(self):
198 """Flushes a doc structure to a ReSTructed string
199
200 The document is flushed out in a DFS style where sections and their
201 subsections' values are added to the string as they are visited.
202 """
203 # We are at the root flush the links at the beginning of the
204 # document
205 if len(self.path) == 1:
206 if self.hrefs:
207 self.style.new_paragraph()
208 for refname, link in self.hrefs.items():
209 self.style.link_target_definition(refname, link)
210 value = self.getvalue()
211 for name, section in self._structure.items():
212 value += section.flush_structure()
213 return value
214
215 def getvalue(self):
216 return ''.join(self._writes).encode('utf-8')

Callers 3

_create_docstringMethod · 0.95
document_serviceMethod · 0.95
write_to_fileMethod · 0.95

Calls 3

getvalueMethod · 0.95
new_paragraphMethod · 0.45

Tested by

no test coverage detected