Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/keystoneauth1/loading/__pycache__/opts.cpython-39.pyc
Ðазад
a s�h" � @ sL d dl Z d dlZd dlZd dlmZ ejr6d dlmZ dZ G dd� d�Z dS )� N)�_utils��cfg)�Optc @ s� e Zd ZdZeddddddddf eejej eje e eje eje d ejeje e eje d� dd�Zed�dd �Zd d�dd�Z eje d �dd�Zeejd d�dd��Zee e d�dd��Zeeje d�dd��Zeejd�dd��ZdS )r a� An option required by an authentication plugin. Opts provide a means for authentication plugins that are going to be dynamically loaded to specify the parameters that are to be passed to the plugin on initialization. The Opt specifies information about the way the plugin parameter is to be represented in different loading mechanisms. When defining an Opt with a - the - should be present in the name parameter. This will automatically be converted to an _ when passing to the plugin initialization. For example, you should specify:: Opt('user-domain-id') which will pass the value as `user_domain_id` to the plugin's initialization. :param str name: The name of the option. :param callable type: The type of the option. This is a callable which is passed the raw option that was loaded (often a string) and is required to return the parameter in the type expected by __init__. :param str help: The help text that is shown along with the option. :param bool secret: If the parameter is secret it should not be printed or logged in debug output. :param str dest: the name of the argument that will be passed to __init__. This allows you to have a different name in loading than is used by the __init__ function. Defaults to the value of name. :param keystoneauth1.loading.Opt deprecated: A list of other options that are deprecated in favour of this one. This ensures the old options are still registered. :type opt: list(Opt) :param default: A default value that can be used if one is not provided. :param str metavar: The <metavar> that should be printed in CLI help text. :param bool required: If the option is required to load the plugin. If a required option is not present loading should fail. :param str prompt: If the option can be requested via a prompt (where appropriate) set the string that should be used to prompt with. NF) �name�type�help�secret�dest� deprecated�default�metavar�required�promptc C s� t |�std��|d u r$|�dd�}|| _|| _|| _|| _| | _|| _|d u rTg n|| _ || _ || _| | _| j | _ d| _d | _d | _d S )Nztype must be callable�-�_F)�callable� TypeError�replacer r r r r r r r r r �deprecated_optsZdeprecated_for_removalZsample_default�group)�selfr r r r r r r r r r � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/keystoneauth1/loading/opts.py�__init__B s$ zOpt.__init__)�returnc C s d| j � d�S )z,Return string representation of option name.z<Opt: �>�r �r r r r �__repr__e s zOpt.__repr__zcfg.Optc sD t �� � � fdd�| jD �}� j| j| j| j| j| j| j || j d�S )Nc s g | ]}� � |j��qS r )Z DeprecatedOptr ��.0�or r r � <listcomp>k � z$Opt._to_oslo_opt.<locals>.<listcomp>)r r r r r r r r )r Zget_oslo_configr r r r r r r r r )r r r r r �_to_oslo_opti s �zOpt._to_oslo_opt)�otherr c C s| t | �t |�u oz| j|jkoz| j |j koz| j|jkoz| j|jkoz| j|jkoz| j|jkoz| j|jkoz| j|jkoz| j|jkS )z.Define equality operator on option parameters.) r r r r r r r r r )r r&