Go to the latest version of this document.

# ``twisted`.`conch`.`scripts`.`cftp`.`StdioClient``

class documentation

`class StdioClient(basic.LineReceiver): (source)`

Constructor: `StdioClient(client, f)`

View In Hierarchy

Undocumented

Method | `__init__` | Undocumented
Method | `cmd_CD` | Undocumented
Method | `cmd_CHGRP` | Undocumented
Method | `cmd_CHMOD` | Undocumented
Method | `cmd_CHOWN` | Undocumented
Method | `cmd_EXEC` | Run `rest` using the user's shell (or /bin/sh if they do not have one).
Method | `cmd_EXIT` | Undocumented
Method | `cmd_GET` | Undocumented
Method | `cmd_HELP` | Undocumented
Method | `cmd_LCD` | Undocumented
Method | `cmd_LLS` | Undocumented
Method | `cmd_LMKDIR` | Undocumented
Method | `cmd_LN` | Undocumented
Method | `cmd_LPWD` | Undocumented
Method | `cmd_LS` | Undocumented
Method | `cmd_MKDIR` | Undocumented
Method | `cmd_PROGRESS` | Undocumented
Method | `cmd_PUT` | Do an upload request for a single local file or a globing expression.
Method | `cmd_PWD` | Undocumented
Method | `cmd_RENAME` | Undocumented
Method | `cmd_RM` | Undocumented
Method | `cmd_RMDIR` | Undocumented
Method | `cmd_VERSION` | Undocumented
Method | `connectionMade` | Called when a connection is made.
Method | `lineReceived` | Override this for when each line is received.
Class Variable | `delimiter` | Undocumented
Class Variable | `ps` | Undocumented
Instance Variable | `client` | Undocumented
Instance Variable | `currentDirectory` | Undocumented
Instance Variable | `file` | Undocumented
Instance Variable | `ignoreErrors` | Undocumented
Instance Variable | `useProgressBar` | Undocumented
Method | `_abbrevSize` | Undocumented
Method | `_abbrevTime` | Undocumented
Method | `_cbCd` | Undocumented
Method | `_cbCommand` | Undocumented
Method | `_cbCurDir` | Undocumented
Method | `_cbDisplayFiles` | Undocumented
Method | `_cbGetDone` | Undocumented
Method | `_cbGetFileSize` | Undocumented
Method | `_cbGetMultiple` | Undocumented
Method | `_cbGetMultipleNext` | Undocumented
Method | `_cbGetOpenFile` | Undocumented
Method | `_cbGetRead` | Undocumented
Method | `_cbOpenList` | Undocumented
Method | `_cbPutDone` | Undocumented
Method | `_cbPutMultipleNext` | Perform an upload for the next file in the list of local files.
Method | `_cbPutOpenFile` | Undocumented
Method | `_cbPutWrite` | Undocumented
Method | `_cbReadFile` | Undocumented
Method | `_cbSetCurDir` | Undocumented
Method | `_cbSetUsrGrp` | Undocumented
Method | `_dispatchCommand` | Undocumented
Method | `_ebCloseLf` | Undocumented
Method | `_ebCommand` | Undocumented
Method | `_ebNotADirectory` | Undocumented
Method | `_getFilename` | Parse line received as command line input and return first filename together with the remaining line.
Method | `_getNextChunk` | Undocumented
Method | `_newLine` | Undocumented
Method | `_printFailure` | Undocumented
Method | `_printProgressBar` | Update a console progress bar on this `StdioClient`'s transport, based on the difference between the start time of the operation and the current time according to the reactor, and appropriate to the size of the console window.
Method | `_putMultipleFiles` | Perform an upload for a list of local files.
Method | `_putRemoteFile` | Do an upload request.
Method | `_putSingleFile` | Perform an upload for a single file.
Method | `_remoteGlob` | Undocumented
Method | `_writeToTransport` | Undocumented

