Port to non-MacOS platforms (#1026)

* Port to non-MacOS platforms

* Keep NFD normalization on macOS

* Update locale_util.py

Fix lint error from ruff (runs in CI)

* Update query.py

click.Option first arg needs to be a list (different than click.option)

* Dynamically normalize Unicode paths in test

* Fix missing import

---------

Co-authored-by: Rhet Turnbull <rturnbull@gmail.com>
This commit is contained in:
dvdkon
2023-05-07 15:55:56 +02:00
committed by GitHub
parent 0c85298c03
commit ca3da647f2
51 changed files with 726 additions and 360 deletions

View File

@@ -5,6 +5,8 @@ import pytest
import osxphotos
from osxphotos.phototemplate import RenderOptions
from .locale_util import setlocale
PHOTOS_DB_PLACES = (
"./tests/Test-Places-Catalina-10_15_1.photoslibrary/database/photos.db"
)
@@ -48,7 +50,7 @@ def test_subst_today(photosdb):
"""Test that substitutions are correct for {today.x}"""
import locale
locale.setlocale(locale.LC_ALL, "en_US")
setlocale(locale.LC_ALL, "en_US")
photo = photosdb.photos(uuid=[UUID_DICT["place_dc"]])[0]
photo_template = osxphotos.PhotoTemplate(photo)
@@ -64,7 +66,7 @@ def test_subst_strftime_today(photosdb):
"""Test that strftime substitutions are correct for {today.strftime}"""
import locale
locale.setlocale(locale.LC_ALL, "en_US")
setlocale(locale.LC_ALL, "en_US")
photo = photosdb.photos(uuid=[UUID_DICT["place_dc"]])[0]
photo_template = osxphotos.PhotoTemplate(photo)