mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-17 08:52:34 +08:00
Fix ruff linting issues
- Remove debug print statements - Remove trailing whitespace on blank lines - Remove unused pytest import Amp-Thread-ID: https://ampcode.com/threads/T-019c3a8d-3b4f-75b4-8513-1c77914782f7 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
parent
dcba47251a
commit
043a75acde
@ -322,7 +322,7 @@ def build_asset_specs(
|
|||||||
|
|
||||||
mime_type = metadata.content_type if metadata else None
|
mime_type = metadata.content_type if metadata else None
|
||||||
if mime_type is None:
|
if mime_type is None:
|
||||||
print(f"[build_asset_specs] no mime_type for {abs_p} (metadata={metadata is not None})")
|
pass
|
||||||
specs.append(
|
specs.append(
|
||||||
{
|
{
|
||||||
"abs_path": abs_p,
|
"abs_path": abs_p,
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import threading
|
|||||||
import time
|
import time
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import TYPE_CHECKING, Callable
|
from typing import Callable
|
||||||
|
|
||||||
from app.assets.scanner import (
|
from app.assets.scanner import (
|
||||||
RootType,
|
RootType,
|
||||||
@ -20,9 +20,6 @@ from app.assets.scanner import (
|
|||||||
)
|
)
|
||||||
from app.database.db import dependencies_available
|
from app.database.db import dependencies_available
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class State(Enum):
|
class State(Enum):
|
||||||
"""Seeder state machine states."""
|
"""Seeder state machine states."""
|
||||||
|
|||||||
@ -22,7 +22,7 @@ MAX_SAFETENSORS_HEADER_SIZE = 8 * 1024 * 1024
|
|||||||
|
|
||||||
def _register_custom_mime_types():
|
def _register_custom_mime_types():
|
||||||
"""Register custom MIME types for model and config files.
|
"""Register custom MIME types for model and config files.
|
||||||
|
|
||||||
Called before each use because mimetypes.init() in server.py resets the database.
|
Called before each use because mimetypes.init() in server.py resets the database.
|
||||||
Uses a quick check to avoid redundant registrations.
|
Uses a quick check to avoid redundant registrations.
|
||||||
"""
|
"""
|
||||||
@ -30,7 +30,7 @@ def _register_custom_mime_types():
|
|||||||
test_result, _ = mimetypes.guess_type("test.safetensors")
|
test_result, _ = mimetypes.guess_type("test.safetensors")
|
||||||
if test_result == "application/safetensors":
|
if test_result == "application/safetensors":
|
||||||
return
|
return
|
||||||
|
|
||||||
mimetypes.add_type("application/safetensors", ".safetensors")
|
mimetypes.add_type("application/safetensors", ".safetensors")
|
||||||
mimetypes.add_type("application/safetensors", ".sft")
|
mimetypes.add_type("application/safetensors", ".sft")
|
||||||
mimetypes.add_type("application/pytorch", ".pt")
|
mimetypes.add_type("application/pytorch", ".pt")
|
||||||
@ -314,7 +314,7 @@ def extract_file_metadata(
|
|||||||
mime_type, _ = mimetypes.guess_type(abs_path)
|
mime_type, _ = mimetypes.guess_type(abs_path)
|
||||||
meta.content_type = mime_type
|
meta.content_type = mime_type
|
||||||
if mime_type is None:
|
if mime_type is None:
|
||||||
print(f"[extract_file_metadata] No mime_type for {abs_path}")
|
pass
|
||||||
|
|
||||||
# Size from stat
|
# Size from stat
|
||||||
if stat_result is None:
|
if stat_result is None:
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
from app.assets.database.models import Asset
|
from app.assets.database.models import Asset
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user