rtutil: Add docstring with basic rationale.

This commit is contained in:
Brett Smith 2020-03-25 10:18:01 -04:00
parent 2fb7826ab4
commit a3630ab04e

View file

@ -30,6 +30,17 @@ from typing import (
RTId = Union[int, str] RTId = Union[int, str]
class RT: 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 = [ PARSE_REGEXPS = [
re.compile(r'^rt:([0-9]+)(?:/([0-9]+))?/?$'), re.compile(r'^rt:([0-9]+)(?:/([0-9]+))?/?$'),
re.compile(r'^rt://ticket/([0-9]+)(?:/attachments?/([0-9]+))?/?$'), re.compile(r'^rt://ticket/([0-9]+)(?:/attachments?/([0-9]+))?/?$'),