kagtcprlib.handlers¶
Module handlers contains some example handlers which might be added to Client instances.
Classes
BaseHandler |
Abstract base class for handlers. |
RotatingFileLoggingHandler(log_directory, …) |
A handler which logs all the lines received to a file. |
-
class
kagtcprlib.handlers.BaseHandler[source]¶ Bases:
abc.ABCAbstract base class for handlers. Handlers are added to `Client`s and respond to lines of text received from KAG.
-
class
kagtcprlib.handlers.PlayerCountHandler[source]¶ Bases:
kagtcprlib.handlers.BaseHandlerKeeps a count of the number of players on a server by looking for lines like: Joan of Arc (Eluded) is now spectating Joan of Arc (Eluded) has joined Red Team Player Eluded left the game (players left 0)
-
class
kagtcprlib.handlers.RotatingFileLoggingHandler(log_directory, file_name)[source]¶ Bases:
kagtcprlib.handlers.BaseHandlerA handler which logs all the lines received to a file. Uses RotatingFileHandler internally.
Parameters: - log_directory (str) – Path to the directory to place log files in
- file_name (str) – The name of the log file