From 120fe182ae91da269473d48c2d771248dd7a1376 Mon Sep 17 00:00:00 2001 From: Ilia Miheev Date: Wed, 2 Jul 2025 11:45:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D1=81=D1=81=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D1=8B=20=D1=81=20=D0=BF=D1=80=D0=BE=D0=B3?= =?UTF-8?q?=D1=80=D0=B5=D1=81=D1=81-=D0=B1=D0=B0=D1=80=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ipars/ProgressBarCode.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ipars/ProgressBarCode.py diff --git a/ipars/ProgressBarCode.py b/ipars/ProgressBarCode.py new file mode 100644 index 0000000..22f4e95 --- /dev/null +++ b/ipars/ProgressBarCode.py @@ -0,0 +1,20 @@ +from progress.bar import Bar + +class ProgressBarManager: + '''Класс для создания прогресс-бара + + max: обязательный параметр, который указывает максимальное значение итераций в прогресс-баре + message: сообщение перед прогресс-баром + color: цвет прогресс-бара + fill: заполнитель для сделанной части + width: размер прогресс-бара в символах''' + def __init__(self, max, message='Процесс работы', color='green', fill='#', width=32): + self.bar = Bar(max=max, message=message, color=color, fill=fill, suffix='%(index)d/%(max)d (%(percent)d%%)', width=width) + + def next(self): + '''Запускаем следущую итерацию прогресс-бара''' + self.bar.next() + + def finish(self): + '''Завершаем работу класса''' + self.bar.finish() \ No newline at end of file