From a3630ab04e58182a3a639921b8eb9a6ddfc8bc70 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Wed, 25 Mar 2020 10:18:01 -0400 Subject: [PATCH] rtutil: Add docstring with basic rationale. --- conservancy_beancount/rtutil.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/conservancy_beancount/rtutil.py b/conservancy_beancount/rtutil.py index bc876af..081d7f1 100644 --- a/conservancy_beancount/rtutil.py +++ b/conservancy_beancount/rtutil.py @@ -30,6 +30,17 @@ from typing import ( RTId = Union[int, str] class RT: + """RT utility wrapper class + + Given an RT client object, this class provides common functionality for + working with RT links in Beancount metadata: + + * Parse links + * Verify that they refer to extant objects in RT + * Convert metadata links to RT web links + * Cache results, to reduce network requests + """ + PARSE_REGEXPS = [ re.compile(r'^rt:([0-9]+)(?:/([0-9]+))?/?$'), re.compile(r'^rt://ticket/([0-9]+)(?:/attachments?/([0-9]+))?/?$'),