Commit 8abf3761 authored by Luciano Cauzzi's avatar Luciano Cauzzi

fixed percentage printing

parent a6e7ec01
......@@ -4,12 +4,17 @@ from logger_library import Logger
logger = Logger.app_logger().get_logger()
__last_publish_value__ = -1
def print_progress_percentage(current, total, desc=None):
global __last_publish_value__
print_progress_bar(current, total, prefix='Progress:', suffix='Completed', length=50)
try:
percentage = (current/total) * 100
if percentage % 10 == 0:
discrete_value = int(percentage)
if discrete_value % 10 == 0 and __last_publish_value__ != discrete_value:
__last_publish_value__ = discrete_value
prefix = desc + ": " if desc is not None else ""
suffix = "Total percentage = {:3.2f}".format(percentage)
logger.info(prefix + suffix)
......
......@@ -3,7 +3,7 @@ import setuptools
setup(
name='logger_library',
version='0.1.13',
version='0.1.14',
packages=setuptools.find_packages(),
install_requires=['logzero', 'dependency_injector'],
url='http://github/innovation-that-excites/logger_library',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment