From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C6D99138334 for ; Thu, 10 Jan 2019 08:22:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E2B4DE09B7; Thu, 10 Jan 2019 08:22:10 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B7665E09B7 for ; Thu, 10 Jan 2019 08:22:10 +0000 (UTC) Received: from gentoo.org (unknown [IPv6:2001:980:3ff0:64:c24:f4f5:a920:c46e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: grobian) by smtp.gentoo.org (Postfix) with ESMTPSA id E0791335C07; Thu, 10 Jan 2019 08:22:08 +0000 (UTC) Date: Thu, 10 Jan 2019 09:22:04 +0100 From: Fabian Groffen To: Zac Medico Cc: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH v4] collision_protect: use dynamic report interval Message-ID: <20190110082204.GQ1666@gentoo.org> References: <20190108134207.15339-1-grobian@gentoo.org> <20190109083323.3590-1-grobian@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KFztAG8eRSV9hGtP" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1 (Darwin 17.7.0, VIM - Vi IMproved 8.1) Organization: Gentoo Foundation, Inc. X-Archives-Salt: fe338369-7b92-4db9-a4c0-fec98eb26983 X-Archives-Hash: 22ddc2f79acf293f8f10a8231c27983e --KFztAG8eRSV9hGtP Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 09-01-2019 21:22:26 -0800, Zac Medico wrote: > > + if tnow + tinterv < ninterv: > > + showMessage(_("100% done\n")) >=20 > It took me a moment to understand the calculation here. How about if we > do something like this instead: >=20 >=20 > previous =3D monotonic() > progress_shown =3D False You're right. I should've gone for readability in the first place. There is no point in trying to save anything here. Thanks, Fabian > for f in files: > current =3D monotonic() > if current - previous > tinterv: > showMessage(...) > previous =3D current > progress_shown =3D True >=20 > if progress_shown: > showMessage(_("100% done\n")) >=20 >=20 >=20 > > return collisions, dirs_ro, symlink_collisions, plib_collisions > > =20 > > def _lstat_inode_map(self, path_iter): > >=20 >=20 >=20 > --=20 > Thanks, > Zac >=20 --=20 Fabian Groffen Gentoo on a different level --KFztAG8eRSV9hGtP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEELUvHd/Gtp7LaU1vuzpXahU5EQpMFAlw3AKkACgkQzpXahU5E QpOZrAgAiq4R3WlvR3+oDApJEo2Zq4xA1IIGJEVVqCzHetdwkOlvZXppM0lw3NWX cUzIoa9gHFGPT09tFGUfErX7ozSsqRZsZFvq6v+RdQsV5neCOtF6HezLANHzMAT8 i+kG7s0h3ydTWQuX4wa7XZEoCejlVKLx+hEFiVewMV9cNB3TvvUY7KBG4yEA/skr knW8/qMlDXkygTwRWp0PbdmYyd66SXQD7VA2oZHppIxop0pSpAbdrBXdAAcGNXpR zjjSloILOtRR5Fzhd9Se/VWVCRAD2G15/Y8AueD+SoQJ4GVYipORjWq6Rbk6I/nZ 8o1KlmKxKxkyJZNG8ATN5yn8JFb/Tg== =6UHl -----END PGP SIGNATURE----- --KFztAG8eRSV9hGtP--