File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/current_news.tar
Back
v1.py 0000644 00000003366 15030076701 0005453 0 ustar 00 from typing import Optional from uaclient.api.api import APIEndpoint from uaclient.api.data_types import AdditionalInfo from uaclient.config import UAConfig from uaclient.data_types import DataObject, Field, StringDataValue from uaclient.files.state_files import apt_news_raw_file class CurrentNewsResult(DataObject, AdditionalInfo): fields = [ Field( "current_news", StringDataValue, required=False, doc=( "The current APT News to be displayed for the system. This" " could be a str with up to three lines (i.e. up to two" " ``\\n`` characters). If there is no APT News to be" " displayed, this will be ``None``." ), ), ] def __init__(self, *, current_news: Optional[str]): self.current_news = current_news def current_news() -> CurrentNewsResult: return _current_news(UAConfig()) def _current_news(cfg: UAConfig) -> CurrentNewsResult: """ This endpoint returns the current APT News that gets displayed in `apt upgrade`. """ return CurrentNewsResult(current_news=apt_news_raw_file.read()) endpoint = APIEndpoint( version="v1", name="CurrentNews", fn=_current_news, options_cls=None, ) _doc = { "introduced_in": "29", "requires_network": False, "example_python": """ from uaclient.api.u.apt_news.current_news.v1 import current_news result = current_news().current_news """, "result_class": CurrentNewsResult, "exceptions": [], "example_cli": "pro api u.apt_news.current_news.v1", "example_json": """ { "current_news":"This is a news message.\\nThis is the second line of the message.\\nAnd this is the third line." } """, # noqa: E501 } __pycache__/__init__.cpython-310.pyc 0000644 00000000254 15030076701 0013214 0 ustar 00 o �ϴf � @ s d S )N� r r r �O/usr/lib/python3/dist-packages/uaclient/api/u/apt_news/current_news/__init__.py�<module> s __pycache__/v1.cpython-310.pyc 0000644 00000003741 15030076701 0012007 0 ustar 00 o �(�f� � @ s� d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z m Z mZ d dlm Z G dd� de e�Zd efd d�Zded efd d�Zeddedd�Zdddeg ddd�ZdS )� )�Optional)�APIEndpoint)�AdditionalInfo)�UAConfig)� DataObject�Field�StringDataValue)�apt_news_raw_filec @ s0 e Zd Zededdd�gZdee fdd�ZdS )�CurrentNewsResult�current_newsFz�The current APT News to be displayed for the system. This could be a str with up to three lines (i.e. up to two ``\n`` characters). If there is no APT News to be displayed, this will be ``None``.)�required�docc C s || _ d S �N�r )�selfr � r �I/usr/lib/python3/dist-packages/uaclient/api/u/apt_news/current_news/v1.py�__init__ � zCurrentNewsResult.__init__N) �__name__� __module__�__qualname__r r �fieldsr �strr r r r r r s ��r �returnc C s t t� �S r )� _current_newsr r r r r r r r �cfgc C s t t�� d�S )z^ This endpoint returns the current APT News that gets displayed in `apt upgrade`. r )r r �read)r r r r r ! s r �v1�CurrentNewsN)�version�name�fn�options_cls�29Fzh from uaclient.api.u.apt_news.current_news.v1 import current_news result = current_news().current_news z"pro api u.apt_news.current_news.v1zx { "current_news":"This is a news message.\nThis is the second line of the message.\nAnd this is the third line." } )� introduced_in�requires_network�example_python�result_class� exceptions�example_cli�example_json)�typingr �uaclient.api.apir �uaclient.api.data_typesr �uaclient.configr �uaclient.data_typesr r r �uaclient.files.state_filesr r r r �endpoint�_docr r r r �<module> s. � � __init__.py 0000644 00000000000 15030076701 0006642 0 ustar 00
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings