"""
Implement Keenetic model and enhance BaseDevice documentation - Added a new `Keenetic` model that registers a parser for KeeneticOS, extending the `BaseDevice` class. - Updated docstrings in the `BaseDevice` class methods to provide clearer descriptions of their functionality and expected data structures. - Introduced `model_config` in the `Vlans` model to enable name-based population. - Removed unnecessary print statements from the `Mikrotik` model methods to streamline output. """
This commit is contained in:
@@ -12,11 +12,9 @@ class Mikrotik(BaseDevice):
|
||||
return System(**systems)
|
||||
|
||||
def interfaces(self) -> "Interfaces":
|
||||
print(self._raw.get("interfaces"))
|
||||
return [Interfaces(**item) for item in self._raw.get("interfaces")]
|
||||
|
||||
def vlans(self) -> list["Vlans"]:
|
||||
print(self._raw.get("vlans"))
|
||||
return [Vlans(**item) for item in self._raw.get("vlans")]
|
||||
|
||||
|
||||
@@ -24,5 +22,4 @@ if __name__ == "__main__":
|
||||
with open("../../test.txt") as file:
|
||||
data = file.read()
|
||||
mikr = Mikrotik(data)
|
||||
mikr.parse()
|
||||
print(mikr)
|
||||
print(mikr.parse().json())
|
||||
|
||||
Reference in New Issue
Block a user