Get list of available models from the models directory.
(self)
| 123 | self.lockfile = os.path.join(project_root, "src", "nyarchlinux-desktop-puppet.lock") |
| 124 | |
| 125 | def get_available_models(self): |
| 126 | """Get list of available models from the models directory.""" |
| 127 | models = [] |
| 128 | if not os.path.isdir(self.models_dir): |
| 129 | return models |
| 130 | |
| 131 | for root, _, files in os.walk(self.models_dir): |
| 132 | for file in files: |
| 133 | if file.endswith('.model3.json') or file.endswith('.model.json'): |
| 134 | file_name = file.rstrip('.model3.json').rstrip('.model.json') |
| 135 | relative_path = os.path.relpath(os.path.join(root, file), self.models_dir) |
| 136 | models.append((file_name, relative_path)) |
| 137 | return models |
| 138 | |
| 139 | def ensure_viewer_installed(self): |
| 140 | """Ensure the Live2D viewer is installed.""" |