ruff
This commit is contained in:
@@ -21,7 +21,9 @@ DEFAULT_EXPIRATION_SECONDS = 3600
|
|||||||
# Storage directory - configurable via WORKSPACE_ATTACHMENT_DIR env var
|
# Storage directory - configurable via WORKSPACE_ATTACHMENT_DIR env var
|
||||||
# Uses absolute path to avoid creating tmp/ in arbitrary working directories (see #327)
|
# Uses absolute path to avoid creating tmp/ in arbitrary working directories (see #327)
|
||||||
_default_dir = str(Path.home() / ".workspace-mcp" / "attachments")
|
_default_dir = str(Path.home() / ".workspace-mcp" / "attachments")
|
||||||
STORAGE_DIR = Path(os.getenv("WORKSPACE_ATTACHMENT_DIR", _default_dir)).expanduser().resolve()
|
STORAGE_DIR = (
|
||||||
|
Path(os.getenv("WORKSPACE_ATTACHMENT_DIR", _default_dir)).expanduser().resolve()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _ensure_storage_dir() -> None:
|
def _ensure_storage_dir() -> None:
|
||||||
|
|||||||
@@ -943,7 +943,8 @@ async def get_gmail_attachment_content(
|
|||||||
# Fallback: match by size if exactly one attachment matches (IDs are ephemeral)
|
# Fallback: match by size if exactly one attachment matches (IDs are ephemeral)
|
||||||
if not filename and attachments:
|
if not filename and attachments:
|
||||||
size_matches = [
|
size_matches = [
|
||||||
att for att in attachments
|
att
|
||||||
|
for att in attachments
|
||||||
if att.get("size") and abs(att["size"] - size_bytes) < 100
|
if att.get("size") and abs(att["size"] - size_bytes) < 100
|
||||||
]
|
]
|
||||||
if len(size_matches) == 1:
|
if len(size_matches) == 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user