コード例 #1
0
class IProjectObserver(Interface):
    """Interface for various informational events on projects"""

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def pre_delete_project(self, project, archiver):
        """Called prior to project deletion
コード例 #2
0
ファイル: interfaces.py プロジェクト: mensi/cydra
class IRepositoryProvider(Interface):

    _iface_attribute_proxy = BroadcastAttributeProxy()

    repository_type = ''
    repository_type_title = ''

    def get_repositories(self, project):
        """Get a list of repository objects for this project"""
        pass

    def get_repository(self, project, repository_name):
        """Get a repository object"""
        pass

    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
コード例 #3
0
class ISyncParticipant(Interface):
    """Interface for components whishing to participate in project synchronisation"""

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def sync_project(self, project):
        """Sync project
コード例 #4
0
ファイル: interfaces.py プロジェクト: mensi/cydra
class ISyncParticipant(Interface):
    """Interface for components wishing to perform actions upon synchronisation"""

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def sync_repository(self, repository):
        """Synchronise repository"""
        pass
コード例 #5
0
ファイル: themes.py プロジェクト: smanne/cydra
class IThemeProvider(Interface):
    """Components providing themes for the website"""

    _iface_attribute_proxy = BroadcastAttributeProxy(merge_lists=True)

    def get_themes(self):
        """Return an iterable with Theme instances"""
        pass
コード例 #6
0
class ICliProjectCommandProvider(Interface):

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def get_cli_project_commands(self):
        """Provide further commands for the CLI

        :returns: A list of ('command', function) tuples"""
        pass
コード例 #7
0
class IProjectFeaturelistItemProvider(Interface):

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def get_project_featurelist_items(self, project):
        """Featurelist
        
        :returns: A list of ('name', [actions...]) or a single one. Action is a dict {href: url_or_endpoint, name: name}"""
        pass
コード例 #8
0
class IRepositoryViewerProvider(Interface):

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def get_repository_viewers(self, repository):
        """Provide URLs for repository viewer
        
        :returns: A list of ('name', 'url') tuples or a single one"""
        pass
コード例 #9
0
class IProjectActionProvider(Interface):

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def get_project_actions(self, project):
        """Provide endpoints for project actions
        
        The method can either be get or post, depending on if the action
        has side effects.
        
        :returns: A list of ('name', 'endpoint', 'method') tuples or a single one"""
        pass
コード例 #10
0
class IProjectObserver(Interface):
    """Interface for various informational events on projects"""

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def post_create_project(self, project):
        """Called just after the project has been created

        3rd party components can use this event to initialize
        necessary configuration either on themselves or the
        newly created project"""

    def pre_delete_project(self, project, archiver):
        """Called prior to project deletion
コード例 #11
0
class IRepositoryObserver(Interface):
    """Events on repository modifications"""

    _iface_attribute_proxy = BroadcastAttributeProxy()

    def repository_post_commit(self, repository, revisions):
        """One or more commits have occured
        
        :param repository: The repository object
        :param revisions: A list of revision strings"""
        pass

    def pre_delete_repository(self, repository):
        """Gets called before a repository is deleted"""
        pass

    def post_delete_repository(self, repository):
        """Gets called after a repository has been deleted"""
        pass