From b593c185115ac7084140307f7ff4df9a567a63f7 Mon Sep 17 00:00:00 2001 From: randogoth Date: Fri, 9 Jun 2023 01:42:05 +0300 Subject: [PATCH] disable plugins from context files --- .context.yaml | 2 ++ TODO.md | 3 ++- orvani/plugins/frontmatter.py | 3 +++ orvani/plugins/hashdoubleslash.py | 3 +++ orvani/plugins/id3.py | 3 +++ orvani/plugins/office.py | 3 +++ 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.context.yaml b/.context.yaml index 29eb603..343c7e0 100644 --- a/.context.yaml +++ b/.context.yaml @@ -1,4 +1,6 @@ config: + plugins: + - id3 id3: types: - .wav diff --git a/TODO.md b/TODO.md index 73b98d3..72a3391 100644 --- a/TODO.md +++ b/TODO.md @@ -2,4 +2,5 @@ tags: - frrr --- -+ plugin for xattr \ No newline at end of file ++ plugin for xattr ++ plugin for pdf \ No newline at end of file diff --git a/orvani/plugins/frontmatter.py b/orvani/plugins/frontmatter.py index ab72fbb..41ad080 100644 --- a/orvani/plugins/frontmatter.py +++ b/orvani/plugins/frontmatter.py @@ -5,6 +5,9 @@ NAME = 'frontmatter' TYPES = ['.md', '.txt', '.markdown', '.rst'] def reader(o): + if 'plugins' in o.config: + if NAME not in o.config['plugins']: + return file = Path(o.path) suffixes = TYPES if NAME in o.config: diff --git a/orvani/plugins/hashdoubleslash.py b/orvani/plugins/hashdoubleslash.py index c05ab1d..85c4164 100644 --- a/orvani/plugins/hashdoubleslash.py +++ b/orvani/plugins/hashdoubleslash.py @@ -9,6 +9,9 @@ TYPES = ['.md', '.txt', '.py'] REGEX = r'\s*([@+]\w+|#\w+(?