Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/libcloud/common/__pycache__/linode.cpython-39.pyc
Ðазад
a q�h� � @ s� d dl mZmZ d dlmZ g d�ZdZdZdddd d ddd dd� Zg d�Z G dd� de �ZG dd� de�ZG dd� de�Z dS )� )� ConnectionKey�JsonResponse)�InvalidCredsError)�API_HOST�API_ROOT�LinodeException�LinodeResponse�LinodeConnectionzapi.linode.com�/�1�2�4�6�7�8�9�10Z12) i i i i i @ i � i � i i � )Zext3Zext4Zswap�rawc @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) r z�Error originating from the Linode API This class wraps a Linode API error, a list of which is available in the API documentation. All Linode API errors are a numeric code and a human-readable description. c C s || _ || _||f| _d S �N)�code�message�args)�selfr r � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/libcloud/common/linode.py�__init__5 s zLinodeException.__init__c C s d| j | jf S )Nz(%u) %s�r r �r r r r �__str__: s zLinodeException.__str__c C s d| j | jf S )Nz<LinodeException code %u '%s'>r r r r r �__repr__= s zLinodeException.__repr__N)�__name__� __module__�__qualname__�__doc__r r r r r r r r . s r c s@ e Zd ZdZdZ� fdd�Z� fdd�Zdd� Zd d � Z� Z S )r z� Linode API response Wraps the HTTP response returned by the Linode API. libcloud does not take advantage of batching, so a response will always reflect the above format. A few weird quirks are caught here as well. Nc sJ g | _ tt| ��||� tdd�| _| �� \| _| _ | �� sF| j d �dS )z�Instantiate a LinodeResponse from the HTTP response :keyword response: The raw response returned by urllib :return: parsed :class:`LinodeResponse`� z!Invalid JSON received from serverr N) �errors�superr r r �invalid� parse_body�objects�success)r �response� connection�� __class__r r r M s �zLinodeResponse.__init__c s� t t� ��� }z�t|t�r |g}g }g }|D ]^}d|vsHd|vsHd|vr`|�d� |�� j� q,|�|d � |�� fdd�|d D �� q,||fW S ty� d� jgf Y S 0 dS )a Parse the body of the response into JSON objects If the response chokes the parser, action and data will be returned as None and errorarray will indicate an invalid JSON exception. :return: ``list`` of objects and ``list`` of errorsZDATAZ ERRORARRAYZACTIONNc 3 s | ]}� � |�V qd S r )� _make_excp)�.0�er r r � <genexpr>v � z,LinodeResponse.parse_body.<locals>.<genexpr>) r&