diff options
author | Britney Fransen <brfransen@gmail.com> | 2022-11-22 21:23:26 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2022-11-22 21:23:26 (GMT) |
commit | a84b80d7b021899ac74d828d45234cc2982e8f70 (patch) | |
tree | c1efc99de9836fa1c522fc0c2d559c8881cdf393 /linhes/linhes-dev/mp.py | |
parent | 003fe951e1d811a01d17fcbfff8d4491503833b3 (diff) | |
download | linhes_pkgbuild-a84b80d7b021899ac74d828d45234cc2982e8f70.zip linhes_pkgbuild-a84b80d7b021899ac74d828d45234cc2982e8f70.tar.gz linhes_pkgbuild-a84b80d7b021899ac74d828d45234cc2982e8f70.tar.bz2 |
linhes-dev: mp.py: add build time
Diffstat (limited to 'linhes/linhes-dev/mp.py')
-rwxr-xr-x | linhes/linhes-dev/mp.py | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/linhes/linhes-dev/mp.py b/linhes/linhes-dev/mp.py index 33832d0..b1bdfa7 100755 --- a/linhes/linhes-dev/mp.py +++ b/linhes/linhes-dev/mp.py @@ -519,7 +519,44 @@ class Packagefile(object): filename = "%s/__changelog" %pkgdir return os.path.exists(filename) - +def formatTD(time): + # convert seconds to day, hour, minutes and seconds + days = time // (24 * 3600) + time = time % (24 * 3600) + hours = time // 3600 + time %= 3600 + minutes = time // 60 + time %= 60 + seconds = int(time) + + if days == 0: + day_string = "" + elif days > 1: + day_string = "%s days, " %days + else: + day_string = "%s day, " %days + + if hours == 0: + hour_string = "" + elif hours > 1: + hour_string = "%s hours, " %hours + else: + hour_string = "%s hour, " %hours + + if minutes == 0: + minute_string = "" + elif minutes > 1: + minute_string = "%s minutes, " %minutes + else: + minute_string = "%s minute, " %minutes + + if seconds > 1: + second_string = "%s seconds" %seconds + else: + second_string = "%s second" %seconds + + return_string = '%s%s%s%s' % (day_string, hour_string, minute_string, second_string) + return return_string def main(): pkg_not_found=[] @@ -572,19 +609,23 @@ def main(): print("\n") print("Couldn't find these packages:") - print("----------------------------") + print("---------------------------------") print(pkg_not_found) print("\n") print("Failed to compile these packages:") - print("----------------------------") - print( failed_compile) + print("---------------------------------") + print(failed_compile) print("\n") print("Successful compiled :") - print("---------------------------") + print("---------------------------------") print(success_pkg) + print("\n") if __name__ == "__main__": + start = time.time() main() - print("--------------------------") + end = time.time() + print("Build Time:",formatTD(end - start)) + print("#######################################################") |