File: //usr/local/CyberPanel/lib64/python3.10/site-packages/paramiko/__pycache__/config.cpython-310.pyc
o
�h�j �
@ s� d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m
Z
ddlmZ d\Z
Zzddl
Z
W n eyJ Z zeZW Y dZ[ndZ[ww ddlmZmZ d ZG d
d� d�Zdd
� ZG dd� d�ZG dd� de�ZdS )z2
Configuration file (aka ``ssh_config``) support.
� N)�sha1)�StringIO)�partial)NN� )�CouldNotCanonicalize�ConfigParseError� c @ s� e Zd ZdZe�d�Zg d�dgg d�g d�g d�g d�d �Zd
d� Ze dd
� �Z
e dd� �Ze dd� �Zdd� Z
dd� Zd.dd�Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd$d%� Zd&d'� Zd(d)� Zd*d+� Zd,d-� ZdS )/� SSHConfiga�
Representation of config information as stored in the format used by
OpenSSH. Queries can be made via `lookup`. The format is described in
OpenSSH's ``ssh_config`` man page. This class is provided primarily as a
convenience to posix users (since the OpenSSH format is a de-facto
standard on posix) but should work fine on Windows too.
.. versionadded:: 1.6
z(\w+)(?:\s*=\s*|\s+)(.+))�%C�%h�%l�%L�%n�%p�%r�%ur )r
�~�%dr r r r )r r r r )r r r ) r
r r r
r r r r r )�controlpath�hostname�identityfile�proxycommand� proxyjump�
match-execc C s
g | _ dS )a�
Create a new OpenSSH config object.
Note: the newer alternate constructors `from_path`, `from_file` and
`from_text` are simpler to use, as they parse on instantiation. For
example, instead of::
config = SSHConfig()
config.parse(open("some-path.config")
you could::
config = SSHConfig.from_file(open("some-path.config"))
# Or more directly:
config = SSHConfig.from_path("some-path.config")
# Or if you have arbitrary ssh_config text from some other source:
config = SSHConfig.from_text("Host foo\n\tUser bar")
N)�_config)�self� r �E/usr/local/CyberPanel/lib/python3.10/site-packages/paramiko/config.py�__init__H s
zSSHConfig.__init__c C s | � t|��S )zg
Create a new, parsed `SSHConfig` from ``text`` string.
.. versionadded:: 2.7
)� from_filer )�cls�textr r r � from_text] s zSSHConfig.from_textc C s6 t |��
}| �|�W d � S 1 sw Y dS )zr
Create a new, parsed `SSHConfig` from the file found at ``path``.
.. versionadded:: 2.7
N)�openr )r �path�flor r r � from_pathf s
$�zSSHConfig.from_pathc C s | � }|� |� |S )zp
Create a new, parsed `SSHConfig` from file-like object ``flo``.
.. versionadded:: 2.7
)�parse)r r% �objr r r r p s
zSSHConfig.from_filec C sL dgi d�}|D ]�}|� � }|r|�d�rqt�| j|�}|s&td�|���|�d��� }|�d�}|dv rT| j �
|� di i}|d krL| �|�|d <