Comment 3 for bug 247332

Revision history for this message
Scott Kitterman (kitterman) wrote :

23:15] <lamont> 'twould be nice if USAGE were a function, just to have it not evaluate every run - but that's a nit
[23:15] <lamont> and very minor grumbles about you making me update debian/copyright
[23:16] <lamont> could you pretty please pick one of the standard licenses, and name it?
[23:16] <ScottK> OK.
[23:16] * ScottK tries to remember
[23:16] <lamont> I don't care if it's the postfix license, or another non-conflicting one
[23:16] <ScottK> That's MIT license.
[23:17] <lamont> and I think PEP-8 (?) or somewhere wants imports to be one per line
[23:17] <lamont> or such
[23:17] <lamont> OTOH, you're much closer to PEP-8 that most of my stuff before I started paying attention to it under threat of pain
[23:18] <lamont> I also tend to make a function called __main__ or such and just say if __name__ == '__main__': \n __main__()
[23:18] <lamont> which gives me something I can call when I'm playing with python -i and such
[23:19] <ScottK> Right.
[23:19] <ScottK> I looked and PEP-8 says one per line.
[23:20] <lamont> so general feedback would be PEP-8 conformance, the muttering about main() and USAGE, and otherwise a handwavy "looks at least not-unreasonable, if not just plain reasonable, +1"
[23:21] <lamont> and is shutil all the rage these days? /me hasn't ever used it
[23:21] <lamont> while understanding that it may be the new hotness and I'm not. :)
[23:21] <ScottK> OK. The one functional shortcut that it takes that might be an excessive one is it just assumes if the name of the smtpd you want setup appears anywhere in master.cf it's a bad idea.
[23:22] <ScottK> The shutil usage is a result of, "Gee, never had to do that before, let's see what the shiny new edition of Python in a Nutshell has to say about it."
[23:23] <ScottK> Honestly I don't want to go to the effort to make it smart enough to do the case where it has to find out if it's a duplicative service name or something else.
[23:23] <ScottK> Maybe I just add MIT to common-licenses and make it easy.
[23:24] <lamont> anywhere as in anywhere? or anywhere as first token?
[23:25] <ScottK> Anywhere like it parses line by line through your master.cf and if it finds the string you gave as your desired service name it says no thanks.
[23:25] <ScottK> And stops.
[23:25] <ScottK> For a helper script like this I think it's better to bail out in the face of any uncertainty that to try to be to smart about it.
[23:26] <ScottK> The use case I'm thinking about it you don't want to run it twice by accident and end up adding the same service two times in master.cf.