示例#1
0
    def __init__(self, log, command, *args, **kwargs):
        self.log = log
        self.command = command
        self.finished = Deferred()
        self.result = StringIO.StringIO()
        self.reason = None

        SSHChannel.__init__(self, *args, **kwargs)
示例#2
0
    def __init__(self, command, **k):
        SSHChannel.__init__(self, **k)

        self._logger = logging.getLogger(self.__class__.__name__)

        self._databytes = ''
        self._extbytes = ''
        self.command = command
        self.reason = None
示例#3
0
文件: session.py 项目: emil2k/joltem
    def loseConnection(self):
        """ Overridden to fix possible bug.

        Described here : http://twistedmatrix.com/trac/ticket/2754

        """
        close_old_connections()
        if self.client and self.client.transport:
            self.client.transport.loseConnection()
        SSHChannel.loseConnection(self)
示例#4
0
    def __init__(self, log, command, timeout, *args, **kwargs):
        """
        :param timeout: command timeout in seconds.  0 for no timeout
        """
        self.log = log
        self.command = command
        self.finished = Deferred()
        self.result = StringIO.StringIO()
        self.reason = None
        self.timeout = timeout

        SSHChannel.__init__(self, *args, **kwargs)
示例#5
0
文件: ssh.py 项目: reddit/rollingpin
    def __init__(self, log, command, timeout, *args, **kwargs):
        """
        :param timeout: command timeout in seconds.  0 for no timeout
        """
        self.log = log
        self.command = command
        self.finished = Deferred()
        self.result = StringIO.StringIO()
        self.reason = None
        self.timeout = timeout

        SSHChannel.__init__(self, *args, **kwargs)
示例#6
0
 def __init__(self, creator, command, protocolFactory, commandConnected, incremental,
         with_errors, prompt_pattern, timeout, command_interval):
     SSHChannel.__init__(self)
     self._creator = creator
     self._protocolFactory = protocolFactory
     self._command = command
     self._commandConnected = commandConnected
     self.incremental = incremental
     self.with_errors = with_errors
     self.prompt = prompt_pattern
     self.timeout = timeout
     self.command_interval = command_interval
     self._reason = None
示例#7
0
 def __init__(self, creator, command, protocolFactory, commandConnected,
              incremental, with_errors, prompt_pattern, timeout,
              command_interval):
     SSHChannel.__init__(self)
     self._creator = creator
     self._protocolFactory = protocolFactory
     self._command = command
     self._commandConnected = commandConnected
     self.incremental = incremental
     self.with_errors = with_errors
     self.prompt = prompt_pattern
     self.timeout = timeout
     self.command_interval = command_interval
     self._reason = None
示例#8
0
    def __init__(self, creator, protocolFactory, shellConnected):
        """
        @param creator: The L{ICowrieSSHConnectionCreator} provider which was used
            to get the connection which this channel exists on.
        @type creator: L{ICowrieSSHConnectionCreator} provider

        @param protocolFactory: A client factory to use to build a L{IProtocol}
            provider to use to associate with the shell

        @param shellConnected: A L{Deferred} to use to signal that opening the
            shell has failed or that it has succeeded and the shell is open.
        @type shellConnected: L{Deferred}
        """
        SSHChannel.__init__(self)
        self._creator = creator
        self._protocolFactory = protocolFactory
        self._shellConnected = shellConnected
        self._reason = None
示例#9
0
    def __init__(self, creator, protocolFactory, shellConnected):
        """
        @param creator: The L{ICowrieSSHConnectionCreator} provider which was used
            to get the connection which this channel exists on.
        @type creator: L{ICowrieSSHConnectionCreator} provider

        @param protocolFactory: A client factory to use to build a L{IProtocol}
            provider to use to associate with the shell

        @param shellConnected: A L{Deferred} to use to signal that opening the
            shell has failed or that it has succeeded and the shell is open.
        @type shellConnected: L{Deferred}
        """
        SSHChannel.__init__(self)
        self._creator = creator
        self._protocolFactory = protocolFactory
        self._shellConnected = shellConnected
        self._reason = None
示例#10
0
    def __init__(self, creator, command, protocolFactory, commandConnected):
        """
        @param creator: The L{_ISSHConnectionCreator} provider which was used
            to get the connection which this channel exists on.
        @type creator: L{_ISSHConnectionCreator} provider

        @param command: The command to be executed.
        @type command: L{bytes}

        @param protocolFactory: A client factory to use to build a L{IProtocol}
            provider to use to associate with the running command.

        @param commandConnected: A L{Deferred} to use to signal that execution
            of the command has failed or that it has succeeded and the command
            is now running.
        @type commandConnected: L{Deferred}
        """
        SSHChannel.__init__(self)
        self._creator = creator
        self._command = command
        self._protocolFactory = protocolFactory
        self._commandConnected = commandConnected
        self._reason = None
示例#11
0
文件: endpoints.py 项目: 0004c/VTK
    def __init__(self, creator, command, protocolFactory, commandConnected):
        """
        @param creator: The L{_ISSHConnectionCreator} provider which was used
            to get the connection which this channel exists on.
        @type creator: L{_ISSHConnectionCreator} provider

        @param command: The command to be executed.
        @type command: L{bytes}

        @param protocolFactory: A client factory to use to build a L{IProtocol}
            provider to use to associate with the running command.

        @param commandConnected: A L{Deferred} to use to signal that execution
            of the command has failed or that it has succeeded and the command
            is now running.
        @type commandConnected: L{Deferred}
        """
        SSHChannel.__init__(self)
        self._creator = creator
        self._command = command
        self._protocolFactory = protocolFactory
        self._commandConnected = commandConnected
        self._reason = None
示例#12
0
 def __init__(self, env, usePTY, *args, **kwargs):
     SSHChannel.__init__(self, *args, **kwargs)
     self.env = env
     self.usePTY = usePTY
示例#13
0
文件: ssh.py 项目: veloutin/tilde
 def __init__(self, command, protocol):
     SSHChannel.__init__(self)
     if isinstance(command, unicode):
         command = command.encode('utf-8')
     self._command = command
     self._protocol = protocol
示例#14
0
 def __init__(self, command, protocolFactory, commandConnected):
     SSHChannel.__init__(self)
     self._command = command
     self._protocolFactory = protocolFactory
     self._commandConnected = commandConnected
示例#15
0
文件: ssh.py 项目: veloutin/tilde
 def __init__(self, command, protocol):
     SSHChannel.__init__(self)
     if isinstance(command, unicode):
         command = command.encode('utf-8')
     self._command = command
     self._protocol = protocol
示例#16
0
 def __init__(self, command, **k):
     SSHChannel.__init__(self, **k)
     self._databytes = ''
     self._extbytes = ''
     self.command = command
     self.reason = None
示例#17
0
 def __init__(self, command, env={}, **k):
     SSHChannel.__init__(self, **k)
     self.command = command
     self.env = env
     self.reason = None
示例#18
0
文件: ssh.py 项目: veloutin/tilde
 def extReceived(self, type, data):
     if type == EXTENDED_DATA_STDERR:
         self._protocol.errReceived(data)
     else:
         SSHChannel.extReceived(self, type, data)
示例#19
0
文件: sshclient.py 项目: vladum/gumby
 def __init__(self, command, **k):
     SSHChannel.__init__(self, **k)
     self.command = command
     self.reason = None
示例#20
0
 def closed(self):
     SSHChannel.closed(self)
     self._protocol.connectionLost(Failure(ConnectionDone("ssh channel closed")))
     # must close the transport otherwise connections stay open. \o/
     # this wasn't in the example conch code, lsof -p to the rescue.
     self.conn.transport.loseConnection()
示例#21
0
 def __init__(self, env, usePTY, *args, **kwargs):
     SSHChannel.__init__(self, *args, **kwargs)
     self.env = env
     self.usePTY = usePTY
示例#22
0
    def __init__(self, *args, **kwargs):
        SSHChannel.__init__(self, *args, **kwargs)

        self.proxy = Proxy()
        attach_protocol_to_channel(self.proxy, self)
示例#23
0
文件: ssh.py 项目: veloutin/tilde
 def extReceived(self, type, data):
     if type == EXTENDED_DATA_STDERR:
         self._protocol.errReceived(data)
     else:
         SSHChannel.extReceived(self, type, data)
示例#24
0
 def __init__(self, command, protocolFactory, commandConnected):
     SSHChannel.__init__(self)
     self._command = command
     self._protocolFactory = protocolFactory
     self._commandConnected = commandConnected
示例#25
0
文件: ssh.py 项目: ekohl/vncauthproxy
    def __init__(self, *args, **kwargs):
        SSHChannel.__init__(self, *args, **kwargs)

        self.proxy = Proxy()
        attach_protocol_to_channel(self.proxy, self)