core.fs

exception core.fs.FSError(fsobject, parent=None)
exception core.fs.AlreadyExistsError(fsobject, parent=None)

The directory or file name we’re trying to add already exists

exception core.fs.InvalidPath(fsobject, parent=None)

The path of self is invalid, and cannot be worked with.

exception core.fs.InvalidDestinationError(fsobject, parent=None)

A copy/move operation has been called, but the destination is invalid.

exception core.fs.OperationError(fsobject, parent=None)

A copy/move/delete operation has been called, but the checkup after the operation shows that it didn’t work.

class core.fs.File(path)

Represents a file and holds metadata to be used for scanning.

classmethod can_handle(path)

Returns whether this file wrapper class can handle path.

get_display_info(group, delta)

Returns a display-ready dict of dupe’s data.

class core.fs.Folder(path)

A wrapper around a folder path.

It has the size/md5 info of a File, but it’s value are the sum of its subitems.

classmethod can_handle(path)

Returns whether this file wrapper class can handle path.

core.fs.get_file(path, fileclasses=[<class 'core.fs.File'>])

Wraps path around its appropriate File class.

Whether a class is “appropriate” is decided by File.can_handle()

Parameters:
  • path (Path) – path to wrap
  • fileclasses – List of candidate File classes
core.fs.get_files(path, fileclasses=[<class 'core.fs.File'>])

Returns a list of File for each file contained in path.

Parameters:
  • path (Path) – path to scan
  • fileclasses – List of candidate File classes