From 5237c8113c7b0283c2f8dc3a2096b0655c3db0a7 Mon Sep 17 00:00:00 2001 From: Aparna Valsala Date: Thu, 9 Mar 2023 17:33:55 +0000 Subject: [PATCH] minor changes to format docstring --- examples/example.py | 6 +++++- src/autometrics/autometrics.py | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/example.py b/examples/example.py index 3a3efd6..c5c0eca 100644 --- a/examples/example.py +++ b/examples/example.py @@ -32,6 +32,10 @@ def text_print(): return "hello" ops = Operations() + +print(ops.add.__doc__) +print(div_unhandled.__doc__) + start_http_server(8080) while True: ops.div_handled(2, 0) @@ -42,4 +46,4 @@ def text_print(): ops.add(1, 2) time.sleep(2) div_unhandled(2, 0) - print("server can still run") + diff --git a/src/autometrics/autometrics.py b/src/autometrics/autometrics.py index 4a23d35..9e88250 100644 --- a/src/autometrics/autometrics.py +++ b/src/autometrics/autometrics.py @@ -44,7 +44,8 @@ def get_filename_as_module(func): def write_docs(func_name, module_name): g = Generator(func_name, module_name) urls = g.createURLs() - docs = f"Prometheus Query URLs : \n" + docs = f"Prometheus Query URLs for Function - {func_name} and Module - {module_name}: \n\n" for key, value in urls.items(): docs = f"{docs}{key} : {value} \n\n" + docs = f"{docs}-------------------------------------------\n" return docs \ No newline at end of file