BW3-Core/boswatch/router/route.py

37 lines
1.2 KiB
Python
Raw Permalink Normal View History

#!/usr/bin/python
# -*- coding: utf-8 -*-
r"""!
____ ____ ______ __ __ __ _____
/ __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
/ __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
/ /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / / ___/ /
/_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ /____/
German BOS Information Script
by Bastian Schroll
@file: route.py
@date: 04.03.2019
@author: Bastian Schroll
@description: Class for a single BOSWatch packet router route point
"""
2019-10-25 18:40:25 +02:00
import logging
logging.debug("- %s loaded", __name__)
class Route:
r"""!Class for single routing points"""
2019-10-25 15:36:10 +02:00
def __init__(self, name, callback, statsCallback=None, cleanupCallback=None):
r"""!Create a instance of an route point
2019-03-04 20:10:49 +01:00
@param name: name of the route point
@param callback: instance of the callback function
2019-10-25 13:29:26 +02:00
@param statsCallback: instance of the callback to get statistics (None)
2019-10-25 15:36:10 +02:00
@param cleanupCallback: instance of the callback to run a cleanup method (None)
2019-03-04 20:10:49 +01:00
"""
2019-10-25 13:43:50 +02:00
self.name = name
self.callback = callback
self.statistics = statsCallback
2019-10-25 15:36:10 +02:00
self.cleanup = cleanupCallback