types#

实现所有 conda.notices 类型。

#

ChannelNotice

表示单个频道通知。

ChannelNoticeResultSet

表示频道通知列表,以及一些附带的

ChannelNoticeResponse

属性#

UNDEFINED_MESSAGE_ID = 'undefined'#
class ChannelNotice#

基类: NamedTuple

表示单个频道通知。

id: str#
channel_name: str | None#
message: str | None#
level: conda.base.constants.NoticeLevel#
created_at: datetime.datetime | None#
expired_at: datetime.datetime | None#
interval: int | None#
to_dict()#
class ChannelNoticeResultSet#

基类: NamedTuple

表示频道通知列表,以及一些附带的元数据,例如 viewed_channel_notices

channel_notices: collections.abc.Sequence[ChannelNotice]#
total_number_channel_notices: int#
viewed_channel_notices: int#
class ChannelNoticeResponse#

基类: NamedTuple

property notices: collections.abc.Sequence[ChannelNotice]#
url: str#
name: str#
json_data: dict | None#
static _parse_notice_level(level: str | None) conda.base.constants.NoticeLevel#

我们使用此方法来验证通知级别,并在任何级别无效时提供合理的默认值。

static _parse_iso_timestamp(iso_timestamp: str | None) datetime.datetime | None#

解析 ISO 时间戳,并在失败时回退到默认值 none。

classmethod get_cache_key(url: str, cache_dir: pathlib.Path) pathlib.Path#

返回通过哈希 URL 缓存此频道响应的位置。