File manager - Edit - /opt/imh-python/lib/python2.7/site-packages/rads/ssh.pyo
Back
� �]c @ sa d Z d d l Z d d l Z d d l m Z d e j f d � � YZ d e f d � � YZ d S( s Convenience classes for paramikoi����N( t SSHErrort SSHConnc B sP e Z d Z d � Z d � Z d � Z d d � Z d � Z d � Z d � Z RS( s� Context manager that handles SSH connections. Most exceptions may raise SSHError, but accessing the sftp attribute or paramiko functions inherited from paramiko.SSHClient directly may raise socket.error or paramiko.ssh_exception.SSHExceptionc K sE t t | � j � | j t j � � | | _ | | _ d | _ d S( sm Args for the context manager are read from here. If you don't need sftp functionality, set sftp=FalseN( t superR t __init__t set_missing_host_key_policyt paramikot AutoAddPolicyt _kwargst _use_sftpt Nonet sftp( t selfR t kwargs( ( s7 /opt/imh-python/lib/python2.7/site-packages/rads/ssh.pyR s c C sU y/ | j | j � | j r. | j � | _ n Wn t k rP } t | � � n X| S( s: Connects to SSH using the context manager 'with' statement( t connectR R t open_sftpR t ExceptionR ( R t exc( ( s7 /opt/imh-python/lib/python2.7/site-packages/rads/ssh.pyt __enter__ s c C s'