def declareAsset(self, obj): isNew = (obj.type not in self.assetsByType) or ( obj not in self.assetsByType[obj.type]) Environment.declareAsset(self, obj) if isNew: self.observers.notifyObservers( Notification(self, Notification.ntNEWASSET, obj))
def undeclareAsset(self, obj): isDead = (obj.type in self.assetsByType) and (obj in self.assetsByType[obj.type]) Environment.undeclareAsset(self, obj) if isDead: self.observers.notifyObservers( Notification(self, Notification.ntDEADASSET, obj))
def __init__(self): Environment.__init__(self) self.observers = Observable()
def undeclareAsset(self, obj): isDead = (obj.type in self.assetsByType) and (obj in self.assetsByType[obj.type]) Environment.undeclareAsset(self, obj) if isDead: self.observers.notifyObservers(Notification(self, Notification.ntDEADASSET, obj))
def declareAsset(self, obj): isNew = (obj.type not in self.assetsByType) or (obj not in self.assetsByType[obj.type]) Environment.declareAsset(self, obj) if isNew: self.observers.notifyObservers(Notification(self, Notification.ntNEWASSET, obj))