#!/usr/bin/env python

class Entity(object):
    def __init__(self, entity_id, seq, chains=None):
        super(Entity, self).__init__()
        self.entity_id = entity_id
        self.seq = seq
        if chains:
            if isinstance(chains, list):
                self.chains = chains
            else:
                self.chains = [chains]
        else:
            self.chains = []

    def __repr__(self):
        out = ("entity_id: %s\n"
               "seq: %s\n\t"
               % (self.entity_id, self.seq))

        for c in self.chains:
            out += str(c).replace("\n", "\n\t")

        # Remove the last \t
        return out[:-1]

