On Sat, 18 Jan 2014 19:07:45 -0800 "W. Trevor King" wrote: > [...SNIP...] > + v = > int(settings.get("PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS", > + default)) > + except (ValueError, OverflowError): > + writemsg(_("!!! Variable > PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS" > + " contains non-integer value: '%s'\n") % \ > + > settings["PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS"], > + noiselevel=-1) > + writemsg(_("!!! Using > PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS " > + "default value: %s\n") % default, > + noiselevel=-1) > + v = default > + if v < 1: > + writemsg(_("!!! Variable > PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS" > + " contains value less than 1: '%s'\n") % v, > noiselevel=-1) > + writemsg(_("!!! Using > PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS " > [...SNIP...] The code screams PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS to me which makes it hard to read, I would suggest assigning it to a variable in advance as to not have to repeat it this often. Some code snippets for ideas: key = "PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS" v = int(settings.get(key), default) "!!! Variable %s contains non-integer value: '%s" % (key, ...) If needed, add a word to key to make the variable name slightly more meaningful; but avoid the full length if possible. eg. try_mirrors_key -- With kind regards, Tom Wijsman (TomWij) Gentoo Developer E-mail address : TomWij@gentoo.org GPG Public Key : 6D34E57D GPG Fingerprint : C165 AF18 AB4C 400B C3D2 ABF0 95B2 1FCD 6D34 E57D