Running black on all files
This commit is contained in:
1 parent
3237824e83
commit
740dfc97c7
5 files changed
+63
-20
No files matched your search
@@ -138,11 +138,15 @@ def parse_workbook(data: bytes) -> list[dict]:
|
||||
wb.close()
|
||||
|
||||
|
||||
async def _static_ap(db: AsyncSession, *, augmented_part_id: int, label: str, od_mm: float):
|
||||
async def _static_ap(
|
||||
db: AsyncSession, *, augmented_part_id: int, label: str, od_mm: float
|
||||
):
|
||||
"""Create an attachment point carrying a StaticConnection for ``od_mm``."""
|
||||
sc = await static_connection_crud.get_by_od_mm(db, od_mm)
|
||||
if sc is None:
|
||||
sc = await static_connection_crud.create(db, od_mm=od_mm, od_in=od_mm / MM_PER_INCH)
|
||||
sc = await static_connection_crud.create(
|
||||
db, od_mm=od_mm, od_in=od_mm / MM_PER_INCH
|
||||
)
|
||||
apn = await apn_crud.get_by_name(db, label)
|
||||
if apn is None:
|
||||
apn = await apn_crud.create(db, name=label)
|
||||
@@ -154,7 +158,9 @@ async def _static_ap(db: AsyncSession, *, augmented_part_id: int, label: str, od
|
||||
)
|
||||
|
||||
|
||||
async def _thread_ap(db: AsyncSession, *, augmented_part_id: int, label: str, spec: str):
|
||||
async def _thread_ap(
|
||||
db: AsyncSession, *, augmented_part_id: int, label: str, spec: str
|
||||
):
|
||||
"""Create an attachment point for a parsed ISO/UNC thread, or None."""
|
||||
parsed = _parse_thread_attribute(spec)
|
||||
if parsed is None:
|
||||
@@ -217,7 +223,9 @@ async def _link_fit(
|
||||
target_ap = target_aps[0]
|
||||
existing = await fit_crud.get_by_attachment_points(db, scope_ap, target_ap)
|
||||
if existing is None:
|
||||
await fit_crud.create(db, ap_a=scope_ap, ap_b=target_ap, label=FitLabel.POSSIBLE)
|
||||
await fit_crud.create(
|
||||
db, ap_a=scope_ap, ap_b=target_ap, label=FitLabel.POSSIBLE
|
||||
)
|
||||
|
||||
|
||||
async def import_scopes(db: AsyncSession, rows: list[dict]) -> ScopeImportResult:
|
||||
@@ -261,7 +269,9 @@ async def import_scopes(db: AsyncSession, rows: list[dict]) -> ScopeImportResult
|
||||
|
||||
manufacturer = await manufacturer_crud.get_by_name(db, manufacturer_name)
|
||||
if manufacturer is None:
|
||||
manufacturer = await manufacturer_crud.create(db, name=manufacturer_name, url="")
|
||||
manufacturer = await manufacturer_crud.create(
|
||||
db, name=manufacturer_name, url=""
|
||||
)
|
||||
|
||||
model_name = _text(row.get("model"))
|
||||
url = _text(row.get("url"))
|
||||
@@ -323,7 +333,9 @@ async def import_scopes(db: AsyncSession, rows: list[dict]) -> ScopeImportResult
|
||||
|
||||
# Rebuild attachment points from scratch so re-imports stay idempotent
|
||||
# (cascades delete any fits that referenced the old points).
|
||||
for old_ap in await attachment_point_crud.list_for_augmented_part(db, part.id):
|
||||
for old_ap in await attachment_point_crud.list_for_augmented_part(
|
||||
db, part.id
|
||||
):
|
||||
await attachment_point_crud.delete(db, old_ap)
|
||||
|
||||
ocular_ap = None
|
||||
|
||||
Reference in new issue
Block a user