populse_mia.data_manager.project_properties

Mia Saved Projects Module

This module provides the SavedProjects class, which manages the persistence and retrieval of user-saved projects in the Mia software. It handles the following operations:

  • Loading saved projects from a YAML configuration file (saved_projects.yml).

  • Adding, removing, and updating project paths in the configuration.

  • Serializing and saving the project list back to the YAML file.

The module ensures compatibility with multiple YAML parser versions and gracefully handles missing or corrupted configuration files by creating a default structure.

Classes

SavedProjects()

Manage the list of saved project paths.

class populse_mia.data_manager.project_properties.SavedProjects[source]

Bases: object

Manage the list of saved project paths.

The saved paths are stored in saved_projects.yml and are used to keep track of recently accessed projects.

Contains:
Methods:
  • addSavedProject: Adds a new saved project.

  • loadSavedProjects: Loads saved projects from ‘saved_projects.yml’.

  • removeSavedProject: Removes a project from the config file.

  • saveSavedProjects: Saves projects to ‘saved_projects.yml’.

__init__()[source]

Initialize the saved project paths from saved_projects.yml.

If the file does not exist or contains invalid data, initialize an empty saved project list.

addSavedProject(newPath)[source]

Add a project path to the saved list.

If the path already exists, it is moved to the beginning of the list.

Parameters:

newPath (str) – Path of the project to save.

Returns:

Updated list of saved project paths.

Return type:

list[str]

loadSavedProjects()[source]

Load saved project paths from saved_projects.yml.

If the file does not exist, create a default empty configuration.

Returns:

Dictionary containing saved project paths.

Return type:

dict

removeSavedProject(path)[source]

Remove a project path from the saved list.

Parameters:

path (str) – Path of the project to remove.

saveSavedProjects()[source]

Serialize the current saved project paths and write them to saved_projects.yml.