From 4959f62cf58f449600c0bd185ccc12c8490f5c0d Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Tue, 20 Jul 2021 11:28:18 -0700 Subject: [PATCH] rendercomment: move Repository init to __init__ This makes rendercomment a slight bit more lazy. Now, it will only actually initialize a pygit2.Repository when it needs to produce a Git commit inline. Signed-off-by: Kevin Morris --- aurweb/scripts/rendercomment.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aurweb/scripts/rendercomment.py b/aurweb/scripts/rendercomment.py index 422dd33b..f6dfd058 100755 --- a/aurweb/scripts/rendercomment.py +++ b/aurweb/scripts/rendercomment.py @@ -60,9 +60,8 @@ class GitCommitsInlineProcessor(markdown.inlinepatterns.InlineProcessor): considered. """ - _repo = pygit2.Repository(repo_path) - def __init__(self, md, head): + self._repo = pygit2.Repository(repo_path) self._head = head super().__init__(r'\b([0-9a-f]{7,40})\b', md)