Changeset - e79877ee6a3f
[Not reviewed]
0 3 0
Brett Smith - 4 years ago 2020-04-28 14:48:10
brettcsmith@brettcsmith.org
data: Add rt-id to LINK_METADATA.

This gets closer to our real intentions: anything that checks link
metadata should check rt-id. MetaRepoLinks is the exception, not
the rule, in ignoring rt-id.
3 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/data.py
Show inline comments
...
 
@@ -57,4 +57,5 @@ LINK_METADATA = frozenset([
 
    'purchase-order',
 
    'receipt',
 
    'rt-id',
 
    'statement',
 
])
conservancy_beancount/plugin/meta_repo_links.py
Show inline comments
...
 
@@ -35,4 +35,5 @@ from typing import (
 
class MetaRepoLinks(core.TransactionHook):
 
    HOOK_GROUPS = frozenset(['linkcheck'])
 
    LINK_METADATA = data.LINK_METADATA.difference('rt-id')
 
    PATH_PUNCT_RE = re.compile(r'[:/]')
 

	
...
 
@@ -49,5 +50,5 @@ class MetaRepoLinks(core.TransactionHook):
 
    ) -> errormod.Iter:
 
        metadata = data.Metadata(meta)
 
        for key in data.LINK_METADATA:
 
        for key in self.LINK_METADATA:
 
            try:
 
                links = metadata.get_links(key)
conservancy_beancount/plugin/meta_rt_links.py
Show inline comments
...
 
@@ -33,5 +33,4 @@ from typing import (
 
class MetaRTLinks(core.TransactionHook):
 
    HOOK_GROUPS = frozenset(['linkcheck', 'network', 'rt'])
 
    LINK_METADATA = data.LINK_METADATA.union(['rt-id'])
 

	
 
    def __init__(self, config: configmod.Config) -> None:
...
 
@@ -47,5 +46,5 @@ class MetaRTLinks(core.TransactionHook):
 
    ) -> errormod.Iter:
 
        metadata = data.Metadata(meta)
 
        for key in self.LINK_METADATA:
 
        for key in data.LINK_METADATA:
 
            try:
 
                links = metadata.get_links(key)
0 comments (0 inline, 0 general)