Commit 65b1e4e7 authored by Luciano Cauzzi's avatar Luciano Cauzzi

minor change

parent 83d24a11
......@@ -8,10 +8,10 @@ logger = Logger.app_logger().get_logger()
def print_progress_percentage(current, total, desc=None):
print_progress_bar(current, total, prefix='Progress:', suffix='Completed', length=50)
try:
percentage = int((current/total) * 100)
percentage = (current/total) * 100
if percentage % 10 == 0:
prefix = desc + ": " if desc is not None else ""
suffix = "Total percentage = {.2}".format(percentage)
suffix = "Total percentage = {.2f}".format(percentage)
logger.info(prefix + suffix)
except Exception as e:
logger.error("Error while printing percentage\n {}".format(e))
......
......@@ -2,7 +2,7 @@ from logger_library import print_progress_percentage
def main():
print_progress_percentage(10, 100)
print_progress_percentage(7, 17)
if __name__ == '__main__':
......
......@@ -3,7 +3,7 @@ import setuptools
setup(
name='logger_library',
version='0.1.11',
version='0.1.12',
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