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
This commit is contained in:
Christian Clauss
2023-04-03 04:45:33 +02:00
committed by GitHub
parent 8b59615ff7
commit 3ddfea6a3d

View File

@@ -1153,7 +1153,7 @@ class PhotoTemplate:
) )
except ValueError as e: except ValueError as e:
raise SyntaxError( 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 ) from e
predicate_is_true = False 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 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 """Get the value of a 'place' field by attribute
Args: Args: