Load configuration file
(self)
| 16 | self.config_file = os.path.join(config_dir, config_file) |
| 17 | |
| 18 | def load(self): |
| 19 | """Load configuration file""" |
| 20 | try: |
| 21 | if os.path.exists(self.config_file): |
| 22 | with open(self.config_file, 'r', encoding='utf-8') as f: |
| 23 | return json.load(f) |
| 24 | except json.JSONDecodeError as e: |
| 25 | raise ValueError(f"配置文件格式错误: {e}") |
| 26 | return {} |
| 27 | |
| 28 | def save(self, config): |
| 29 | """Save configuration file""" |
no outgoing calls
no test coverage detected