# Path: cydra/component.py
# class Interface(object):
#     """Marker base class for extension point interfaces.
# 
#     Behavior of the ExtensionPoints for an interface can be customized with
#     _iface_XY class attributes. These behaviors are specified in the interface
#     in order to establish common ground rules in accessing the components for
#     an interface."""
# 
#     _iface_single_extension = False
#     """Only allow one active component for this interface"""
# 
#     _iface_attribute_proxy = None
#     """Callable to use for attribute access
# 
#     The callable will receive the paramenters interface, components and name (in this order)"""
# 
#     _iface_disable_extension_cache = False
#     """Disable the cache for the active extensions"""
# 
# class BroadcastAttributeProxy(object):
#     """Proxy for use in interfaces
# 
#     Calls all extensions and returns a list with the results"""
# 
#     def __init__(self, merge_lists=False):
#         """Init BroadcastAttributeProxy
# 
#         :param merge_lists: Consider return values to be lists and merge them into a single list"""
#         self.merge_lists = merge_lists
# 
#     def __call__(self, interface, components, name):
#         def call_all_components(*args, **kwargs):
#             return self.post_process([getattr(o, name)(*args, **kwargs) for o in components if hasattr(o, name)])
# 
#         if callable(getattr(interface, name)):
#             return call_all_components
#         else:
#             return self.post_process([getattr(o, name) for o in components if hasattr(o, name)])
# 
#     def post_process(self, result):
#         if self.merge_lists:
#             res = []
#             for l in result:
#                 if l is None:
#                     continue
#                 if isinstance(l, list):
#                     res.extend(l)
#                 else:
#                     res.append(l)
#             result = res
#         return result


from cydra.component import Interface, BroadcastAttributeProxy

    def can_create(self, project, user=None):
        """Can the given user create repositories"""
        pass

    def create_repository(self, project, repository_name):
        """Create repository"""
        pass

    def get_params(self):
        """Return the list of parameters for this repository type

        :return: list of RepositoryParameter instance
        """
        pass


class ISyncParticipant(Interface):
    """Interface for components wishing to perform actions upon synchronisation"""

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def sync_repository(self, repository):
        """Synchronise repository"""
        pass


class IRepositoryObserver(Interface):
    """Events on repository modifications"""


# Path: cydra/component.py
# class Interface(object):
#     """Marker base class for extension point interfaces.
# 
#     Behavior of the ExtensionPoints for an interface can be customized with
#     _iface_XY class attributes. These behaviors are specified in the interface
#     in order to establish common ground rules in accessing the components for
#     an interface."""
# 
#     _iface_single_extension = False
#     """Only allow one active component for this interface"""
# 
#     _iface_attribute_proxy = None
#     """Callable to use for attribute access
# 
#     The callable will receive the paramenters interface, components and name (in this order)"""
# 
#     _iface_disable_extension_cache = False
#     """Disable the cache for the active extensions"""
# 
# class BroadcastAttributeProxy(object):
#     """Proxy for use in interfaces
# 
#     Calls all extensions and returns a list with the results"""
# 
#     def __init__(self, merge_lists=False):
#         """Init BroadcastAttributeProxy
# 
#         :param merge_lists: Consider return values to be lists and merge them into a single list"""
#         self.merge_lists = merge_lists
# 
#     def __call__(self, interface, components, name):
#         def call_all_components(*args, **kwargs):
#             return self.post_process([getattr(o, name)(*args, **kwargs) for o in components if hasattr(o, name)])
# 
#         if callable(getattr(interface, name)):
#             return call_all_components
#         else:
#             return self.post_process([getattr(o, name) for o in components if hasattr(o, name)])
# 
#     def post_process(self, result):
#         if self.merge_lists:
#             res = []
#             for l in result:
#                 if l is None:
#                     continue
#                 if isinstance(l, list):
#                     res.extend(l)
#                 else:
#                     res.append(l)
#             result = res
#         return result


# Path: cydra/repository/interfaces.py
from cydra.component import Interface, BroadcastAttributeProxy


    def can_create(self, project, user=None):
        """Can the given user create repositories"""
        pass

    def create_repository(self, project, repository_name):
        """Create repository"""
        pass

    def get_params(self):
        """Return the list of parameters for this repository type

        :return: list of RepositoryParameter instance
        """
        pass


class ISyncParticipant(Interface):
    """Interface for components wishing to perform actions upon synchronisation"""

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def sync_repository(self, repository):
        """Synchronise repository"""
        pass


class IRepositoryObserver(Interface):
    """Events on repository modifications"""


    _iface_attribute_proxy = BroadcastAttributeProxy()