FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
netdata/python.d/python_modules/pyyaml2/nodes.py at master · jamesblunt/netdata · GitHub
jamesblunt
/
netdata
Public
forked from
netdata/netdata
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
netdata
/
python.d
/
python_modules
/
pyyaml2
/
nodes.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
49 lines (43 loc) · 1.41 KB
Breadcrumbs
netdata
/
python.d
/
python_modules
/
pyyaml2
/
nodes.py
Copy path
File metadata and controls
49 lines (43 loc) · 1.41 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
class
Node
(
object
):
def
__init__
(
self
,
tag
,
value
,
start_mark
,
end_mark
):
self
.
tag
=
tag
self
.
value
=
value
self
.
start_mark
=
start_mark
self
.
end_mark
=
end_mark
def
__repr__
(
self
):
value
=
self
.
value
#if isinstance(value, list):
# if len(value) == 0:
# value = '<empty>'
# elif len(value) == 1:
# value = '<1 item>'
# else:
# value = '<%d items>' % len(value)
#else:
# if len(value) > 75:
# value = repr(value[:70]+u' ... ')
# else:
# value = repr(value)
value
=
repr
(
value
)
return
'%s(tag=%r, value=%s)'
%
(
self
.
__class__
.
__name__
,
self
.
tag
,
value
)
class
ScalarNode
(
Node
):
id
=
'scalar'
def
__init__
(
self
,
tag
,
value
,
start_mark
=
None
,
end_mark
=
None
,
style
=
None
):
self
.
tag
=
tag
self
.
value
=
value
self
.
start_mark
=
start_mark
self
.
end_mark
=
end_mark
self
.
style
=
style
class
CollectionNode
(
Node
):
def
__init__
(
self
,
tag
,
value
,
start_mark
=
None
,
end_mark
=
None
,
flow_style
=
None
):
self
.
tag
=
tag
self
.
value
=
value
self
.
start_mark
=
start_mark
self
.
end_mark
=
end_mark
self
.
flow_style
=
flow_style
class
SequenceNode
(
CollectionNode
):
id
=
'sequence'
class
MappingNode
(
CollectionNode
):
id
=
'mapping'
Back
|
FazBrowse Home
|
New Git URL