The Cellframe module is designed to work with CellFrame Node. This module includes the following classes:
CellFrame.AppCli
A class represents a client application.CellFrame.AppCliServer
A class represents a server of a client application.class CellFrame.AppCli
This class provides methods for working with a client application.
staic method 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.
class CellFrame.AppCliServer
This class provides methods for working with a server of a client application.
static method 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.
static method 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.
static method CellFrame.AppCliServer.getByAlias(net: CellFrame.Network.Net, alias: str) -> CellFrame.Network.NodeAddr
Gets a node address by alias. Returns the NodeAddr
object if successful.