MCPcopy Create free account
hub / github.com/NyarchLinux/DesktopPuppet / get_available_models

Method get_available_models

src/gui_controller.py:125–137  ·  view source on GitHub ↗

Get list of available models from the models directory.

(self)

Source from the content-addressed store, hash-verified

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

Callers 1

_load_modelsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected