コード例 #1
0
ファイル: ssh.py プロジェクト: louisdcoulombe/rcontrol
 def __init__(self, client, sftp=True, auto_close=True):
     BaseSession.__init__(self, auto_close=auto_close)
     self.ssh_client = client
     if sftp:
         self.sftp = client.open_sftp()
     else:
         self.sftp = None
コード例 #2
0
ファイル: ssh.py プロジェクト: intermezzo-fr/rcontrol
    def __str__(self):
        username = getattr(self.ssh_client, 'username', None)
        hostname = getattr(self.ssh_client, 'hostname', None)

        if username and hostname:
            return "<SshSession %s@%s>" % (username, hostname)
        elif hostname:
            return "<SshSession %s>" % hostname
        return BaseSession.__str__(self)
コード例 #3
0
    def __str__(self):
        username = getattr(self.ssh_client, 'username', None)
        hostname = getattr(self.ssh_client, 'hostname', None)

        if username and hostname:
            return "<SshSession %s@%s>" % (username, hostname)
        elif hostname:
            return "<SshSession %s>" % hostname
        return BaseSession.__str__(self)
コード例 #4
0
ファイル: ssh.py プロジェクト: coder46/rcontrol
 def __init__(self, client, auto_close=True):
     BaseSession.__init__(self, auto_close=auto_close)
     self.ssh_client = client
     self.sftp = client.open_sftp()
コード例 #5
0
 def __init__(self, client, auto_close=True):
     BaseSession.__init__(self, auto_close=auto_close)
     self.ssh_client = client
     self.sftp = client.open_sftp()