Esempio n. 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('}')
Esempio n. 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('}')
Esempio n. 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('}')
Esempio n. 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('}')
Esempio n. 5
0
File: types.py Progetto: jigold/hail
 def _parsable_string(self):
     return "Struct{{{}}}".format(
         ','.join('{}:{}'.format(escape_parsable(f), t._parsable_string()) for f, t in self.items()))
Esempio n. 6
0
File: types.py Progetto: jigold/hail
 def __str__(self):
     return "struct{{{}}}".format(
         ', '.join('{}: {}'.format(escape_parsable(f), str(t)) for f, t in self.items()))
Esempio n. 7
0
File: types.py Progetto: jigold/hail
 def _pretty(self, l, indent, increment):
     l.append('locus<{}>'.format(escape_parsable(self.reference_genome.name)))
Esempio n. 8
0
File: types.py Progetto: jigold/hail
 def _parsable_string(self):
     return "Locus({})".format(escape_parsable(str(self.reference_genome)))
Esempio n. 9
0
File: types.py Progetto: jigold/hail
 def __str__(self):
     return "locus<{}>".format(escape_parsable(str(self.reference_genome)))
Esempio n. 10
0
 def _pretty(self, l, indent, increment):
     l.append('locus<{}>'.format(escape_parsable(self.reference_genome.name)))
Esempio n. 11
0
 def _parsable_string(self):
     return "Locus({})".format(escape_parsable(str(self.reference_genome)))
Esempio n. 12
0
 def __str__(self):
     return "locus<{}>".format(escape_parsable(str(self.reference_genome)))
Esempio n. 13
0
 def _parsable_string(self):
     return "Union{{{}}}".format(
         ','.join('{}:{}'.format(escape_parsable(f), t._parsable_string()) for f, t in self.items()))
Esempio n. 14
0
 def __str__(self):
     return "union{{{}}}".format(
         ', '.join('{}: {}'.format(escape_parsable(f), str(t)) for f, t in self.items()))
Esempio n. 15
0
 def _key_str(self):
     return ', '.join([escape_parsable(k) for k in self.row_key])