From 3b7847a5153cafd7273c32cdbef474bb0d9c6205 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sat, 26 Oct 2019 18:35:31 +0200 Subject: [PATCH] add some documentation --- boswatch/wildcard.py | 11 ++++++++++- docu/docs/modul/regex_filter.md | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/boswatch/wildcard.py b/boswatch/wildcard.py index bedaac6..71d1c42 100644 --- a/boswatch/wildcard.py +++ b/boswatch/wildcard.py @@ -19,12 +19,16 @@ import time logging.debug("- %s loaded", __name__) -# todo check function and document + write an test +# todo check function - write an test _additionalWildcards = {} def registerWildcard(wildcard, bwPacketField): + """!Register a new additional wildcard + + @param wildcard: New wildcard string with format: '{WILDCARD}' + @param bwPacketField: Field of the bwPacket which is used for wildcard replacement""" if wildcard in _additionalWildcards: logging.error("wildcard always registered: %s", wildcard) return @@ -33,6 +37,11 @@ def registerWildcard(wildcard, bwPacketField): def replaceWildcards(message, bwPacket): + """!Replace the wildcards in a given message + + @param message: Message in which wildcards should be replaced + @param bwPacket: bwPacket instance with the replacement information + @return Input message with the replaced wildcards""" _wildcards = { # formatting wildcards # todo check if br and par are needed - if not also change config diff --git a/docu/docs/modul/regex_filter.md b/docu/docs/modul/regex_filter.md index 8b19aba..172901f 100644 --- a/docu/docs/modul/regex_filter.md +++ b/docu/docs/modul/regex_filter.md @@ -13,6 +13,8 @@ Folgendes gilt: - Sobald ein Filter mit all seinen Checks besteht, wird mit der Ausführung des Routers fortgefahren - Sollten alle Filter fehlschlagen wird die Ausführung des Routers beendet +Vereinfacht kann man sagen, dass einzelnen Router ODER-verknüpft und die jeweiligen Checks UND-verknüpft sind. + ## Resource `filter.regexFilter`