Ensure config directory exists
(self)
| 37 | self._load_settings() |
| 38 | |
| 39 | def _ensure_config_dir(self): |
| 40 | """Ensure config directory exists""" |
| 41 | try: |
| 42 | self.config_dir.mkdir(exist_ok=True, parents=True) |
| 43 | # 在macOS上确保目录权限正确 |
| 44 | if os.name == 'posix': |
| 45 | os.chmod(self.config_dir, 0o755) |
| 46 | except Exception as e: |
| 47 | print(f"Error creating config directory: {e}") |
| 48 | print(f"Config directory path: {self.config_dir}") |
| 49 | |
| 50 | def _load_settings(self): |
| 51 | """Load settings from file""" |