Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > ccd2f5c08185f7721754f86a114862fe > files > 370

python-enthought-envisageplugins-3.1.1-2mdv2010.0.noarch.rpm

#-----------------------------------------------------------------------------
#
#  Copyright (c) 2007 by Enthought, Inc.
#  All rights reserved.
#
#-----------------------------------------------------------------------------

"""
The env application's extension of the single project plugin.

"""

# Standard imports
import os
import sys

# Enthought library imports.
from enthought.envisage.api import Plugin, ServiceOffer
from enthought.envisage.ui.single_project.api import FactoryDefinition
from enthought.traits.api import List

# This module's package.
PKG = '.'.join(__name__.split('.')[:-1])

# Globally unique identifier.
ID = 'plugins.single_project'

###############################################################################
# `EnvProjectPlugin` class.
###############################################################################
class EnvProjectPlugin(Plugin):
    
    # Extension point Ids.
    FACTORY_DEFINITIONS = 'enthought.envisage.ui.single_project.factory_definitions'
    
    # The plugin's name.
    name = 'Env Project Plugin'
    
    ###### Contributions to extension points made by this plugin ######
    
    # Factory definition we contribute to.
    factory_definitions = List(contributes_to=FACTORY_DEFINITIONS)

    # Private methods.
    def _factory_definitions_default(self):
        """ Trait initializer. """
        factory_definition = FactoryDefinition(
            class_name = '%s.env_project_factory.EnvProjectFactory' % ID,
            priority = 10,
        )
        return [factory_definition]
        
    # TODO: Add contributions project action set.