File: //kunden/lib/python3/dist-packages/breezy/__pycache__/plugin.cpython-39.pyc
a
�*�^�] � @ s� d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl m Z e e
� d� ddlmZ d Zd
srej
dkrxdZnd
ZdPdd�ZdQdd�Zdd� Zdd� Zdd� ZG dd� de�Zdd� ZdRdd�ZdSd d!�ZdTd#d$�Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� Z dUd4d5�Z!d6d7� Z"d8d9� Z#d:d;� Z$d<d=� Z%d>d?� Z&d@dA� Z'dBdC� Z(dVdDdE�Z)G dFdG� dGe*�Z+G dHdI� dIe*�Z,G dJdK� dKe*�Z-G dLdM� dMe*�Z.G dNdO� dOe*�Z/dS )Wa� Breezy plugin support.
Which plugins to load can be configured by setting these environment variables:
- BRZ_PLUGIN_PATH: Paths to look for plugins in.
- BRZ_DISABLE_PLUGINS: Plugin names to block from being loaded.
- BRZ_PLUGINS_AT: Name and paths for plugins to load from specific locations.
The interfaces this module exports include:
- disable_plugins: Load no plugins and stop future automatic loading.
- load_plugins: Load all plugins that can be found in configuration.
- describe_plugins: Generate text for each loaded (or failed) plugin.
- extend_path: Mechanism by which the plugins package path is set.
- plugin_name: Gives unprefixed name of a plugin module.
See the plugin-api developer documentation for information about writing
plugins.
� )�absolute_importN� )�osutils)�lazy_importz�
import imp
from importlib import util as importlib_util
from breezy import (
bedding,
debug,
help_topics,
trace,
)
)�errorszbreezy.plugins.T)� z.pycz.pyoc C s | du rt �� } i | _dS )z�Disable loading plugins.
Future calls to load_plugins() will be ignored.
:param state: The library state object that records loaded plugins.
N)�breezy�get_global_state�plugins)�state� r �//usr/lib/python3/dist-packages/breezy/plugin.py�disable_pluginsH s r c C sf |du rt �� }t|dd�dur$dS | du r8ddlm} i |_t|| � dt� v rZt|� t � |_ dS )a� Load breezy plugins.
The environment variable BRZ_PLUGIN_PATH is considered a delimited
set of paths to look through. Each entry is searched for `*.py`
files (and whatever other extensions are used in the platform,
such as `*.pyd`).
:param path: The list of paths to search for plugins. By default,
it is populated from the __path__ of the breezy.plugins package.
:param state: The library state object that records loaded plugins.
Nr
r )�__path__)N�entrypoints)
r r �getattrZbreezy.pluginsr �plugin_warnings�_load_plugins_from_path�_env_plugin_path�_load_plugins_from_entrypointsr
)�pathr r r r
�load_pluginsT s
r c C sX zdd l }W n ty Y n60 |�d�D ](}t|j }|tjv rDq*|�� tj|<