Server IP : 15.235.198.142 / Your IP : 216.73.216.0 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/uaclient/api/u/apt_news/current_news/ |
Upload File : |
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), ] 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: return CurrentNewsResult(current_news=apt_news_raw_file.read()) endpoint = APIEndpoint( version="v1", name="CurrentNews", fn=_current_news, options_cls=None, )