MCPcopy Index your code
hub / github.com/google/python-fire / _get_directive

Function _get_directive

fire/docstrings.py:678–693  ·  view source on GitHub ↗

Gets a directive from the start of the line. If the line is ":param str foo: Description of foo", then _get_directive(line_info) returns "param str foo". Args: line_info: Information about the current line. Returns: The contents of a directive, or None if the line doesn't start wit

(line_info)

Source from the content-addressed store, hash-verified

676
677
678def _get_directive(line_info):
679 """Gets a directive from the start of the line.
680
681 If the line is ":param str foo: Description of foo", then
682 _get_directive(line_info) returns "param str foo".
683
684 Args:
685 line_info: Information about the current line.
686 Returns:
687 The contents of a directive, or None if the line doesn't start with a
688 directive.
689 """
690 if line_info.stripped.startswith(':'):
691 return line_info.stripped.split(':', 2)[1]
692 else:
693 return None
694
695
696def _get_after_directive(line_info):

Callers 2

_consume_lineFunction · 0.85
_rst_sectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected