# 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
# -*- coding: utf-8 -*-
#
# Copyright 2013 Manuel Stocker <mensi@mensi.ch>
#
# This file is part of Cydra.
#
# Cydra is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Cydra is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Cydra.  If not, see http://www.gnu.org/licenses



class IRepositoryProvider(Interface):

    _iface_attribute_proxy = BroadcastAttributeProxy()

    repository_type = ''
    repository_type_title = ''


# 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

# -*- coding: utf-8 -*-
#
# Copyright 2013 Manuel Stocker <mensi@mensi.ch>
#
# This file is part of Cydra.
#
# Cydra is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Cydra is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Cydra.  If not, see http://www.gnu.org/licenses



class IRepositoryProvider(Interface):

    _iface_attribute_proxy = BroadcastAttributeProxy()

    repository_type = ''
    repository_type_title = ''


    def get_repositories(self, project):