def parseDiskStatLine(L):
parts = L.split()<EOL>device = parts[<NUM_LIT:2>]<EOL>if len(parts) == <NUM_LIT:7>:<EOL><INDENT>factory = partitionstat<EOL><DEDENT>else:<EOL><INDENT>factory = diskstat<EOL><DEDENT>return device, factory(*list(map(int, parts[<NUM_LIT:3>:])))<EOL>
Parse a single line from C{/proc/diskstats} into a two-tuple of the name of
the device to which it corresponds (ie 'hda') and an instance of the
appropriate record type (either L{partitionstat} or L{diskstat}).