From 965771fb0d85ddb27dc6c5dd7df822d1fb318286 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Sat, 15 Mar 2025 16:35:39 +0800 Subject: refactor: clean up code formatting and add new PluginManager class --- src/conventionalrp/extractors/__init__.py | 2 +- src/conventionalrp/extractors/base.py | 2 +- src/conventionalrp/extractors/rule_extractor.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/conventionalrp/extractors') diff --git a/src/conventionalrp/extractors/__init__.py b/src/conventionalrp/extractors/__init__.py index c076f07..8606862 100644 --- a/src/conventionalrp/extractors/__init__.py +++ b/src/conventionalrp/extractors/__init__.py @@ -1,4 +1,4 @@ # FILE: /trpg-log-processor/trpg-log-processor/src/conventionalrp/extractors/__init__.py """ This file initializes the extractors module. -""" \ No newline at end of file +""" diff --git a/src/conventionalrp/extractors/base.py b/src/conventionalrp/extractors/base.py index fc42f29..bc3c41f 100644 --- a/src/conventionalrp/extractors/base.py +++ b/src/conventionalrp/extractors/base.py @@ -6,4 +6,4 @@ class BaseExtractor: raise NotImplementedError("Subclasses should implement this method.") def load_rules(self, rules_source): - raise NotImplementedError("Subclasses should implement this method.") \ No newline at end of file + raise NotImplementedError("Subclasses should implement this method.") diff --git a/src/conventionalrp/extractors/rule_extractor.py b/src/conventionalrp/extractors/rule_extractor.py index 78e8505..b0d03d5 100644 --- a/src/conventionalrp/extractors/rule_extractor.py +++ b/src/conventionalrp/extractors/rule_extractor.py @@ -13,7 +13,8 @@ class RuleExtractor(BaseExtractor): def load_rules_from_file(self): import json - with open(self.config_file, 'r') as file: + + with open(self.config_file, "r") as file: return json.load(file) def extract(self): @@ -21,4 +22,4 @@ class RuleExtractor(BaseExtractor): extracted_rules = [] for rule in self.rules: extracted_rules.append(rule) # Placeholder for actual extraction logic - return extracted_rules \ No newline at end of file + return extracted_rules -- cgit v1.2.3-70-g09d2