From d69ba0479a4537bbc7a53f342661c1984382f939 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Sat, 8 Jan 2022 17:56:26 -0800 Subject: chore: add `pprint()` and `pformat()` methods to RESTObject This is useful in debugging and testing. As can easily print out the values from an instance in a more human-readable form. --- docs/api-usage.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs/api-usage.rst') diff --git a/docs/api-usage.rst b/docs/api-usage.rst index 66e5887..8befc56 100644 --- a/docs/api-usage.rst +++ b/docs/api-usage.rst @@ -179,6 +179,20 @@ resources. For example: project = gl.projects.get(1) project.star() +You can print a Gitlab Object. For example: + +.. code-block:: python + + project = gl.projects.get(1) + print(project) + + # Or in a prettier format. + project.pprint() + + # Or explicitly via `pformat()`. This is equivalent to the above. + print(project.pformat()) + + Base types ========== -- cgit v1.2.1