Return a dictionary of functions and the inline documentation for each
(self, arg=None)
| 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 | |
| 479 | class AsyncClientMixin(ClientStateMixin): |