'ends the entity definition. (but does not cancel the active style!)'

def end_entity(self):

    if ((self.stack[(-1)] == 'block') and self.dirty):
        self.escpos._raw('\n')
        self.dirty = False
    if (len(self.stack) > 1):
        self.stack = self.stack[:(-1)]
