Exemplo n.º 1
0
class VehicleAssembler(object):
    appearance = property(lambda self: self.__appearance)

    def __init__(self, vehicle):
        self.__appearance = VehicleAppearance()
        self.__vehicleRef = weakref.ref(vehicle)

    def prerequisites(self):
        prereqs = self.__appearance.prerequisites(self.__vehicleRef())
        return prereqs

    def _assembleParts(self, vehicle, appearance):
        pass

    def constructAppearance(self, prereqs):
        self._assembleParts(self.__vehicleRef(), self.__appearance)
        return self.__appearance
Exemplo n.º 2
0
 def __init__(self, vehicle):
     self.__appearance = VehicleAppearance()
     self.__vehicleRef = weakref.ref(vehicle)