Update project description and enhance documentation for clarity
- Revised the project description in `pyproject.toml` to better reflect the functionality of the `oxipy` client. - Improved the README.md by adding detailed explanations of the project structure, installation instructions, and usage examples. - Updated documentation files to enhance clarity and organization, including sections on extending models and writing TTP templates. - Adjusted various TTP templates to ensure consistency and accuracy in the parsing of device configurations.
This commit is contained in:
@@ -6,15 +6,17 @@ class H3C(BaseDevice):
|
||||
template = "h3c.ttp"
|
||||
|
||||
def vlans(self) -> list[dict]:
|
||||
vlan_list = self.raw["vlans"]
|
||||
vlans = []
|
||||
vlan_list = self.raw.get("vlans", [])
|
||||
vlans: list[dict] = []
|
||||
for item in vlan_list:
|
||||
if item.get("vlans_id"):
|
||||
vlans.extend([{'vlan_id': vln }for vln in item.get("vlans_id")])
|
||||
else:
|
||||
vlan_ids = item.get("vlans_id")
|
||||
if not vlan_ids:
|
||||
vlans.append(item)
|
||||
continue
|
||||
vlans.extend({"vlan_id": vlan_id} for vlan_id in vlan_ids)
|
||||
return vlans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
with open("./test5.txt") as file:
|
||||
data = file.read()
|
||||
|
||||
Reference in New Issue
Block a user