Mercurial > repos > guerler > springsuite
comparison planemo/lib/python3.7/site-packages/yaml/nodes.py @ 1:56ad4e20f292 draft
"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
author | guerler |
---|---|
date | Fri, 31 Jul 2020 00:32:28 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:d30785e31577 | 1:56ad4e20f292 |
---|---|
1 | |
2 class Node(object): | |
3 def __init__(self, tag, value, start_mark, end_mark): | |
4 self.tag = tag | |
5 self.value = value | |
6 self.start_mark = start_mark | |
7 self.end_mark = end_mark | |
8 def __repr__(self): | |
9 value = self.value | |
10 #if isinstance(value, list): | |
11 # if len(value) == 0: | |
12 # value = '<empty>' | |
13 # elif len(value) == 1: | |
14 # value = '<1 item>' | |
15 # else: | |
16 # value = '<%d items>' % len(value) | |
17 #else: | |
18 # if len(value) > 75: | |
19 # value = repr(value[:70]+u' ... ') | |
20 # else: | |
21 # value = repr(value) | |
22 value = repr(value) | |
23 return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value) | |
24 | |
25 class ScalarNode(Node): | |
26 id = 'scalar' | |
27 def __init__(self, tag, value, | |
28 start_mark=None, end_mark=None, style=None): | |
29 self.tag = tag | |
30 self.value = value | |
31 self.start_mark = start_mark | |
32 self.end_mark = end_mark | |
33 self.style = style | |
34 | |
35 class CollectionNode(Node): | |
36 def __init__(self, tag, value, | |
37 start_mark=None, end_mark=None, flow_style=None): | |
38 self.tag = tag | |
39 self.value = value | |
40 self.start_mark = start_mark | |
41 self.end_mark = end_mark | |
42 self.flow_style = flow_style | |
43 | |
44 class SequenceNode(CollectionNode): | |
45 id = 'sequence' | |
46 | |
47 class MappingNode(CollectionNode): | |
48 id = 'mapping' | |
49 |