mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-21 06:03:50 +00:00
add route statisticsCallback
This commit is contained in:
parent
341f05d25a
commit
d40432e5b8
1 changed files with 8 additions and 1 deletions
|
|
@ -18,14 +18,16 @@
|
||||||
|
|
||||||
class Route:
|
class Route:
|
||||||
"""!Class for single routing points"""
|
"""!Class for single routing points"""
|
||||||
def __init__(self, name, callback):
|
def __init__(self, name, callback, statsCallback=None):
|
||||||
"""!Create a instance of an route point
|
"""!Create a instance of an route point
|
||||||
|
|
||||||
@param name: name of the route point
|
@param name: name of the route point
|
||||||
@param callback: instance of the callback function
|
@param callback: instance of the callback function
|
||||||
|
@param statsCallback: instance of the callback to get statistics (None)
|
||||||
"""
|
"""
|
||||||
self._name = name
|
self._name = name
|
||||||
self._callback = callback
|
self._callback = callback
|
||||||
|
self._statsCallback = statsCallback
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
|
@ -36,3 +38,8 @@ class Route:
|
||||||
def callback(self):
|
def callback(self):
|
||||||
"""!Porperty to get the callback function instance"""
|
"""!Porperty to get the callback function instance"""
|
||||||
return self._callback
|
return self._callback
|
||||||
|
|
||||||
|
@property
|
||||||
|
def statistics(self):
|
||||||
|
"""!Porperty to get the statistics from instance"""
|
||||||
|
return self._statsCallback
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue