File: tagpix/user_configs.py

"""
==========================================================================
user_configs.py - user-option settings for the tagpix photo organizer.
Change the Python-coded assignments below to tailor tagpix runs [2.1].
==========================================================================
"""


#-------------------------------------------------------------------------
# Name patterns of folders to skip in the source tree.
#
# The following "re" module regular expression is matched against every
# subfolder in the source tree.  Those matching the pattern are skipped:
# their content will never be added to the destination/merged result.
# This is used to eliminate irrelevant folders (e.g., thumbnail images).
#
# The preset matches ".<any>", "thumbs", or "_thumbspage".  Extend the 
# pattern string with "|xxx" options for any other irrelevant-image 
# folders to be skipped in your source trees, or name such folders with
# a leading "." (a preset skip, though this may impact other tools). 
#
# In the pattern: matching is case-sensitive by default; ^ and $ match 
# the string's start and end; ^ is optional for Python's re.match(); 
# | has the lowest precedence; and the leftmost alternative does not 
# require a trailing '.*' (an initial '.' suffices for hidden folders).
# See Python "re" module documentation for more on pattern syntax.
#
# See examples/2.1-subfolder-skipping.txt for a demo, and version 2.1
# release notes in UserGuide.html for more background.  Note that 
# filenames starting with a "." are also always skipped by tagpix.
#-------------------------------------------------------------------------

IgnoreFoldersPattern = '^[.]|^thumbs$|^_thumbspage$'    # skip these folders


#-------------------------------------------------------------------------
# File source=>destination transfer modes.
#
# tagpix's original and default transfer mode is to _move_ files from the
# source to destination trees (now called FILE-MOVE mode).  This is quick,
# and generally recommended, because it encourages users to copy files to 
# a temporary source folder, leaving the original as a backup copy.  
# 
# For more custom roles, two alternative modes _copy_ files instead:
#
# 1) COPY-ONLY mode copies files to the destination but does not
# remove them from the source tree (useful to extract files from 
# a tree without changing it in any way).  To use this mode
# set the first variable below to True and leave the second False.
#
# 2) COPY-AND-DELETE mode copies files to the destination and then
# removes them from the source tree (useful to merge trees located 
# on different drives or devices).  To use this mode set both the 
# first and second variable below to True.
#
# The default FILE-MOVE mode is used if both variables below are False. 
# It always removes files from the source tree by definition, regardless
# of DeleteAfterCopy (which applies only if CopyInsteadOfMove is True).
# COPY-ONLY and COPY-AND-DELETE are slower, but work across devices.
#-------------------------------------------------------------------------

CopyInsteadOfMove = False     # True = copy, instead of move, files from source tree
DeleteAfterCopy   = False     # True = delete files after copied (ignored by moves)


#-------------------------------------------------------------------------
# Handle dates added to photo filenames by Android cameras [2.2]
#
# Android (and perhaps other) cameras add an origin date in photo 
# filenames which is redundant with that added by tagpix's own renaming
# step, but useful when Exif date tags are absent (e.g., in some Samsung 
# front-camera photos, and Android photos edited with tools that discard 
# tags).  When initially expanded by tagpix, such photo filenames look 
# like this, with Android date second: '2018-02-05__20180205_154910.jpg'.  
#
# tagpix 2.2 by default both utilizes and discards Android filename dates 
# automatically, and provides three switches that allow you to customize 
# this processing for rare special cases:
#
# If UseAndroidFilenameDates:
#     tagpix uses Android filename dates for its own date-of-origin
#     prefixes, for Android photos that have no Exif date-taken tag.
# 
# If DropAndroidFilenameDates:
#     tagpix automatically renames merged photo files to discard any
#     extra Android dates and shorten such filenames.  For example:
#     '2018-02-05__20180205_154910.jpg' => '2018-02-05__154910.jpg'.
#
# If KeepDifferingAndroidFilenameDates:
#     tagpix does not discard Android filename dates that differ from
#     the date of origin selected by tagpix.  Due to tagpix's selection 
#     algorithm, this case can occur only if a photo's Exif tag or 
#     filename was changed manually and inconsistently.
#     
# The preset True values of all three switches handle the usual case, 
# and should suffice unchanged for most (or all) tagpix users.
#
# You can set the first two switches to False to accommodate manually
# changed filenames that should not be utilized and/or discarded by 
# tagpix.  The third switch customizes the effect of the second:
# if False, all Android dates are discarded; if True, Android dates
# that differ are retained--a rare case that may arise if Exif tags
# or filenames have been changed in conflicting but important ways.
# 
# For more background details on the handling of Android filename 
# dates, see the version 2.2 release notes in UserGuide.html.
# 
# For a related tool, see the _drop-redundant-dates.py utility script,
# which can be run on-demand to remove Android filename dates in photos
# already processed by prior versions of tagpix.
#-------------------------------------------------------------------------

UseAndroidFilenameDates  = True            # use Android filename date if no Exif tag?
DropAndroidFilenameDates = True            # drop dates redundant with tagpix-added date? 
KeepDifferingAndroidFilenameDates = True   # drop only if tagpix/Android dates same


#[end]



[Home page] Books Code Blog Python Author Train Find ©M.Lutz