forked from mbj4668/pyang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
99 lines (69 loc) · 2.37 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Install
-------
In this directory run:
python setup.py install
(this might require root access)
To install in a different location, run:
python setup.py install --prefix=/usr/local
If you do this, it is recommended to set the environment variable
YANG_INSTALL to the prefix directory. This ensures that pyang will
find standard YANG modules. In addition, make sure that PYTHONPATH is set
to something as follows:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
or whatever version of python you are running.
Run locally without installing
------------------------------
export PATH=`pwd`/bin:$PATH
export MANPATH=`pwd`/man:$MANPATH
export PYTHONPATH=`pwd`:$PYTHONPATH
export YANG_MODPATH=`pwd`/modules:$YANG_MODPATH
export PYANG_XSLT_DIR=`pwd`/xslt
export PYANG_RNG_LIBDIR=`pwd`/schema
or:
source ./env.sh
Usage
-----
pyang -h
man pyang
Code structure
--------------
bin/
Executable scripts.
pyang/
Contains the pyang library code.
pyang/__init__.py
Initialization code for the pyang library.
Defines the Context and Repository classes.
pyang/syntax.py
Generic syntax checking for YANG and YIN statements.
Defines regular expressions for argument checking of core
statements.
pyang/grammar.py
Generic grammar for YANG and YIN.
Defines chk_module_statements() which validates a parse tree
according to the grammar.
pyang/statements.py
Defines the generic Statement class and all validation code.
pyang/yang_parser.py
YANG tokenizer and parser.
pyang/yin_parser.py
YIN parser. Uses the expat library for XML parsing.
pyang/types.py
Contains code for checking built-in types.
pyang/plugin.py
Plugin API. Defines the class PyangPlugin which all plugins
inherits from. All output handlers are written as plugins.
pyang/plugins/
Directory where plugins can be installed. All plugins in this
directory are automatically initialized when the library is
initialized.
pyang/translators/
Contains output plugins for YANG, YIN, XSD, and DSDL translation.
xslt
Contains XSLT style sheets for generating RELAX NG, Schematron and
DSRL schemas and validating instance documents. Also included is the
free implementation of ISO Schematron by Rick Jelliffe from
http://www.schematron.com/ (files iso_schematron_skeleton_for_xslt1.xsl,
iso_abstract_expand.xsl and iso_svrl_for_xslt1.xsl).
schema
Contains RELAX NG schemas and pattern libraries.