RecentsManager module

RecentsManager._dump_pkl(stack)[source]

Helper method to save any changes made to the stack to the pkl file. Only the 4 most recent pkl files (the last 4 elements in the stack) are retained.

RecentsManager.add(path)[source]

Method to add elements to the recents stack. If the passed path to a pkl file isn’t already in recents, then it’s appended to the stack. If the path is already in the stack, it’s removed and reappended to move it to the top of the stack.

Parameters:

path (pathlib.Path) – the path to the pkl project file to add to recents.

RecentsManager.get()[source]

Method that gets the recents stack out of the pkl and returns it. Used by add and remove to get the current value of the stack.

Called in AppWindow.py to initialize the menu.

Returns:

the stack saved to the pkl file.

Return type:

stack

RecentsManager.init_pkl()[source]

Method to initialize the recents pkl file if it doesn’t already exist in the user’s AppData. Called in _load_pkl to make sure the pkl file exists before use.

RecentsManager.remove(path)[source]

Method to remove elements from the recents stack. The passed path gets removed from the recent stack, assuming it was in the stack originally.

Parameters:

path (pathlib.Path) – the path to the pkl project file to remove from recents.