1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
"""Main module of {{username}}/{{napp}} Kytos Network Application.
{{ description }}
"""
from kytos.core import KytosNApp, log
from napps.{{username}}.{{napp}} import settings
class Main(KytosNApp):
"""Main class of {{username}}/{{napp}} NApp.
This class is the entry point for this napp.
"""
def setup(self):
"""Replace the '__init__' method for the KytosNApp subclass.
The setup method is automatically called by the controller when your
application is loaded.
So, if you have any setup routine, insert it here.
"""
pass
def execute(self):
"""Run after the setup method execution.
You can also use this method in loop mode if you add to the above setup
method a line like the following example:
self.execute_as_loop(30) # 30-second interval.
"""
pass
def shutdown(self):
"""Run when your napp is unloaded.
If you have some cleanup procedure, insert it here.
"""
pass
|