Enhance Keenetic model and update templates for improved data handling
- Implemented the `interfaces` and `vlans` methods in the `Keenetic` model to process and decode interface and VLAN data. - Added a `_decode_utf` method to handle UTF-8 encoded descriptions. - Updated the Keenetic TTP template to define structured groups for system, interfaces, and VLANs. - Refactored file paths in the `Mikrotik` model for consistency and clarity.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
from oxi.interfaces import register_parser
|
||||
from oxi.interfaces.base import BaseDevice
|
||||
from oxi.interfaces.contract import Interfaces, System, Vlans
|
||||
@@ -19,7 +20,8 @@ class Mikrotik(BaseDevice):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
with open("../../test.txt") as file:
|
||||
print(os.path.abspath(os.curdir))
|
||||
with open("./test.txt") as file:
|
||||
data = file.read()
|
||||
mikr = Mikrotik(data)
|
||||
print(mikr.parse().json())
|
||||
|
||||
Reference in New Issue
Block a user