Gentoo Archives: gentoo-portage-dev

From: "Michael A. Smith" <michael@××××××××.com>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Re: equery refactorization
Date: Sat, 06 Dec 2008 23:32:34
Message-Id: 493B0B90.1030903@smith-li.com
In Reply to: Re: [gentoo-portage-dev] Re: equery refactorization by Douglas Anderson
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Douglas Anderson wrote:
5 | On Thu, Dec 4, 2008 at 2:43 PM, Alec Warner <antarus@g.o> wrote:
6 |> <nitpick feel free to ignore me>
7 |> Don't put stuff in __init__.py.
8 |>
9 |> Make a file called equery (no .py) and do all the work in the modules
10 |> you import; eg.
11 |>
12 |> from equery import driver
13 |>
14 |> if __name__ == "__main__":
15 |> driver.Run()
16 |>
17 |> Then put all this code in driver.py (option parsing, signal handling,
18 |> etc...). Don't try to hide the code in __init__.py; it confuses
19 |> people who are trying to figure out what the module is for (since
20 |> __init__.py has very specific duties in declaring what is in the
21 |> module when you inspect the query module).
22
23 It's probably a good idea that we fulfill these 'duties' in any case, but if we
24 sufficiently comment __init__.py I don't really see the harm.
25
26 |> Putting the code in a file
27 |> named 'driver.py' or similarly makes it pretty obvious (to me anyway)
28 |> what the code in that file is for (to drive a program).
29
30 I don't really see the point, but if it'll make a difference a symlink would be
31 easy enough.
32
33 |> Does that make sense or am I full of crap?
34
35 Are those two things mutually exclusive, Alec? (j/k) :P
36
37 - -Michael
38 -----BEGIN PGP SIGNATURE-----
39 Version: GnuPG v2.0.9 (GNU/Linux)
40 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
41
42 iEYEARECAAYFAkk7C5AACgkQzwtr5yY0JZxWkACdF6+DK/C3b4k66A+ZlwQ7njHB
43 CsIAn3AIhNt6o6Wwbcrj7ClkOOUIbRsx
44 =iO5I
45 -----END PGP SIGNATURE-----