[master][PATCH] Cleanup arch.py reredux
Brian C. Lane
bcl at redhat.com
Tue Jul 23 00:05:23 UTC 2013
On Fri, Jul 19, 2013 at 12:16:23PM -0500, Mark Hamzy wrote:
> Clean up arch.py to have a common style, consistent indentation, removed the obvious
> C to Python rewrite, removed the globals and function short circuiting, and import
> the logger.
I know I'm a bit late to this, but a few comments:
> - if ppcMachine is None:
> - log.warning("Unable to find PowerPC machine type")
> - elif ppcMachine == 0:
> - log.warning("Unknown PowerPC machine type: %s" %(ppcMachine,))
> + for type in ppcType.items():
> + if type[0] in part:
> + return type[1]
May as well turn this into _type instead of stomping on the builtin.
> +def getPPCMacID():
> + """:return: The powermac machine type, or None if not PPC or a powermac.
> + :rtype: string"""
> if not isPPC():
Multi-line docstrings should really end with the """ on a line by
itself. I like single line docstrings to do this as well. But not
everyone agrees :)
It also seems like this module would be a good candidate for some tests,
except that it reads from /proc/cpuinfo
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20130722/7bda21dd/attachment.sig>
More information about the anaconda-patches
mailing list