From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 038F81381F3 for ; Mon, 29 Jul 2013 14:57:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5E699E0AB4; Mon, 29 Jul 2013 14:56:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C0FB3E0AB4 for ; Mon, 29 Jul 2013 14:56:56 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 665A833EAA8 for ; Mon, 29 Jul 2013 14:56:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 00346E468F for ; Mon, 29 Jul 2013 14:56:53 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1375089920.a1290081b70d34ac70315970cffe5f70c3b31bc5.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/overlay/creator.py X-VCS-Directories: roverlay/overlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: a1290081b70d34ac70315970cffe5f70c3b31bc5 X-VCS-Branch: master Date: Mon, 29 Jul 2013 14:56:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 26a6d2d2-b9ee-412d-82b6-0f9bfccc4103 X-Archives-Hash: b52213829cae77cef8e49d8ea7ddf167 commit: a1290081b70d34ac70315970cffe5f70c3b31bc5 Author: André Erdmann mailerd de> AuthorDate: Mon Jul 29 09:25:20 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Mon Jul 29 09:25:20 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=a1290081 remove old stats code in overlay/creator.py --- roverlay/overlay/creator.py | 94 --------------------------------------------- 1 file changed, 94 deletions(-) diff --git a/roverlay/overlay/creator.py b/roverlay/overlay/creator.py index 4bbedbf..0666335 100644 --- a/roverlay/overlay/creator.py +++ b/roverlay/overlay/creator.py @@ -94,100 +94,6 @@ class OverlayCreator ( object ): # --- end of __init__ (...) --- - def get_stats ( self ): - raise NotImplementedError ( "about to be removed!" ) - pkg_added = self.package_added.get_nowait() - pkg_created = self.create_success.get_nowait() - pkg_failed = self.create_fail.get_nowait() - ov_added = self.overlay_added.get_nowait() - ov_failed = pkg_created - ov_added - processed = pkg_created + pkg_failed - failed = pkg_failed + ov_failed - - return ( - pkg_added, pkg_created, pkg_failed, - ov_added, ov_failed, - processed, failed - ) - # --- end of get_stats (...) --- - - def stats_str ( self, enclose=True ): - """Returns a string with some overlay creation stats.""" - raise NotImplementedError ( "about to be removed!" ) - def stats_gen(): - """Yields stats strings.""" - stats = self.get_stats() - - # the length of the highest number in stats (^=digit count) - # max_number_len := { 1,...,5 } - max_number_len = min ( 5, len ( str ( max ( stats ) ) ) ) - - for stats_tuple in zip ( - stats, - ( - 'packages added to the ebuild creation queue', - 'packages passed ebuild creation', - 'packages failed ebuild creation', - 'ebuilds could be added to the overlay', - 'ebuilds couldn\'t be added to the overlay', - 'packages processed in total', - 'packages failed in total', - ), - ): - yield "{num:<{l}} {s}".format ( - num = stats_tuple [0], - s = stats_tuple [1], - l = max_number_len, - ) - - yield "" - - k_len = min ( - 39, - max ( len ( k ) for k in self._timestats.keys() ) - ) - - for k, v in self._timestats.items(): - if v < 0: - yield "time for {:<{l}} : ".format ( k, l=k_len, ) - - elif v < 1: - yield "time for {:<{l}} : {} ms".format ( - k, - round ( v * 1000, 2 ), - l = k_len, - ) - - elif v > 300: - yield "time for {:<{l}} : {} minutes".format ( - k, - round ( v / 60., 2 ), - l = k_len, - ) - - else: - yield "time for {}: {} seconds".format ( k, round ( v, 2 ) ) - # --- end of stats_gen (...) --- - - if enclose: - stats = list ( stats_gen() ) - - # maxlen := { 2,...,80 } - maxlen = 2 + min ( 78, - len ( max ( stats, key=lambda s : len( s ) ) ) - ) - - return ( - "{0:-^{1}}\n".format ( " Overlay creation stats ", maxlen ) - + '\n'.join ( stats ) - #+ '\n{0:-^{1}}'.format ( '', maxlen ) - + '\n' + ( maxlen * '-' ) - ) - - else: - return '\n'.join ( stats_gen() ) - # --- end of stats_str (...) --- - def release_package_rules ( self ): """Removes all package rules from this object.