Enhance device interface structure and update dependencies
- Added `.idea` to `.gitignore` to exclude IDE configuration files. - Introduced `pydantic` version `2.12.5` as a dependency in `pyproject.toml` and `uv.lock`. - Added `annotated-types` as a new dependency in `uv.lock`. - Refactored `BaseDevice` class to include abstract methods for device properties and loading templates. - Created `Interfaces`, `System`, `Vlans`, and `Device` models in a new `contract.py` file for structured data handling. - Updated `Mikrotik` class to implement the new `BaseDevice` structure and added a template loading method.
This commit is contained in:
@@ -3,4 +3,11 @@ from oxi.interfaces.base import BaseDevice
|
||||
|
||||
|
||||
@register_parser(["routeros", "ros", "mikrotik"])
|
||||
class Mikrotik(BaseDevice): ...
|
||||
class Mikrotik(BaseDevice):
|
||||
template = "mikrotik.ttp"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
mikr = Mikrotik()
|
||||
mikr.run()
|
||||
print(mikr.load)
|
||||
|
||||
Reference in New Issue
Block a user