doFolder.enums module

Enumeration definitions for doFolder file system operations and configurations.

This module defines comprehensive enums that control behavior across the doFolder library, including error handling modes, file system item types, comparison strategies, and hash recalculation policies.

class doFolder.enums.CompareMode(*values)

Bases: Enum

Predefined comparison strategies for file and directory comparison operations. Combines individual comparison flags to provide commonly used comparison modes with optimized performance.

CONTENT = <CompareModeFlag.CONTENT: 2>
IGNORE = <CompareModeFlag: 0>
SIZE = <CompareModeFlag.SIZE: 4>
TIMETAG = <CompareModeFlag.TIMETAG: 1>
TIMETAG_AND_SIZE = <CompareModeFlag.TIMETAG|SIZE: 5>
class doFolder.enums.CompareModeFlag(*values)

Bases: Flag

Individual comparison criteria flags that can be combined using bitwise operations. These flags form the building blocks for comprehensive file and directory comparison strategies.

CONTENT = 2
SIZE = 4
TIMETAG = 1
class doFolder.enums.DifferenceType(*values)

Bases: Enum

Categorizes the types of differences detected during file system item comparisons. Used by comparison operations to classify and report specific types of discrepancies between items.

DIRECTORY_DIFFERENCE = 'directory_difference'
FILE_DIFFERENCE = 'file_difference'
ITEM_TYPE_DIFFERENCE = 'item_type_difference'
NOT_EXISTS = 'not_exists'
class doFolder.enums.ErrorMode(*values)

Bases: Enum

Defines how the library handles error conditions during file system operations. Controls whether operations should raise exceptions, emit warnings, or silently ignore issues.

ERROR = 'error'
IGNORE = 'ignore'
WARN = 'warn'
class doFolder.enums.ItemType(*values)

Bases: Enum

Distinguishes between file system item types for creation and type checking operations. Used throughout the library to specify whether operations target files or directories.

DIR = 'dir'
FILE = 'file'
class doFolder.enums.ReCalcHashMode(*values)

Bases: Enum

Controls when file hash values should be recalculated during hash-based operations. Optimizes performance by determining hash computation frequency based on file modification timestamps.

ALWAYS = 'ALWAYS'
NEVER = 'NEVER'
TIMETAG = 'TIME_TAG'
class doFolder.enums.UnExistsMode(*values)

Bases: Enum

Specifies behavior when attempting to operate on non-existent file system paths. Determines whether to create missing paths, raise errors, emit warnings, or ignore the condition.

CREATE = 'create'
ERROR = 'error'
IGNORE = 'ignore'
WARN = 'warn'