Files
oopt-gnpy/gnpy/yang/__init__.py
Jan Kundrát 5f38db2d2f YANG: Reading and saving equipment catalog and simulation options from YANG files
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
2021-06-06 12:22:51 +02:00

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'