The Cellframe module is designed to work with CellFrame Node. This module includes the following classes:
CellFrame.AppCliA class represents a client application.
CellFrame.AppCliServerA class represents a server of a client application.
This class provides methods for working with a client application.
CellFrame.AppCli.main(appName: str, socketPath: str, args: List[str]) -> int
This method is not supported in plugins.
Launches a client application with the
appName name, which sends the command specified in the
args argument to the socket, the path to which is specified in the
socketPath variable. The list of standard commands is given on the node_commands.
Returns: 0 if successful, otherwise a error code.
This class provides methods for working with a server of a client application.
CellFrame.AppCliServer.cmdItemCreate(name: str, callBackFunc: callable, doc: str, docEx: str) -> int
Creates a new command. The
name is a command name. The
callBackFunc function must have the
f(argList: List[str], idStrReply: int) -> int signature. The
doc is documentation string, which will be output when the help command is called. The
docEx is a full documentation, which will be output when the help <command> is called. Returns
0 if successful.
CellFrame.AppCliServer.setReplyText(replyText: str, idStrReply: int) -> int
Sets a reply text. The
replyText is a string that will be returned when a command is called. The
idStrReply must be a parameter
idStrReply passed to the callback function. Returns
0 if successful.
CellFrame.AppCliServer.getByAlias(net: CellFrame.Network.Net, alias: str) -> CellFrame.Network.NodeAddr
Gets a node address by alias. Returns the
NodeAddr object if successful.