MCPcopy Index your code
hub / github.com/saltstack/salt / get_docs

Method get_docs

salt/client/mixins.py:449–476  ·  view source on GitHub ↗

Return a dictionary of functions and the inline documentation for each

(self, arg=None)

Source from the content-addressed store, hash-verified

447 return data if full_return else data["return"]
448
449 def get_docs(self, arg=None):
450 """
451 Return a dictionary of functions and the inline documentation for each
452 """
453 if arg:
454 if "*" in arg:
455 target_mod = arg
456 _use_fnmatch = True
457 else:
458 target_mod = arg + "." if not arg.endswith(".") else arg
459 _use_fnmatch = False
460 if _use_fnmatch:
461 docs = [
462 (fun, self.functions[fun].__doc__)
463 for fun in fnmatch.filter(self.functions, target_mod)
464 ]
465 else:
466 docs = [
467 (fun, self.functions[fun].__doc__)
468 for fun in sorted(self.functions)
469 if fun == arg or fun.startswith(target_mod)
470 ]
471 else:
472 docs = [
473 (fun, self.functions[fun].__doc__) for fun in sorted(self.functions)
474 ]
475 docs = dict(docs)
476 return salt.utils.doc.strip_rst(docs)
477
478
479class AsyncClientMixin(ClientStateMixin):

Callers 5

print_docsMethod · 0.80
runMethod · 0.80
runnerFunction · 0.80
wheelFunction · 0.80
test_get_docsFunction · 0.80

Calls 1

filterMethod · 0.80

Tested by 1

test_get_docsFunction · 0.64