From 8b639b5026a2b7cd745de08cf764f7ddefcea9fa Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 20 Nov 2019 19:54:00 +0100 Subject: [PATCH] Remove only :return: --- scripts/rest_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/rest_client.py b/scripts/rest_client.py index 03e4fc76b..9e52de2bb 100755 --- a/scripts/rest_client.py +++ b/scripts/rest_client.py @@ -10,6 +10,7 @@ so it can be used as a standalone script. import argparse import inspect import json +import re import logging import sys from pathlib import Path @@ -238,7 +239,8 @@ def print_commands(): print("Possible commands:\n") for x, y in inspect.getmembers(client): if not x.startswith('_'): - print(f"{x}""\n "f"{getattr(client, x).__doc__.splitlines()[0]}""\n") + doc = re.sub(':return:.*', '', getattr(client, x).__doc__, flags=re.MULTILINE).rstrip() + print(f"{x}\n\t{doc}\n") def main(args):