1 |
On Wed, 2013-12-18 at 22:39 -0800, W. Trevor King wrote: |
2 |
> On Wed, Dec 18, 2013 at 09:18:06PM -0800, antarus@g.o wrote: |
3 |
> > @@ -116,12 +115,13 @@ def parse_config(myconfig): |
4 |
> > print "Setting",x,"to default value \""+confdefaults[x]+"\"" |
5 |
> > conf_values[x]=confdefaults[x] |
6 |
> > |
7 |
> > + options = conf_values["options"].split() |
8 |
> > # parse out the rest of the options from the config file |
9 |
> > - if "autoresume" in string.split(conf_values["options"]): |
10 |
> > + if "autoresume" in options: |
11 |
> > print "Autoresuming support enabled." |
12 |
> > conf_values["AUTORESUME"]="1" |
13 |
> > |
14 |
> > - if "bindist" in string.split(conf_values["options"]): |
15 |
> > + if "bindist" in options: |
16 |
> > print "Binary redistribution enabled" |
17 |
> > conf_values["BINDIST"]="1" |
18 |
> > else: |
19 |
> |
20 |
> These changes look fine to me, but I'd rather just convert to the |
21 |
> stdlib's ConfigParser. That's going to blow away this whole function, |
22 |
> so I don't see the point in fixing it up now. Of course, if the |
23 |
> powers that be think a ConfigParser conversion is in the far-distant |
24 |
> future, then I'm ok with this as a temporary cleanup. |
25 |
> |
26 |
> Cheers, |
27 |
> Trevor |
28 |
> |
29 |
|
30 |
There's more, I have a commit in the rewrite that removes the |
31 |
duplication of options and the resulting standalone boolean variables. |
32 |
Instead, I turn options into a set which eliminates the possibility of |
33 |
duplicate entries, plus inclusion automatically implies a True value, |
34 |
absence a False value. |
35 |
|
36 |
So even if this was merged, it'd be wiped away soon anyway. |