naturtag.storage.settings module

Utilities for reading and writing settings from config files

class naturtag.storage.settings.Settings(dark_mode=False, log_level='INFO', log_level_external='INFO', show_logs=False, all_ranks=False, casual_observations=True, locale='en', preferred_place_id=1, search_locale=True, username='', common_names=True, hierarchical=True, sidecar=True, exif=True, iptc=True, xmp=True, path=None, default_image_dir=PosixPath('/home/docs'), use_last_dir=True, recent_image_dirs=NOTHING, favorite_image_dirs=NOTHING, debug=False, n_worker_threads=1)

Bases: object

add_favorite_dir(image_dir)
add_recent_dir(path)

Add a directory to the list of recent image directories

all_ranks: bool
casual_observations: bool
common_names: bool
dark_mode: bool
property data_dir: Path
property db_path: Path
debug: bool
default_image_dir: Path
exif: bool
favorite_image_dirs: list[Path]
hierarchical: bool
property image_cache_path: Path
iptc: bool
locale: str
log_level: str
log_level_external: str
property logfile: Path
n_worker_threads: int
path: Optional[Path]
preferred_place_id: int
classmethod read(path=PosixPath('/home/docs/.local/share/Naturtag/settings.yml'))

Read settings from config file

Return type:

Settings

recent_image_dirs: list[Path]
remove_favorite_dir(image_dir)
remove_recent_dir(image_dir)
reset_defaults()

Reset all settings to defaults

search_locale: bool
show_logs: bool
sidecar: bool
property start_image_dir: Path

Get the starting directory for image selection, depending on settings

use_last_dir: bool
username: str
write()

Write settings to config file

xmp: bool
naturtag.storage.settings.doc_field(doc='', **kwargs)

Create a field for an attrs class that is documented in the class docstring.

naturtag.storage.settings.make_converter()

Additional serialization steps not covered by cattrs yaml converter

Return type:

Converter