36 def make(cls, device):
37 lBoardInfo = toolbox.readSubNodes(device.getNode('io.config'), False)
38 device.dispatch()
39 boardType = lBoardInfo['board_type'].value()
40 carrierType = lBoardInfo['carrier_type'].value()
41 designType = lBoardInfo['design_type'].value()
42
43 boardcls = cls.makeBoardShell(boardType)
44 designcls = cls.makeBoardShell(designType)
45
46 if not boardcls:
47 raise RuntimeError('Device '+device.id()+': Unknown board type')
48 if not designcls:
49 raise RuntimeError('Device '+device.id()+': Unknown design type')
50
51 def ctor(self, device, boardType, carrierType, designType):
52
53 self.device = device
54 self.info = ShellContext()
55 self.info.boardType = boardType
56 self.info.carrierType = carrierType
57 self.info.designType = designType
58
59 super(self.__class__, self).__init__()
60
61
62 lCls = type(device.id(), (boardcls, designcls), {'__init__':ctor})
63
64 return lCls(device, boardType, carrierType, designType)
65