1 |
On Wed, Dec 3, 2008 at 7:21 AM, Michael Smith <michael@××××××××.com> wrote: |
2 |
> I had the same idea and even began working on a roadmap for it. |
3 |
> |
4 |
> Step 1: move gentoolkit to site-packages |
5 |
> Step 2: move individual command classes to functionally-organized |
6 |
> module-files |
7 |
> Step 3: refactor and enhance docstrings to allow primary help/usage() |
8 |
> function to construct from individual modules. (The goal here is to create a |
9 |
> drop-in mechanism for adding new modules, so that usage() is automatically |
10 |
> updated when a new module is added.) |
11 |
> Step 4: Profit! |
12 |
> |
13 |
> Actually another approach would be to create a core __init__.py that handled |
14 |
> the usage() and getopt functionality I outlined in Step 3 above, and then |
15 |
> one-by-one modify the individual modules that are in the current equery so |
16 |
> they could be dropped in. |
17 |
> |
18 |
> Thoughts? |
19 |
> |
20 |
> Michael |
21 |
> |
22 |
> On Dec 2, 2008, at 5:01 AM, Douglas Anderson wrote: |
23 |
> |
24 |
>> Hi, I'm interesting in tinkering with equery and doing some |
25 |
>> refactorization in my spare time. I wrote a script that some people |
26 |
>> mentioned would be a good module for equery (emeta, it's on bugzilla), but |
27 |
>> as I was looking into that, I noticed that equery is written as a script, |
28 |
>> even though it would probably really benifit from being modularized. |
29 |
>> |
30 |
>> Again, this is just because I have some free time right now and a |
31 |
>> willingness to learn about Portage, but I thought I'd check with you guys |
32 |
>> first. If I'm willing to do it without bother you all too much, would it be |
33 |
>> something you're interested in me doing? My idea is to set it up more like a |
34 |
>> Python package than a script, like: |
35 |
>> /usr/lib/gentoolkit/pym/gentoolkit/equery/ |
36 |
>> /usr/lib/gentoolkit/pym/gentoolkit/equery/__init__.py |
37 |
>> /usr/lib/gentoolkit/pym/gentoolkit/equery/belongs.py |
38 |
>> /usr/lib/gentoolkit/pym/gentoolkit/equery/check.py |
39 |
>> /usr/lib/gentoolkit/pym/gentoolkit/equery/depends.py |
40 |
>> etc... |
41 |
>> |
42 |
>> I think it would increase startup time and make adding or upgraded modules |
43 |
>> easier in the future. |
44 |
>> |
45 |
>> Well, I have a few more questions but I'll wait and see if this would be a |
46 |
>> positive thing or not. |
47 |
>> |
48 |
>> Thanks for your time, |
49 |
>> -Doug |
50 |
> |
51 |
> |
52 |
> |
53 |
|
54 |
Great, I'd like to give this a try, then. |
55 |
|
56 |
Michael, I was personally going to go for your "other approach" of |
57 |
having an __init__.py do all the setup and handle the input and send |
58 |
the local opts to the individual modules. If you're interested in |
59 |
working on it together, that would be great. I have a googlecodes repo |
60 |
that we can work out of, or whatever (same goes for anyone else) :) |
61 |
I'll also open up a bug for it when I have some work done. |
62 |
|
63 |
A little RFC: |
64 |
1) Spaces or tabs? Python standard is spaces, Gentoo seems to be |
65 |
predominantly tabs. I personally like to use spaces when I'm writing |
66 |
Python, but if that would annoy everyone later on, I'll stick to tabs. |
67 |
|
68 |
2) Are there any other progs that depend on equery and gentoolkit that |
69 |
you know of? If there are, I can try and keep an eye on things and |
70 |
create as little hassle as possible. |
71 |
|
72 |
Any other ideas? |
73 |
|
74 |
-Doug |