3
گaA @ s d Z ddlZddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm
Z
dd lmZ dd
lmZ ddlm
Z
ddlmZ ddlZddlZddlZddlZdd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ejeZ dddddddddddddd d!d"d#gZ!G d$d% d%Z"G d&d' d'eZ#d(Z$d)Z%d*Z&d+Z'e
ej( e
e)d,d-d.Z*e
ej( e
e)d,d/d0Z+ej(e
ej( e
e)d1d2d3Z,dS )4z.Utilities for plugins discovery and selection. N)Callable)cast)Dict)Iterable)Iterator)List)Mapping)Optional)Type)Union)
configuration)errors)
interfaces) constants)os)Errorcertbotzcertbot-apachezcertbot-dns-cloudflarezcertbot-dns-cloudxnszcertbot-dns-digitaloceanzcertbot-dns-dnsimplezcertbot-dns-dnsmadeeasyzcertbot-dns-gehirnzcertbot-dns-googlezcertbot-dns-linodezcertbot-dns-luadnszcertbot-dns-nsonezcertbot-dns-ovhzcertbot-dns-rfc2136zcertbot-dns-route53zcertbot-dns-sakuracloudz
certbot-nginxc @ s e Zd ZdZdZd2ejeddddZe e
eddd Zeejee
dd
dZ
ee
dd
dZee
dddZee
dddZeje
ddddZeedddZejeddddZee edddZeedddZd3e ej ejddd Zee ed!d"d#Zeedd$d%Zeee f dd&d'Z!eedd(d)Z"ee e# dd*d+Z$eedd,d-Z%e
dd.d/Z&e
dd0d1Z'dS )4PluginEntryPointzPlugin entry point.NF)entry_pointwith_prefixreturnc C s@ | j ||| _|j | _|| _d | _d | _d | _d| _d | _ d S )NF)
entry_point_to_plugin_namenameload
plugin_clsr warning_message_initialized _prepared_hidden_long_description)selfr r r! /usr/lib/python3.6/disco.py__init__: s
zPluginEntryPoint.__init__)r r c C s$ || j kr | jrtj| j dS dS )z(Check if the name refers to this plugin.TF)r r loggerwarning)r r r! r! r"
check_nameD s
zPluginEntryPoint.check_namec C s6 |r0|j stjd|j d|j jd |j S |jS )z)Unique plugin name for an ``entry_point``zEntrypoint z has no distribution!:)distr
r r key)clsr r r! r! r" r L s
z+PluginEntryPoint.entry_point_to_plugin_name)r c C s | j jS )zDescription of the plugin.)r description)r r! r! r" r+ V s zPluginEntryPoint.descriptionc C s dj | j| jS )z$Description with name. Handy for UI.z {0} ({1}))formatr+ r )r r! r! r" description_with_name[ s z&PluginEntryPoint.description_with_namec C s | j r| j S t| jd| jS )zLong description of the plugin.long_description)r getattrr r+ )r r! r! r" r. ` s z!PluginEntryPoint.long_description)r+ r c C s
|| _ d S )N)r )r r+ r! r! r" r. g s c C s | j pt| jddS )z%Should this plugin be hidden from UI?hiddenF)r r/ r )r r! r! r" r0 k s zPluginEntryPoint.hidden)hider c C s
|| _ d S )N)r )r r1 r! r! r" r0 p s )
ifaces_groupsr c s | pt fdd|D S )z2Does plugin implements specified interface groups?c 3 s$ | ]}t fd d|D V qdS )c 3 s | ]}t j|V qd S )N)_implementsr ).0iface)r r! r"