rcon package¶
Subpackages¶
- rcon.battleye package
- rcon.source package
Submodules¶
rcon.client module¶
Common base client.
- class rcon.client.BaseClient(host: str, port: int, *, timeout: float | None = None, passwd: str | None = None)¶
Bases:
objectA common RCON client.
- close() None¶
Close the socket connection.
- connect(login: bool = False) None¶
Connect the socket and attempt a login if wanted and a password is set.
- login(passwd: str) bool¶
Perform a login.
- run(command: str, *args: str) str¶
Run a command.
- property timeout: float¶
Return the socket timeout.
rcon.config module¶
RCON server configuration.
- class rcon.config.Config(host: str, port: int, passwd: str | None = None)¶
Bases:
NamedTupleRepresents server configuration.
- classmethod from_config_section(section: SectionProxy) Config¶
Create a credentials tuple from the respective config section.
- host: str¶
Alias for field number 0
- passwd: str | None¶
Alias for field number 2
- port: int¶
Alias for field number 1
rcon.console module¶
An interactive console.
- rcon.console.rconcmd(client_cls: Type[BaseClient], host: str, port: int, passwd: str, *, timeout: float | None = None, prompt: str = 'RCON {host}:{port}> ')¶
Initialize the console.
rcon.errorhandler module¶
Common errors handler.
rcon.exceptions module¶
Common exceptions.
- exception rcon.exceptions.ConfigReadError¶
Bases:
ExceptionIndicates an error while reading the configuration.
- exception rcon.exceptions.EmptyResponse¶
Bases:
ExceptionIndicates an empty response from the server.
- exception rcon.exceptions.SessionTimeout¶
Bases:
ExceptionIndicates that the session timed out.
- exception rcon.exceptions.UserAbort¶
Bases:
ExceptionIndicates that a required action has been aborted by the user.
- exception rcon.exceptions.WrongPassword¶
Bases:
ExceptionIndicates a wrong password.
rcon.gui module¶
GTK based GUI.
- rcon.gui.main() None¶
Start the GUI.
rcon.rconclt module¶
RCON client CLI.
- rcon.rconclt.main() int¶
Run the main script with exceptions handled.
rcon.rconshell module¶
An interactive RCON shell.
- rcon.rconshell.get_args() Namespace¶
Parse and returns the CLI arguments.
- rcon.rconshell.main() int¶
Run the main script with exceptions handled.
rcon.readline module¶
Wrapper for readline support.
- class rcon.readline.CommandHistory(logger: Logger, file: Path = PosixPath('/sbuild-nonexistent/.rconshell_history'))¶
Bases:
objectContext manager for the command line history.
Module contents¶
RCON client library.
- class rcon.Client(*args, **kwargs)¶
Bases:
ClientWrapper for the rcon.source.Client for backwards compatibility.
- exception rcon.EmptyResponse¶
Bases:
ExceptionIndicates an empty response from the server.
- exception rcon.SessionTimeout¶
Bases:
ExceptionIndicates that the session timed out.
- exception rcon.WrongPassword¶
Bases:
ExceptionIndicates a wrong password.
- rcon.rcon(*args, **kwargs) Coroutine[Any, Any, str]¶
Wrapper for rcon.source.rcon() for backwards compatibility.