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 1L7ndm-0003JY-FQ for garchives@archives.gentoo.org; Wed, 03 Dec 2008 09:03:28 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 883E3E04D9; Wed, 3 Dec 2008 09:03:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 38D16E04D9 for ; Wed, 3 Dec 2008 09:03:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id B1C536470D for ; Wed, 3 Dec 2008 09:03:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -2.599 X-Spam-Level: X-Spam-Status: No, score=-2.599 required=5.5 tests=[BAYES_00=-2.599] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5gxWF0d2xATb for ; Wed, 3 Dec 2008 09:03:17 +0000 (UTC) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.186]) by smtp.gentoo.org (Postfix) with ESMTP id 6E67A647EA for ; Wed, 3 Dec 2008 09:03:16 +0000 (UTC) Received: by mu-out-0910.google.com with SMTP id w9so2934112mue.4 for ; Wed, 03 Dec 2008 01:03:15 -0800 (PST) Received: by 10.103.245.18 with SMTP id x18mr5807441mur.62.1228294994776; Wed, 03 Dec 2008 01:03:14 -0800 (PST) Received: by 10.223.112.17 with HTTP; Wed, 3 Dec 2008 01:03:14 -0800 (PST) Message-ID: Date: Wed, 3 Dec 2008 18:03:14 +0900 From: "Douglas Anderson" To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] Re: equery refactorization In-Reply-To: <33EF1957-2481-4AF1-A112-D12D7C1119A7@smith-li.com> 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 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <33EF1957-2481-4AF1-A112-D12D7C1119A7@smith-li.com> X-Archives-Salt: 68505ebf-fb64-4e46-ba50-3a2cb007db48 X-Archives-Hash: 6bb0da8f9d02aff745f401c9aa7167eb On Wed, Dec 3, 2008 at 7:21 AM, Michael Smith wrote: > I had the same idea and even began working on a roadmap for it. > > Step 1: move gentoolkit to site-packages > Step 2: move individual command classes to functionally-organized > module-files > Step 3: refactor and enhance docstrings to allow primary help/usage() > function to construct from individual modules. (The goal here is to create a > drop-in mechanism for adding new modules, so that usage() is automatically > updated when a new module is added.) > Step 4: Profit! > > Actually another approach would be to create a core __init__.py that handled > the usage() and getopt functionality I outlined in Step 3 above, and then > one-by-one modify the individual modules that are in the current equery so > they could be dropped in. > > Thoughts? > > Michael > > On Dec 2, 2008, at 5:01 AM, Douglas Anderson wrote: > >> Hi, I'm interesting in tinkering with equery and doing some >> refactorization in my spare time. I wrote a script that some people >> mentioned would be a good module for equery (emeta, it's on bugzilla), but >> as I was looking into that, I noticed that equery is written as a script, >> even though it would probably really benifit from being modularized. >> >> Again, this is just because I have some free time right now and a >> willingness to learn about Portage, but I thought I'd check with you guys >> first. If I'm willing to do it without bother you all too much, would it be >> something you're interested in me doing? My idea is to set it up more like a >> Python package than a script, like: >> /usr/lib/gentoolkit/pym/gentoolkit/equery/ >> /usr/lib/gentoolkit/pym/gentoolkit/equery/__init__.py >> /usr/lib/gentoolkit/pym/gentoolkit/equery/belongs.py >> /usr/lib/gentoolkit/pym/gentoolkit/equery/check.py >> /usr/lib/gentoolkit/pym/gentoolkit/equery/depends.py >> etc... >> >> I think it would increase startup time and make adding or upgraded modules >> easier in the future. >> >> Well, I have a few more questions but I'll wait and see if this would be a >> positive thing or not. >> >> Thanks for your time, >> -Doug > > > Great, I'd like to give this a try, then. Michael, I was personally going to go for your "other approach" of having an __init__.py do all the setup and handle the input and send the local opts to the individual modules. If you're interested in working on it together, that would be great. I have a googlecodes repo that we can work out of, or whatever (same goes for anyone else) :) I'll also open up a bug for it when I have some work done. A little RFC: 1) Spaces or tabs? Python standard is spaces, Gentoo seems to be predominantly tabs. I personally like to use spaces when I'm writing Python, but if that would annoy everyone later on, I'll stick to tabs. 2) Are there any other progs that depend on equery and gentoolkit that you know of? If there are, I can try and keep an eye on things and create as little hassle as possible. Any other ideas? -Doug