From e39ea72600e4c5280ecbea88ada09b9b086e1e9c Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 26 Sep 2024 23:54:11 +0300 Subject: [PATCH] Added finished time Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 3 ++- slpkg/main.py | 4 ++++ slpkg/utilities.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index a436f395..27f833b2 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,6 @@ ## slpkg - ChangeLog -### 5.1.3 - 19/09/2024 +### 5.1.3 - 26/09/2024 - Fixed: * Fixed ascii characters done and failed @@ -10,6 +10,7 @@ - Added: * Added to support git repositories + * Added finished time for update ### 5.1.2 - 22/08/2024 diff --git a/slpkg/main.py b/slpkg/main.py index 6aa24a97..a4756a2e 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -4,6 +4,7 @@ import os import sys +import time import logging from pathlib import Path from signal import signal, SIGPIPE, SIG_DFL @@ -437,8 +438,11 @@ class Menu(Configs): # pylint: disable=[R0902] check = CheckUpdates(self.flags, self.repository) check.updates() else: + start: float = time.time() update = UpdateRepositories(self.flags, self.repository) update.repositories() + elapsed_time: float = time.time() - start + self.utils.finished_time(elapsed_time) raise SystemExit(0) self.usage.help_short(1) diff --git a/slpkg/utilities.py b/slpkg/utilities.py index 48d94b73..79c672da 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -129,7 +129,7 @@ class Utilities(Configs): Args: elapsed_time (float): Unformatted time. """ - print('\nFinished:', time.strftime('%H:%M:%S', time.gmtime(elapsed_time))) + print('Finished:', time.strftime('%H:%M:%S', time.gmtime(elapsed_time))) @staticmethod def is_option(options: tuple, flags: list) -> bool: