1 """ May it be a light for you in dark places, when all other lights go out.
5 class BaseLight(object):
6 """ Common light functionality. """
8 def __init__(self, colour, position):
10 self.position = position
13 def load(cls, config):
15 light_type = kw.pop("type")
17 c for c in cls.__subclasses__()
18 if c.__name__.lower() == light_type]
19 return light_class(**kw)
22 class SpotLight(BaseLight):
24 self, colour="white", position=None, direction=90.0, spread=45.0):
25 super(SpotLight, self).__init__(colour, position)
26 self.direction = direction
30 class Lamp(BaseLight):
31 def __init__(self, colour="white", position=None, radius=100.0):
32 super(Lamp, self).__init__(colour, position)