From 3ddfea6a3d6de399cdf7bea83bc5e1407222bd90 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Apr 2023 04:45:33 +0200 Subject: [PATCH] Fix two undefined names in phototemplate.py (#1030) * Fix two undefined names in phototemplate.py % `ruff --exit-zero --select=E9,F63,F7,F82,YTT .` ``` osxphotos/cli/report_writer.py:22:1: F822 Undefined name `ExportReportWriterSqlite` in `__all__` osxphotos/cli/report_writer.py:22:1: F822 Undefined name `SyncReportWriterSqlite` in `__all__` osxphotos/phototemplate.py:1156:108: F821 Undefined name `vals` osxphotos/phototemplate.py:1685:29: F821 Undefined name `PhotoInfo` Found 4 errors. ``` * Avoid cyclic imports --- osxphotos/phototemplate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osxphotos/phototemplate.py b/osxphotos/phototemplate.py index 4c8de213..26245aef 100644 --- a/osxphotos/phototemplate.py +++ b/osxphotos/phototemplate.py @@ -1153,7 +1153,7 @@ class PhotoTemplate: ) except ValueError as e: raise SyntaxError( - f"comparison operators may only be used with values that can be converted to numbers: {vals} {conditional_value}" + f"comparison operators may only be used with values that can be converted to numbers: {value} {conditional_value}" ) from e predicate_is_true = False @@ -1682,7 +1682,7 @@ def format_date_field(dt: datetime.datetime, field: str, args: List[str]) -> str raise ValueError(f"Unhandled template value: {field}") from e -def get_place_value(photo: "PhotoInfo", field: str): +def get_place_value(photo: "PhotoInfo", field: str): # noqa: F821 """Get the value of a 'place' field by attribute Args: