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)
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
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)
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)
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
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
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
def __init__(self, env, usePTY, *args, **kwargs): SSHChannel.__init__(self, *args, **kwargs) self.env = env self.usePTY = usePTY
def __init__(self, command, protocol): SSHChannel.__init__(self) if isinstance(command, unicode): command = command.encode('utf-8') self._command = command self._protocol = protocol
def __init__(self, command, protocolFactory, commandConnected): SSHChannel.__init__(self) self._command = command self._protocolFactory = protocolFactory self._commandConnected = commandConnected
def __init__(self, command, **k): SSHChannel.__init__(self, **k) self._databytes = '' self._extbytes = '' self.command = command self.reason = None
def __init__(self, command, env={}, **k): SSHChannel.__init__(self, **k) self.command = command self.env = env self.reason = None
def extReceived(self, type, data): if type == EXTENDED_DATA_STDERR: self._protocol.errReceived(data) else: SSHChannel.extReceived(self, type, data)
def __init__(self, command, **k): SSHChannel.__init__(self, **k) self.command = command self.reason = None
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()
def __init__(self, *args, **kwargs): SSHChannel.__init__(self, *args, **kwargs) self.proxy = Proxy() attach_protocol_to_channel(self.proxy, self)