# Path: spykeutils/progress_indicator.py
# class ProgressIndicator(object):
#     """ Base class for classes indicating progress of a long operation.
# 
#     This class does not implement any of the methods and can be used
#     as a dummy if no progress indication is needed.
#     """
# 
#     def set_ticks(self, ticks):
#         """ Set the required number of ticks before the operation is done.
# 
#         :param int ticks: The number of steps that the operation will take.
#         """
#         pass
# 
#     def begin(self, title=''):
#         """ Signal that the operation starts.
# 
#         :param string title: The name of the whole operation.
#         """
#         pass
# 
#     def step(self, num_steps=1):
#         """ Signal that one or more steps of the operation were completed.
# 
#         :param int num_steps: The number of steps that have been completed.
#         """
#         pass
# 
#     def set_status(self, new_status):
#         """ Set status description.
# 
#         :param string new_status: A description of the current status.
#         """
#         pass
# 
#     def done(self):
#         """ Signal that the operation is done. """
#         pass


import json
from data_provider import DataProvider
from data_provider_neo import NeoDataProvider
from ..progress_indicator import ProgressIndicator


class NeoStoredProvider(NeoDataProvider):
    def __init__(self, data, progress=ProgressIndicator()):
        super(NeoStoredProvider, self).__init__(data['name'], progress)
        self.data = data
        self.block_cache = None

    @classmethod
    def from_current_selection(cls, name, viewer):
        """ Create new NeoStoredProvider from current viewer selection
        """
        data = cls._get_data_from_viewer(viewer)
        data['name'] = name
        return cls(data, viewer.progress)

    @classmethod

# Path: spykeutils/progress_indicator.py
# class ProgressIndicator(object):
#     """ Base class for classes indicating progress of a long operation.
# 
#     This class does not implement any of the methods and can be used
#     as a dummy if no progress indication is needed.
#     """
# 
#     def set_ticks(self, ticks):
#         """ Set the required number of ticks before the operation is done.
# 
#         :param int ticks: The number of steps that the operation will take.
#         """
#         pass
# 
#     def begin(self, title=''):
#         """ Signal that the operation starts.
# 
#         :param string title: The name of the whole operation.
#         """
#         pass
# 
#     def step(self, num_steps=1):
#         """ Signal that one or more steps of the operation were completed.
# 
#         :param int num_steps: The number of steps that have been completed.
#         """
#         pass
# 
#     def set_status(self, new_status):
#         """ Set status description.
# 
#         :param string new_status: A description of the current status.
#         """
#         pass
# 
#     def done(self):
#         """ Signal that the operation is done. """
#         pass


# Path: spykeutils/plugin/data_provider_stored.py
import json
from data_provider import DataProvider
from data_provider_neo import NeoDataProvider
from ..progress_indicator import ProgressIndicator



class NeoStoredProvider(NeoDataProvider):
    def __init__(self, data, progress=ProgressIndicator()):
        super(NeoStoredProvider, self).__init__(data['name'], progress)
        self.data = data
        self.block_cache = None

    @classmethod
    def from_current_selection(cls, name, viewer):
        """ Create new NeoStoredProvider from current viewer selection
        """
        data = cls._get_data_from_viewer(viewer)
        data['name'] = name
        return cls(data, viewer.progress)

    @classmethod

    def from_file(cls, file_name, progress=ProgressIndicator()):