pic_scanner.gui.wrappers

Subpackages

Classes

GUIFileCollection

A class to manage a collection of files with a cursor to navigate through them.

Package Contents

class pic_scanner.gui.wrappers.GUIFileCollection(collection: pic_scanner.helpers.FileCollection)

Bases: inspy_logger.Loggable

A class to manage a collection of files with a cursor to navigate through them.

Properties:
collection (FileCollection):

The collection of files.

files (list[Path]):

List of file paths from the collection.

cursor (int):

Current position of the cursor in the collection.

Parameters:

collection (pic_scanner.helpers.FileCollection)

cursor
property collection: pic_scanner.helpers.FileCollection

Returns the collection of files.

Returns:

The collection of files.

Return type:

FileCollection

property files: list

Returns the list of file paths from the collection.

Returns:

The list of file paths.

Return type:

list

property needs_reprocessing: bool

Returns whether the collection needs reprocessing.

Returns:

True if the collection needs reprocessing, False otherwise.

Return type:

bool

next() str

Moves the cursor to the next file in the collection and returns it.

Returns:

The path of the next file.

Return type:

str

prev() str

Moves the cursor to the previous file in the collection and returns it.

Returns:

The path of the previous file.

Return type:

str

current() str

Returns the file at the current cursor position.

Returns:

The path of the current file.

Return type:

str

remove_current()

Removes the file at the current cursor position.

set_cursor(index: int)

Sets the cursor to the specified index, adjusting if out of bounds.

Parameters:

index (int) – The position to set the cursor to.

Raises:

IndexError – If the index is out of the valid range.

add_cursor_callback(callback, *args, **kwargs)

Adds a callback to be invoked when the cursor changes.

Parameters:
  • callback (callable) – The callback function.

  • *args – Additional positional arguments to pass to the callback.

  • **kwargs – Additional keyword arguments to pass to the callback.