Changeset - a61b74308faf
[Not reviewed]
0 1 0
Brett Smith - 4 years ago 2020-03-25 04:13:18
brettcsmith@brettcsmith.org
rtutil: Make RT.parse a classmethod.

Because it works, and I can imagine it being useful to have this
method more handy to other code.
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/rtutil.py
Show inline comments
...
 
@@ -100,8 +100,9 @@ class RT:
 
    def exists(self, ticket_id: RTId, attachment_id: Optional[RTId]=None) -> bool:
 
        return self.url(ticket_id, attachment_id) is not None
 

	
 
    def parse(self, s: str) -> Optional[Tuple[str, Optional[str]]]:
 
        for regexp in self.PARSE_REGEXPS:
 
    @classmethod
 
    def parse(cls, s: str) -> Optional[Tuple[str, Optional[str]]]:
 
        for regexp in cls.PARSE_REGEXPS:
 
            match = regexp.match(s)
 
            if match is not None:
 
                ticket_id, attachment_id = match.groups()
0 comments (0 inline, 0 general)