Gentoo Archives: gentoo-portage-dev

From: Alec Warner <antarus@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH v2 1/3] pym/portage/package/ebuild/fetch.py: Factor out _get_checksum_failure_max_tries
Date: Sun, 19 Jan 2014 22:52:50
Message-Id: CAAr7Pr9-kH8YxD3TwftkLbu0aoVkE4Go-V5E1e8DFWNdmJaf0w@mail.gmail.com
In Reply to: Re: [gentoo-portage-dev] [PATCH v2 1/3] pym/portage/package/ebuild/fetch.py: Factor out _get_checksum_failure_max_tries by "W. Trevor King"
1 On Sun, Jan 19, 2014 at 2:51 PM, W. Trevor King <wking@×××××××.us> wrote:
2
3 > On Sun, Jan 19, 2014 at 02:45:24PM -0800, Alec Warner wrote:
4 > > On Sun, Jan 19, 2014 at 2:44 PM, Alec Warner <antarus@g.o> wrote:
5 > > > This function and the next function you wrote are identical. How
6 > > > about making a single function?
7 > > >
8 > > > …
9 > > >
10 > > > def getIntValueFromSettings(settings, key, default):
11 > > > …
12 > >
13 > > Note, don't actually use these function names, they are terrible.
14 >
15 > A good name would be getint [1]. If we used ConfigParser, we wouldn't
16 > have to write any Portage-specific code at all ;). I don't think
17 > there's a shortage of things that could be streamlined here, and was
18 > trying to minimize rewriting until fetch() had been reduced to
19 > something I can comprehend ;).
20 >
21 >
22 Settings isn't a config, although we could emulate that API I guess ;)
23
24
25
26 > Cheers,
27 > Trevor
28 >
29 > [1]:
30 > http://docs.python.org/3/library/configparser.html#configparser.ConfigParser.getint
31 >
32 > --
33 > This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
34 > For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
35 >