Inherited from `LineReceiver`:

Method | `clearLineBuffer` | Clear buffered data.
Method | `dataReceived` | Protocol.dataReceived. Translates bytes into lines, and calls lineReceived (or rawDataReceived, depending on mode.)
Method | `lineLengthExceeded` | Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.
Method | `rawDataReceived` | Override this for when raw data is received.
Method | `sendLine` | Sends a line to the other end of the connection.
Method | `setLineMode` | Sets the line-mode of this receiver.
Method | `setRawMode` | Sets the raw mode of this receiver. Further data received will be sent to rawDataReceived rather than lineReceived.
Constant | `MAX_LENGTH` | The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped). Default is 16384.
Instance Variable | `line_mode` | Undocumented
Instance Variable | `_buffer` | Undocumented
Instance Variable | `_busyReceiving` | Undocumented

Inherited from `Protocol` (via `LineReceiver`):

Method | `connectionLost` | Called when the connection is shut down.
Method | `logPrefix` | Return a prefix matching the class name, to identify log messages related to this protocol instance.
Class Variable | `factory` | Undocumented

Inherited from `BaseProtocol` (via `LineReceiver`, `Protocol`):

Method | `makeConnection` | Make a connection to a transport and a server.
Instance Variable | `connected` | Undocumented
Instance Variable | `transport` | Undocumented

Inherited from `_PauseableMixin` (via `LineReceiver`, `Protocol`, `BaseProtocol`):

Method | `pauseProducing` | Undocumented
Method | `resumeProducing` | Undocumented
Method | `stopProducing` | Undocumented
Instance Variable | `paused` | Undocumented

def __init__(self, client, f=None): (source)

Undocumented

def cmd_CD(self, path): (source)

Undocumented

def cmd_CHGRP(self, rest): (source)

Undocumented

def cmd_CHMOD(self, rest): (source)

Undocumented

def cmd_CHOWN(self, rest): (source)

Undocumented

def cmd_EXEC(self, rest): (source)

Run `rest` using the user's shell (or /bin/sh if they do not have one).

def cmd_EXIT(self, ignored): (source)

Undocumented

def cmd_GET(self, rest): (source)

Undocumented

def cmd_HELP(self, ignored): (source)

Undocumented

def cmd_LCD(self, path): (source)

Undocumented

def cmd_LLS(self, rest): (source)

Undocumented

def cmd_LMKDIR(self, path): (source)

Undocumented

def cmd_LN(self, rest): (source)

Undocumented

def cmd_LPWD(self, ignored): (source)

Undocumented

def cmd_LS(self, rest): (source)

Undocumented

def cmd_MKDIR(self, path): (source)

Undocumented

def cmd_PROGRESS(self, ignored): (source)

Undocumented

def cmd_PUT(self, rest): (source)

Do an upload request for a single local file or a globing expression.

Parameters
rest:`str` | Requested command line for the PUT command.

Returns
`defer.Deferred` | A deferred which fires with `None` when transfer is done.

def cmd_PWD(self, ignored): (source)

Undocumented

def cmd_RENAME(self, rest): (source)

Undocumented

def cmd_RM(self, path): (source)

Undocumented

def cmd_RMDIR(self, path): (source)

Undocumented

def cmd_VERSION(self, ignored): (source)

Undocumented

def connectionMade(self): (source)
from `twisted.internet.interfaces.IProtocol`
overrides `twisted.internet.protocol.BaseProtocol.connectionMade`

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.

def lineReceived(self, line): (source)
overrides `twisted.protocols.basic.LineReceiver.lineReceived`

Override this for when each line is received.

Parameters
line:`bytes` | The line which was received with the delimiter removed.

delimiter: `bytes` = (source)
overrides `twisted.protocols.basic.LineReceiver.delimiter`

Undocumented

ps: `str` = (source)

Undocumented

client = (source)

Undocumented

currentDirectory = (source)

