File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/u.zip
Back
PK [7�Z7j� � � - apt_news/__pycache__/__init__.cpython-310.pycnu �[��� o �ϴf � @ s d S )N� r r r �B/usr/lib/python3/dist-packages/uaclient/api/u/apt_news/__init__.py�<module> s PK [7�Z���� � apt_news/current_news/v1.pynu �[��� 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 } PK [7�ZfP��� � : apt_news/current_news/__pycache__/__init__.cpython-310.pycnu �[��� 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 PK [7�Z� �� � 4 apt_news/current_news/__pycache__/v1.cpython-310.pycnu �[��� 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. � �PK [7�Z ! apt_news/current_news/__init__.pynu �[��� PK [7�Z apt_news/__init__.pynu �[��� PK [7�Ze�ܼ� � $ __pycache__/__init__.cpython-310.pycnu �[��� o �ϴf � @ s d S )N� r r r �9/usr/lib/python3/dist-packages/uaclient/api/u/__init__.py�<module> s PK [7�Z����� � - security/__pycache__/__init__.cpython-310.pycnu �[��� o �ϴf � @ s d S )N� r r r �B/usr/lib/python3/dist-packages/uaclient/api/u/security/__init__.py�<module> s PK [7�Z3�:�_ _ security/package_manifest/v1.pynu �[��� from uaclient import apt, snap 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 class PackageManifestResult(DataObject, AdditionalInfo): fields = [ Field( "manifest_data", StringDataValue, doc=( "Manifest of ``apt`` and ``snap`` packages installed on the" " system" ), ), ] def __init__(self, manifest_data: str): self.manifest_data = manifest_data # The return class was once called PackageManifestResults # We are keeping compatibility PackageManifestResults = PackageManifestResult def package_manifest() -> PackageManifestResult: return _package_manifest(UAConfig()) def _package_manifest(cfg: UAConfig) -> PackageManifestResult: """ This endpoint returns the status of installed packages (``apt`` and ``snap``), formatted as a manifest file (i.e., ``package_name\\tversion``). """ manifest = "" apt_pkgs = apt.get_installed_packages() for apt_pkg in apt_pkgs: arch = "" if apt_pkg.arch == "all" else ":" + apt_pkg.arch manifest += "{}{}\t{}\n".format(apt_pkg.name, arch, apt_pkg.version) pkgs = snap.get_installed_snaps() for pkg in pkgs: manifest += "snap:{name}\t{channel}\t{revision}\n".format( name=pkg.name, channel=pkg.channel, revision=pkg.revision, ) return PackageManifestResult(manifest_data=manifest) endpoint = APIEndpoint( version="v1", name="Packages", fn=_package_manifest, options_cls=None, ) _doc = { "introduced_in": "27.12", "requires_network": False, "example_python": """ from uaclient.api.u.security.package_manifest.v1 import package_manifest result = package_manifest() """, "result_class": PackageManifestResult, "exceptions": [], "example_cli": "pro api u.security.package_manifest.v1", "example_json": """ { "package_manifest":"package1\\t1.0\\npackage2\\t2.3\\n" } """, } PK [7�Z�[[�� � >