Package SmootLight :: Package layouts :: Module SpecifiedLayout
[hide private]
[frames] | no frames]

Source Code for Module SmootLight.layouts.SpecifiedLayout

 1  from operationscore.PixelAssembler import * 
2 -class SpecifiedLayout(PixelAssembler):
3 """SpecifiedLayout is a class that allows precise specification of each individual LED. 4 Configure with a <Locations> tag in the args dict as follows': 5 <Args> 6 <Locations> 7 <Loc>(1,1)</Loc> 8 <Loc>(50,50)</Loc> 9 </Locations> 10 etc. 11 </Args> 12 You may put attributes on the Locs so that you don't get confused. 13 """ 14
15 - def initLayout(self):
16 self.lightNum = -1
17
18 - def layoutFunc(self, lastLocation):
19 self.lightNum += 1 20 return self['Locations'][self.lightNum]
21