Rebrand the Rust client crate (coven/ → hh/, package+binary "hack-house"), README, CLI strings, and branch (coven → hack-house). Gitea repo renamed cmd-chat → hack-house to match. Crypto/server logic unchanged; selftest + golden-vector test still green, binary is now `hack-house`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
|
|
class RequestParameters(dict):
|
|
"""Hosts a dict with lists as values where get returns the first value of the list and getlist returns the whole shebang""" # noqa: E501
|
|
|
|
def get(self, name: str, default: Any | None = None) -> Any | None:
|
|
"""Return the first value, either the default or actual
|
|
|
|
Args:
|
|
name (str): The name of the parameter
|
|
default (Any | None, optional): The default value. Defaults to None.
|
|
|
|
Returns:
|
|
Any | None: The first value of the list
|
|
""" # noqa: E501
|
|
return super().get(name, [default])[0]
|
|
|
|
def getlist(
|
|
self, name: str, default: list[Any] | None = None
|
|
) -> list[Any]:
|
|
"""Return the entire list
|
|
|
|
Args:
|
|
name (str): The name of the parameter
|
|
default (list[Any] | None, optional): The default value. Defaults to None.
|
|
|
|
Returns:
|
|
list[Any]: The entire list of values or [] if not found
|
|
""" # noqa: E501
|
|
return super().get(name, default) or []
|