[Tutor] General Feedback, Script Structure

Damon Timm damontimm at gmail.com
Sun Feb 15 17:00:54 CET 2009


Hi -

Am still new to python -- was writing a script that is used by mdadm
(linux software raid utility) when there was a raid "event" ... the
script then sends an email (using another python script caled
"gmailme") to me with the information from the event and attaches the
details of the raid device that triggered the problem.

It works fine -- seems to do what I need -- but, to be very frank, I
don't think it is very *pretty* !  But, I am not sure what the
"python-way" would be to re-structure this so it continues to do what
it needs to do but is more readable and future-friendly.

Could you take a look ?

http://python.pastebin.com/m4e1694d5

Would be interested in any feedback (obviously, I should add some doc strings!).

Thanks,
Damon


More information about the Tutor mailing list