Exemplo n.º 1
0
 def __setattr__(self, slot, value):
     if hasattr(self, slot) and isinstance(getattr(self, slot),
                                           cellprofiler.setting.Setting):
         assert isinstance(value, cellprofiler.setting.Setting), (
             "Overwriting %s's %s existing Setting with value of type %s.\nUse __dict__['%s'] = ... to override."
             % (self.module_name, slot, type(value), slot))
     object.__setattr__(self, slot, value)
Exemplo n.º 2
0
 def __setattr__(self, slot, value):
     if hasattr(self, slot) and isinstance(getattr(self, slot), cps.Setting):
         assert isinstance(value, cps.Setting), (
             "Overwriting %s's %s existing Setting with value of type %s.\nUse __dict__['%s'] = ... to override."
             % (self.module_name, slot, type(value), slot)
         )
     object.__setattr__(self, slot, value)