def _initBlockMajorMap(self):
self._mapMajorDevclass = {}<EOL>try:<EOL><INDENT>fp = open(devicesFile, '<STR_LIT:r>')<EOL>data = fp.read()<EOL>fp.close()<EOL><DEDENT>except:<EOL><INDENT>raise IOError('<STR_LIT>'<EOL>% devicesFile)<EOL><DEDENT>skip = True<EOL>for line in data.splitlines():<EOL><INDENT>if skip:<EOL><INDENT>if re.match('<STR_LIT>', line, re.IGNORECASE):<EOL><INDENT>skip = False<EOL><DEDENT><DEDENT>else:<EOL><INDENT>mobj = re.match('<STR_LIT>', line)<EOL>if mobj:<EOL><INDENT>major = int(mobj.group(<NUM_LIT:1>))<EOL>devtype = mobj.group(<NUM_LIT:2>)<EOL>self._mapMajorDevclass[major] = devtype<EOL>if devtype == '<STR_LIT>':<EOL><INDENT>self._dmMajorNum = major<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Parses /proc/devices to initialize device class - major number map
        for block devices.