Beispiel #1
0
 def _pretty(self, l, indent, increment):
     pre_indent = indent
     indent += increment
     l.append('struct {')
     for i, (f, t) in enumerate(self.items()):
         if i > 0:
             l.append(', ')
         l.append('\n')
         l.append(' ' * indent)
         l.append('{}: '.format(escape_parsable(f)))
         t._pretty(l, indent, increment)
     l.append('\n')
     l.append(' ' * pre_indent)
     l.append('}')
Beispiel #2
0
 def _pretty(self, l, indent, increment):
     pre_indent = indent
     indent += increment
     l.append('struct {')
     for i, (f, t) in enumerate(self.items()):
         if i > 0:
             l.append(', ')
         l.append('\n')
         l.append(' ' * indent)
         l.append('{}: '.format(escape_parsable(f)))
         t._pretty(l, indent, increment)
     l.append('\n')
     l.append(' ' * pre_indent)
     l.append('}')
Beispiel #3
0
    def _pretty(self, l, indent, increment):
        if not self._cases:
            l.append('union {}')
            return

        pre_indent = indent
        indent += increment
        l.append('union {')
        for i, (f, t) in enumerate(self.items()):
            if i > 0:
                l.append(', ')
            l.append('\n')
            l.append(' ' * indent)
            l.append('{}: '.format(escape_parsable(f)))
            t._pretty(l, indent, increment)
        l.append('\n')
        l.append(' ' * pre_indent)
        l.append('}')
Beispiel #4
0
    def _pretty(self, b, indent, increment):
        if not self._fields:
            b.append('struct {}')
            return

        pre_indent = indent
        indent += increment
        b.append('struct {')
        for i, (f, t) in enumerate(self.items()):
            if i > 0:
                b.append(', ')
            b.append('\n')
            b.append(' ' * indent)
            b.append('{}: '.format(escape_parsable(f)))
            t._pretty(b, indent, increment)
        b.append('\n')
        b.append(' ' * pre_indent)
        b.append('}')
Beispiel #5
0
 def _parsable_string(self):
     return "Struct{{{}}}".format(
         ','.join('{}:{}'.format(escape_parsable(f), t._parsable_string()) for f, t in self.items()))
Beispiel #6
0
 def __str__(self):
     return "struct{{{}}}".format(
         ', '.join('{}: {}'.format(escape_parsable(f), str(t)) for f, t in self.items()))
Beispiel #7
0
 def _pretty(self, l, indent, increment):
     l.append('locus<{}>'.format(escape_parsable(self.reference_genome.name)))
Beispiel #8
0
 def _parsable_string(self):
     return "Locus({})".format(escape_parsable(str(self.reference_genome)))
Beispiel #9
0
 def __str__(self):
     return "locus<{}>".format(escape_parsable(str(self.reference_genome)))
Beispiel #10
0
 def _pretty(self, l, indent, increment):
     l.append('locus<{}>'.format(escape_parsable(self.reference_genome.name)))
Beispiel #11
0
 def _parsable_string(self):
     return "Locus({})".format(escape_parsable(str(self.reference_genome)))
Beispiel #12
0
 def __str__(self):
     return "locus<{}>".format(escape_parsable(str(self.reference_genome)))
Beispiel #13
0
 def _parsable_string(self):
     return "Union{{{}}}".format(
         ','.join('{}:{}'.format(escape_parsable(f), t._parsable_string()) for f, t in self.items()))
Beispiel #14
0
 def __str__(self):
     return "union{{{}}}".format(
         ', '.join('{}: {}'.format(escape_parsable(f), str(t)) for f, t in self.items()))
Beispiel #15
0
 def _key_str(self):
     return ', '.join([escape_parsable(k) for k in self.row_key])