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('}')
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('}')
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('}')
def _parsable_string(self): return "Struct{{{}}}".format( ','.join('{}:{}'.format(escape_parsable(f), t._parsable_string()) for f, t in self.items()))
def __str__(self): return "struct{{{}}}".format( ', '.join('{}: {}'.format(escape_parsable(f), str(t)) for f, t in self.items()))
def _pretty(self, l, indent, increment): l.append('locus<{}>'.format(escape_parsable(self.reference_genome.name)))
def _parsable_string(self): return "Locus({})".format(escape_parsable(str(self.reference_genome)))
def __str__(self): return "locus<{}>".format(escape_parsable(str(self.reference_genome)))
def _parsable_string(self): return "Union{{{}}}".format( ','.join('{}:{}'.format(escape_parsable(f), t._parsable_string()) for f, t in self.items()))
def __str__(self): return "union{{{}}}".format( ', '.join('{}: {}'.format(escape_parsable(f), str(t)) for f, t in self.items()))
def _key_str(self): return ', '.join([escape_parsable(k) for k in self.row_key])