class FilesSpecificationsToDataAccessorsGroupConverter(object): """ converter to create data accessor objects based on files specification objects, data accessor objects are put into DataVectorsAccessorGroup object; this widget is especially suitable in situation of huge collection of file specification objects because of use a progress bar widget """ def __init__(self, _parent, _files_specifications): self.__data_vectors_accessor_group__ = DataVectorsAccessorGroup() count = len(_files_specifications) progressManager = ProgressDialogManager(_parent, label_text=("Preparing data"), max_value=count) with progressManager as progress: for idx in range(count): if (progress.wasCanceled()): break progress.increaseCounter() vector_accessor = get_data_accessor_from_file_specification( _parent, _files_specifications[idx]) self.__data_vectors_accessor_group__.addDataVectorAccessor( vector_accessor) @property def data_vectors_accessors_group(self): return self.__data_vectors_accessor_group__
def __init__(self, _parent, _files_specifications): self.__data_vectors_accessor_group__ = DataVectorsAccessorGroup() count = len(_files_specifications) progressManager = ProgressDialogManager(_parent, label_text=("Preparing data"), max_value=count) with progressManager as progress: for idx in range(count): if (progress.wasCanceled()): break progress.increaseCounter() vector_accessor = get_data_accessor_from_file_specification( _parent, _files_specifications[idx]) self.__data_vectors_accessor_group__.addDataVectorAccessor( vector_accessor)