object selection fix

This commit is contained in:
2006-04-19 18:50:10 +00:00
parent 56dac31529
commit 0eebd9436c
3 changed files with 12 additions and 12 deletions

View File

@@ -6,9 +6,9 @@ class Project:
self.name = name
self.dim_names = []
self._selection_observers = []
self.current_selection = {}
self.current_data=[]
self.datasets=[]
self.sel_obj = dataset.Selection()
def attach(self, observer):
"""Attach observer for selection updates"""
@@ -28,16 +28,14 @@ class Project:
if modifier != observer:
observer.update_selection(self)
def set_selection(self,sel_obj,dim_name,selection):
def set_selection(self,dim_name,selection):
"""Sets selection and notifies observers"""
current_selection = set(selection)
sel_obj.current_selection[dim_name] = current_selection
self.current_selection[dim_name] = current_selection
self.sel_obj.current_selection[dim_name] = set(selection)
self.notify()
def get_selection(self,sel_obj):
def get_selection(self):
"""Returns the current selection object"""
return sel_obj.current_selection
return self.sel_obj.current_selection
def add_dataset(self,dataset):
"""Appends a new Dataset to the project."""