From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LWqFc-0008By-34 for garchives@archives.gentoo.org; Tue, 10 Feb 2009 10:54:00 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 356DFE03D9; Tue, 10 Feb 2009 10:53:58 +0000 (UTC) Received: from rv-out-0708.google.com (rv-out-0708.google.com [209.85.198.251]) by pigeon.gentoo.org (Postfix) with ESMTP id 05B26E03D9 for ; Tue, 10 Feb 2009 10:53:57 +0000 (UTC) Received: by rv-out-0708.google.com with SMTP id b17so2492811rvf.46 for ; Tue, 10 Feb 2009 02:53:57 -0800 (PST) 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 MIME-Version: 1.0 Received: by 10.142.221.11 with SMTP id t11mr3434386wfg.86.1234263237539; Tue, 10 Feb 2009 02:53:57 -0800 (PST) Date: Tue, 10 Feb 2009 19:53:57 +0900 Message-ID: Subject: [gentoo-portage-dev] equery: RFC and code review From: Douglas Anderson To: gentoo-portage-dev@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 012a83f8-43ce-4ed6-b5ba-ad600ece7542 X-Archives-Hash: 7a082179810a8db2b3a68d17a7cb7ec9 Hi all, It's been a few months since we first discussed refactoring equery on this list and I think made pretty good time and I'm reasonably happy with it. So I'm throwing out to you all. I've tried to keep a running list of visible changes as I went along, but I'm sure I've missed some things. You can read that here: http://code.google.com/p/genscripts/source/browse/equery/trunk/equery/CHANGELOG My primary goals for the refactorization were: * Modularize * Clean up the UI * Rewrite a more solid option handler * Eliminate as much duplicated code as possible * Clean up slop and bitrot, follow clean coding standards and style guidelines wherever possible * Break up large functions, write docstrings for all functions * Get code set for Python 2.6 (tested in 2.5 and 2.6) and prepare smooth upgrade for Py3k. * Create a more consistent experience for the user. This last point is surely where the most contention will stem from, so let me argue my position. All modules except for list, check and size display the help message when called without input (ex: equery uses). This makes sense. It's what most other programs do. It's what emerge does. It's what eselect does. It's the neighborly thing to do. However these three exceptions go and start a time-consuming process which is of very limited usefulness. With a cold cache, each process takes at least 30 seconds. I imagine that 99 percent of people who type 'equery list' do it by accident. And who needs to see the size of every installed package? And checksum every installed package? Almost useless except to a select few people who know what they're doing. So I took the liberty of changing the default behavior of these three modules to be more in line with the rest of equery and the world. Each of the three displays deprecation warning explaining how to recreate the old default behavior. I can't imagine anyone objecting outright to this, considering there will always be more than one version of gentoolkit in the tree (there are 6 now) so it'd be a long time before anyone was forced into the new behavior. That's it. For anyone interested, please read the link above and let me know if you like it/hate it/want something else done. For python programmers, I'd appreciate a quick code review and any comments/criticism whatsoever (I really like criticism). Thanks in advance, -Doug