Sisyphe.core.sisypheRecent

External packages/modules

class Sisyphe.core.sisypheRecent.SisypheRecent(n: int = 10)

SisypheRecent class

Description

Manage a persistent list of recently opened files. It includes methods for adding, removing, and retrieving files from the list, as well as saving and loading the list to/from an XML file.

Inheritance

object -> SisypheRecent

Creation: 27/10/2022 Last revision: 14/12/2023

append(filename: str) None

Add a file name in the recent list of the current SisypheRecent instance.

Parameters

filenamestr

file name

clear() None

Clear the recent list of the current SisypheRecent instance.

getFileCount() int

Get the number of files in the recent list of the current SisypheRecent instance.

Returns

int

number of files in the recent list

getFileList() list[str]

Get the list of files in the recent list of the current SisypheRecent instance.

Returns

list[str]

list of recent files

getMaximumCount() int

Get the maximum number of files in the recent list of the current SisypheRecent instance.

Returns

int

maximum number of files in the recent list

classmethod getUserDirectory() str

Get user directory (~/.PySisyphe)

Returns

str

‘~/.PySisyphe’

load() None

Load the recent list of the current SisypheRecent instance from the recent.xml file in the user directory (~/.PySisyphe).

save() None

Save the recent list of the current SisypheRecent instance in the recent.xml file in the user directory (~/.PySisyphe).

setMaximumCount(n: int) None

Set the maximum number of files in the recent list of the current SisypheRecent instance.

Parameters

nint

maximum number of files in the recent list

updateQMenu(menu: QMenu) None

Update QMenu parameter items with files from the recent list of the current SisypheRecent instance.

Parameters

menuPyQt5.QtWidgets.QMenu

menu to update with the recent list elements