MCPcopy Index your code
hub / github.com/aws/aws-cli / PosixHelpRenderer

Class PosixHelpRenderer

awscli/help.py:235–258  ·  view source on GitHub ↗

Render help content on a Posix-like system. This includes Linux and MacOS X.

Source from the content-addressed store, hash-verified

233
234
235class PosixHelpRenderer(PosixPagingHelpRenderer):
236 """
237 Render help content on a Posix-like system. This includes
238 Linux and MacOS X.
239 """
240
241 def _convert_doc_content(self, contents):
242 settings_overrides = self._DEFAULT_DOCUTILS_SETTINGS_OVERRIDES.copy()
243 settings_overrides["report_level"] = 3
244 man_contents = publish_string(
245 contents,
246 writer=manpage.Writer(),
247 settings_overrides=self._DEFAULT_DOCUTILS_SETTINGS_OVERRIDES,
248 )
249 if self._exists_on_path('groff'):
250 cmdline = ['groff', '-m', 'man', '-T', 'ascii']
251 elif self._exists_on_path('mandoc'):
252 cmdline = ['mandoc', '-T', 'ascii']
253 else:
254 raise ExecutableNotFoundError('groff or mandoc')
255 LOG.debug("Running command: %s", cmdline)
256 p3 = self._popen(cmdline, stdin=PIPE, stdout=PIPE, stderr=PIPE)
257 output = p3.communicate(input=man_contents)[0]
258 return output
259
260
261class PosixBrowserHelpRenderer(BrowserHelpRenderer):

Callers 2

setUpMethod · 0.90
get_rendererFunction · 0.85

Calls

no outgoing calls

Tested by 1

setUpMethod · 0.72