mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-09-29 09:28:35 -05:00
scanner.py reached past the package's own re-export surface to import _is_live_path_conflict directly out of records.py. The underscore said module-private while the import said otherwise, and records.py deliberately publishes its public names through app.assets.database.queries -- which the same import block three lines above was already using. The use is correct and unchanged; only the name and the route change. Renamed to is_live_path_conflict, listed in the package __init__ import and __all__ alongside its siblings, and scanner.py now takes it from the package like everything else it imports from there.
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
"""Re-exports the record and tag query functions so callers import them from one
|
|
place instead of reaching into individual query modules. A module-level
|
|
``__getattr__`` resolves names that live in the tag module, keeping this import
|
|
surface flat as queries are split across more files.
|
|
"""
|
|
|
|
from importlib import import_module
|
|
|
|
from app.assets.database.queries.records import (
|
|
create_content,
|
|
create_content_reporting_insert,
|
|
create_record,
|
|
delete_record,
|
|
fetch_record_tags,
|
|
get_record_by_id,
|
|
is_live_path_conflict,
|
|
list_records_page,
|
|
mark_content_missing,
|
|
rename_record,
|
|
unset_content_missing,
|
|
update_record_access_time,
|
|
)
|
|
|
|
__all__ = [
|
|
"create_content",
|
|
"create_content_reporting_insert",
|
|
"create_record",
|
|
"delete_record",
|
|
"fetch_record_tags",
|
|
"get_record_by_id",
|
|
"is_live_path_conflict",
|
|
"list_records_page",
|
|
"mark_content_missing",
|
|
"rename_record",
|
|
"unset_content_missing",
|
|
"update_record_access_time",
|
|
]
|
|
|
|
|
|
def __getattr__(name: str):
|
|
for module_name in ("tags",):
|
|
module = import_module(f"app.assets.database.queries.{module_name}")
|
|
candidate = getattr(module, name, None)
|
|
if candidate is not None:
|
|
return candidate
|
|
raise AttributeError(name)
|