[master][PATCH] Cleanup arch.py

Vratislav Podzimek vpodzime at redhat.com
Mon Jul 15 11:50:52 UTC 2013


On Fri, 2013-07-12 at 13:44 -0500, Mark Hamzy wrote:
> Clean up arch.py to have a common style, consistent indentation, removed the obvious
> C to Python rewrite, and removed the globals and function short circuiting.
Overall, this looks good to me, thanks for the patch. But I'd like to
suggest three additional general changes:
1) make comments above function definitions proper docstrings using the
Sphinx syntax, like:
    def getPPCMachine():
        """:return: The PPC machine type, or None if not PPC."""

2) replace 'fobj = open(...)' followed by 'fobj.close' by with-blocks
like:
    with open(...) as fobj:

3) replace the 'lines = fobj.readlines()' followed by 
'for line in lines:' with 'for line in fobj'. There's no need to read
the whole files and process the lines afterwards.

If you don't like the 2) syntax, feel free to omit those changes.
Thanks,

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list