import sys


class Progress(object):
    _strsize = 0
    _note_size = 0

    def __init__(self, max_index, bar_size=21):
        self.total = max_index
        # bar size in symbols
        self.bar_size = bar_size

    def write_progress(self, index, note=''):
        # calc index and percent values
        _suffix = ''
        new_size = len(note)
        if self._note_size > new_size:
            _suffix = ' '*(self._note_size - new_size)
        if index:
            _percent = (100 * index) // self.total
            _index = (self.bar_size * index) // self.total
        else:
            _percent = 0
            _index = 0

        # clear the line
        sys.stdout.write('\r')
        # print new progress
        _format = "[{:"+str(self.bar_size-1)+"}] {}/{} ({}%) {}"
        _progress_string = _format.format(
            '='*_index,
            index,
            self.total,
            _percent,
            note + _suffix
        )
        sys.stdout.write(_progress_string)
        # Save new note size and whole string size
        self._strsize = len(_progress_string)
        self._note_size = new_size
        sys.stdout.flush()

    def clearline(self):
        sys.stdout.write('\r')
        sys.stdout.write(' '*self._strsize)
        sys.stdout.write('\r')
        sys.stdout.flush()

    def end(self):
        self._note_size = 0
        self._strsize = 0
        sys.stdout.write('\n')
