Merge branch 'master' of github.com:gullevek/reverse_geolocate

This commit is contained in:
2022-11-11 22:36:30 +09:00

View File

@@ -644,7 +644,9 @@ parser = argparse.ArgumentParser(
# xmp folder (or folders), or file (or files)
# note that the target directory or file needs to be writeable
parser.add_argument('-i', '--include-source',
parser.add_argument(
'-i',
'--include-source',
required=True,
nargs='*',
action=writable_dir_folder,
@@ -653,7 +655,9 @@ parser.add_argument('-i', '--include-source',
help='The source folder or folders with the XMP files that need reverse geo encoding to be set. Single XMP files can be given here'
)
# exclude folders
parser.add_argument('-x', '--exclude-source',
parser.add_argument(
'-x',
'--exclude-source',
nargs='*',
action=writable_dir_folder,
dest='exclude_sources',
@@ -663,7 +667,9 @@ parser.add_argument('-x', '--exclude-source',
# LR database (base folder)
# get .lrcat file in this folder
parser.add_argument('-l', '--lightroom',
parser.add_argument(
'-l',
'--lightroom',
# required=True,
action=readable_dir,
dest='lightroom_folder',
@@ -672,7 +678,9 @@ parser.add_argument('-l', '--lightroom',
)
# strict LR check with base path next to the file base name
parser.add_argument('-s', '--strict',
parser.add_argument(
'-s',
'--strict',
dest='lightroom_strict',
action='store_true',
help='Do strict check for Lightroom files including Path in query'
@@ -682,7 +690,9 @@ parser.add_argument('-s', '--strict',
# FLAG: default: only set not filled
# other: overwrite all or overwrite if one is missing, overwrite specifc field (as defined below)
# fields: Location, City, State, Country, CountryCode
parser.add_argument('-f', '--field',
parser.add_argument(
'-f',
'--field',
action='append',
type=str.lower, # make it lowercase for check
choices=['overwrite', 'location', 'city', 'state', 'country', 'countrycode'],
@@ -694,7 +704,9 @@ parser.add_argument('-f', '--field',
'If with overwrite the field will be overwritten if already set, else it will be always skipped.'
)
parser.add_argument('-d', '--fuzzy-cache',
parser.add_argument(
'-d',
'--fuzzy-cache',
type=str.lower,
action=distance_values,
nargs='?',
@@ -707,77 +719,99 @@ parser.add_argument('-d', '--fuzzy-cache',
)
# Google Maps API key to overcome restrictions
parser.add_argument('-g', '--google',
parser.add_argument(
'-g',
'--google',
dest='google_api_key',
metavar='GOOGLE API KEY',
help='Set a Google API Maps key to overcome the default lookup limitations'
)
# use open street maps
parser.add_argument('-o', '--openstreetmap',
parser.add_argument(
'-o',
'--openstreetmap',
dest='use_openstreetmap',
action='store_true',
help='Use openstreetmap instead of Google'
)
# email of open street maps requests
parser.add_argument('-e', '--email',
parser.add_argument(
'-e',
'--email',
dest='email',
metavar='EMIL ADDRESS',
help='An email address for OpenStreetMap'
)
# write api/email settings to config file
parser.add_argument('-w', '--write-settings',
parser.add_argument(
'-w',
'--write-settings',
dest='config_write',
action='store_true',
help='Write Google API or OpenStreetMap email to config file'
)
# only read data and print on screen, do not write anything
parser.add_argument('-r', '--read-only',
parser.add_argument(
'-r',
'--read-only',
dest='read_only',
action='store_true',
help='Read current values from the XMP file only, do not read from LR or lookup any data and write back'
)
# only list unset ones
parser.add_argument('-u', '--unset-only',
parser.add_argument(
'-u',
'--unset-only',
dest='unset_only',
action='store_true',
help='Only list unset XMP files'
)
# only list unset GPS codes
parser.add_argument('-p', '--unset-gps-only',
parser.add_argument(
'-p',
'--unset-gps-only',
dest='unset_gps_only',
action='store_true',
help='Only list unset XMP files for GPS fields'
)
# don't try to do auto adjust in list view
parser.add_argument('-a', '--no-autoadjust',
parser.add_argument(
'-a',
'--no-autoadjust',
dest='no_autoadjust',
action='store_true',
help='Don\'t try to auto adjust columns'
)
# compact view, compresses columns down to a minimum
parser.add_argument('-c', '--compact',
parser.add_argument(
'-c',
'--compact',
dest='compact_view',
action='store_true',
help='Very compact list view'
)
# Do not create backup files
parser.add_argument('-n', '--nobackup',
parser.add_argument(
'-n',
'--nobackup',
dest='no_xmp_backup',
action='store_true',
help='Do not create a backup from the XMP file'
)
# verbose args for more detailed output
parser.add_argument('-v', '--verbose',
parser.add_argument(
'-v',
'--verbose',
action='count',
dest='verbose',
help='Set verbose output level'