core#

Core conda notices logic.

函数#

retrieve_notices(...)

用于检索通知的函数。这也由 “notices” 装饰器调用

display_notices(→ None)

将频道通知打印到标准输出。

notices(func)

子命令 “execute” 入口点的包装器。

get_channel_name_and_urls(→ list[tuple[ChannelUrl, ...)

返回频道 URL 和名称元组的序列。

flatten_notice_responses(...)

filter_notices(...)

为提供的 ChannelNotice 对象序列执行过滤操作。

is_channel_notices_enabled(→ bool)

确定是否启用频道通知,以及何时显示它们

is_channel_notices_cache_expired(→ bool)

检查我们用于跟踪已显示通知的通知缓存文件是否已过期。

属性#

ChannelName#
ChannelUrl#
logger#
retrieve_notices(limit: int | None = None, always_show_viewed: bool = True, silent: bool = False) conda.notices.types.ChannelNoticeResultSet#

用于检索通知的函数。这由 “notices” 装饰器以及子命令 “notices” 调用

参数:
  • limit -- 限制要显示的通知数量(默认为 None)。

  • always_show_viewed -- 是否应显示所有通知,而不仅仅是未读通知(默认为 True)。

  • silent -- 在获取和缓存通知时是否使用微调器。

display_notices(channel_notice_set: conda.notices.types.ChannelNoticeResultSet) None#

将频道通知打印到标准输出。

notices(func)#

子命令 “execute” 入口点的包装器。

如果需要获取频道通知,我们首先执行此操作,然后正常运行命令。然后,我们在命令输出的末尾显示这些通知,以便用户更有可能看到它们。

此排序专门用于解决以下错误报告
参数:

func -- 要装饰的函数

get_channel_name_and_urls(channels: collections.abc.Sequence[conda.models.channel.Channel | conda.models.channel.MultiChannel]) list[tuple[ChannelUrl, ChannelName]]#

返回频道 URL 和名称元组的序列。

此函数处理 Channel 和 MultiChannel 对象类型。

flatten_notice_responses(channel_notice_responses: collections.abc.Sequence[conda.notices.types.ChannelNoticeResponse]) collections.abc.Sequence[conda.notices.types.ChannelNotice]#
filter_notices(channel_notices: collections.abc.Sequence[conda.notices.types.ChannelNotice], limit: int | None = None, exclude: set[str] | None = None) collections.abc.Sequence[conda.notices.types.ChannelNotice]#

为提供的 ChannelNotice 对象序列执行过滤操作。

is_channel_notices_enabled(ctx: conda.base.context.Context) bool#

确定是否启用频道通知,以及何时显示它们。

这仅在以下情况下发生
  • offline 为 False

  • number_channel_notices 大于 0

参数:

ctx -- Conda 上下文对象

is_channel_notices_cache_expired() bool#

检查我们用于跟踪已显示通知的通知缓存文件是否已过期。这涉及检查文件的 mtime 属性。任何早于 NOTICES_DECORATOR_DISPLAY_INTERVAL 指定值的时间都被视为已过期。