Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/influxdb/__pycache__/resultset.cpython-39.pyc
Ðазад
a p�hd � @ sb d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ e � Z G dd � d e �ZdS ) z Module to prepare the resultset.� )�absolute_import)�division)�print_function)�unicode_literalsN)�InfluxDBClientErrorc @ s� e Zd ZdZd!dd�Zedd� �Zejdd� �Zedd � �Zd d� Z d"d d�Z dd� Zdd� Ze dd� �Zdd� Zdd� Zdd� Zdd� Zdd� Ze dd � �ZdS )#� ResultSetz0A wrapper around a single InfluxDB query result.Tc C s6 || _ | j �dd�| _| jdur2|du r2t| j��dS )zInitialize the ResultSet.�errorNT)�_raw�get�_errorr r )�self�series�raise_errors� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/influxdb/resultset.py�__init__ s zResultSet.__init__c C s | j S )zRaw JSON from InfluxDB.�r �r r r r �raw s z ResultSet.rawc C s || _ d S )Nr )r �valuer r r r s c C s | j S )zError returned by InfluxDB.)r r r r r r $ s zResultSet.errorc C s~ t �dt� t|t�rVt|�dkr*td��|d }|d }t|t�sr|durrtd��nt|t�rjd}|}n|}d}| �||�S )a� Retrieve the series name or specific set based on key. :param key: Either a series name, or a tags_dict, or a 2-tuple(series_name, tags_dict). If the series name is None (or not given) then any serie matching the eventual given tags will be given its points one after the other. To get the points of every series in this resultset then you have to provide None as key. :return: A generator yielding `Point`s matching the given key. NB: The order in which the points are yielded is actually undefined but it might change.. zQResultSet's ``__getitem__`` method will be deprecated. Use``get_points`` instead.� zonly 2-tuples allowedr � Nztags should be a dict) �warnings�warn�DeprecationWarning� isinstance�tuple�len� TypeError�dict� get_points)r �key�name�tagsr r r �__getitem__) s"