U vfj @ s d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m Z ddlmZ d\Z Zzddl Z W n& ek r Z zeZW 5 dZ[X Y nX ddlmZmZ d ZG d d dZdd ZG dd dZG dd deZdS )z2 Configuration file (aka ``ssh_config``) support. N)sha1)StringIO)partial)NN )CouldNotCanonicalizeConfigParseError c @ s e Zd ZdZedZddddddd d gdgdddddd d gdddd gddd gdddddddd d g d Zdd Ze dd Z e dd Ze dd Zdd Z dd Zd2ddZdd Zd d! Zd"d# Zd$d% Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ Zd0d1 ZdS )3 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%u~%d)ZcontrolpathhostnameidentityfileproxycommandZ 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 @/opt/alt/python38/lib/python3.8/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 )clstextr r r from_text] s zSSHConfig.from_textc C s* t |}| |W 5 Q R S Q R X dS )zr Create a new, parsed `SSHConfig` from the file found at ``path``. .. versionadded:: 2.7 N)openr )r pathflor 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 sR dgi d}|D ].}| }|r|dr.qt| j|}|sNtd||d }|d}|dkr| j | di i}|d kr| ||d <