Undocumented

file = (source)

Undocumented

ignoreErrors: `int` = (source)

Undocumented

useProgressBar = (source)

Undocumented

def _abbrevSize(self, size): (source)

Undocumented

def _abbrevTime(self, t): (source)

Undocumented

def _cbCd(self, directory): (source)

Undocumented

def _cbCommand(self, result): (source)

Undocumented

def _cbCurDir(self, path): (source)

Undocumented

def _cbDisplayFiles(self, files, options): (source)

Undocumented

def _cbGetDone(self, ignored, rf, lf): (source)

Undocumented

def _cbGetFileSize(self, attrs, rf, lf): (source)

Undocumented

def _cbGetMultiple(self, files, local): (source)

Undocumented

def _cbGetMultipleNext(self, res, files, local): (source)

Undocumented

def _cbGetOpenFile(self, rf, lf): (source)

Undocumented

def _cbGetRead(self, data, rf, lf, chunks, start, size, startTime): (source)

Undocumented

def _cbOpenList(self, directory, glob): (source)

Undocumented

def _cbPutDone(self, ignored, rf, lf): (source)

Undocumented

def _cbPutMultipleNext(self, previousResult, files, remotePath, single=False): (source)

Perform an upload for the next file in the list of local files.

Parameters
previousResult:`str` | Result form previous file form the list.
files:`list` of `str` | List of local files.
remotePath:`str` | Remote path for the request relative to current working directory.
single:`bool` | A flag which signals if this is a transfer for a single file in which case we use the exact remote path

Returns
A deferred which fires when transfer is done.

def _cbPutOpenFile(self, rf, lf): (source)

Undocumented

def _cbPutWrite(self, ignored, rf, lf, chunks, startTime): (source)

Undocumented

def _cbReadFile(self, files, matchedFiles, directory, glob): (source)

Undocumented

def _cbSetCurDir(self, path): (source)

Undocumented

def _cbSetUsrGrp(self, attrs, path, usr=None, grp=None): (source)

Undocumented

def _dispatchCommand(self, line): (source)

Undocumented

def _ebCloseLf(self, f, lf): (source)

Undocumented

def _ebCommand(self, f): (source)

Undocumented

def _ebNotADirectory(self, reason, path, glob): (source)

Undocumented

def _getFilename(self, line): (source)

Parse line received as command line input and return first filename together with the remaining line.

Parameters
line:`str` | Arguments received from command line input.

Returns
`tupple` | Tupple with filename and rest. Return empty values when no path was not found.

def _getNextChunk(self, chunks): (source)

Undocumented

def _newLine(self): (source)

Undocumented

def _printFailure(self, f): (source)

Undocumented

def _printProgressBar(self, f, startTime): (source)

Update a console progress bar on this `StdioClient`'s transport, based on the difference between the start time of the operation and the current time according to the reactor, and appropriate to the size of the console window.

Parameters
f:`FileWrapper` | a wrapper around the file which is being written or read
startTime:`float` | The time at which the operation being tracked began.

def _putMultipleFiles(self, files, remote): (source)

Perform an upload for a list of local files.

Parameters
files:`list` of `str`. | List of local files.
remote:`str` | Remote path for the request relative to current working directory.

Returns
A deferred which fires when transfer is done.

def _putRemoteFile(self, localStream, remotePath): (source)

Do an upload request.

Parameters
localStream:File like object. | Local stream from where data is read.
remotePath:`str` | Remote path for the request relative to current working directory.

Returns
A deferred which fires when transfer is done.

def _putSingleFile(self, local, remote): (source)

Perform an upload for a single file.

Parameters
local:`str`. | Path to local file.
remote:`str` | Remote path for the request relative to current working directory.

Returns
A deferred which fires when transfer is done.

def _remoteGlob(self, fullPath): (source)

Undocumented

def _writeToTransport(self, msg): (source)

Undocumented