mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-10-30 01:32:21 +00:00
To make sure that I get everything right, I built this code for initializing the equipment library around the already existing JSON IO loader. That is far from optimal because there is no type safety whatsoever in these classes, and object properties are created in a super ad-hoc manner at runtime. That is rather painful to work with because there is no place anywhere in the code which would list all properties that are *supposed* to be present. Change-Id: Ibbfd97a5a949cf107fd98484b19b24bf9f4ca3e9
26 lines
627 B
Python
26 lines
627 B
Python
# SPDX-License-Identifier: BSD-3-Clause
|
|
#
|
|
# Copyright (C) 2020 Telecom Infra Project and GNPy contributors
|
|
# see LICENSE.md for a list of contributors
|
|
|
|
'''
|
|
Working with YANG-encoded data
|
|
'''
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
def model_path() -> Path:
|
|
'''Filesystem path to TIP's own YANG models'''
|
|
return Path(__file__).parent / 'tip'
|
|
|
|
|
|
def external_path() -> Path:
|
|
'''Filesystem path to third-party YANG models that are shipped with GNPy'''
|
|
return Path(__file__).parent / 'ext'
|
|
|
|
|
|
def _yang_library() -> Path:
|
|
'''Filesystem path the the ietf-yanglib JSON file'''
|
|
return Path(__file__).parent / 'yanglib.json'
|