master
/ miniconda3 / lib / python3.11 / site-packages / conda / cli / main_notices.py

main_notices.py @74036c5

41a0142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from argparse import ArgumentParser, Namespace

from ..exceptions import CondaError
from ..notices import core as notices


def execute(args: Namespace, _: ArgumentParser):
    """Command that retrieves channel notifications, caches them and displays them."""
    try:
        channel_notice_set = notices.retrieve_notices()
    except OSError as exc:
        raise CondaError(f"Unable to retrieve notices: {exc}")

    notices.display_notices(channel_notice_set)