Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
menus = [
Menu(name="&Test", path="MenuBar", groups=["XGroup", "YGroup"]),
Menu(name="Foo", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
Menu(name="Bar", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
]
groups = [Group(id="Fred", path="MenuBar/Test")]
tool_bars = [
ToolBar(name="Fred", groups=["AToolBarGroup"]),
ToolBar(name="Wilma"),
ToolBar(name="Barney"),
]
actions = [
Action(
path="MenuBar/Test",
group="Fred",
class_name="envisage.ui.workbench.action.api:AboutAction",
),
Action(
path="ToolBar",
class_name="envisage.ui.workbench.action.api:AboutAction",
),
Action(
path="ToolBar",
class_name="envisage.ui.workbench.action.api:ExitAction",
),
Action(
path="ToolBar/Fred",
group="AToolBarGroup",
class_name="envisage.ui.workbench.action.api:AboutAction",
class_name="envisage.ui.workbench.action.api:AboutAction",
),
Action(
path="ToolBar",
class_name="envisage.ui.workbench.action.api:ExitAction",
),
Action(
path="ToolBar/Fred",
group="AToolBarGroup",
class_name="envisage.ui.workbench.action.api:AboutAction",
),
Action(
path="ToolBar/Wilma",
class_name="envisage.ui.workbench.action.api:AboutAction",
),
Action(
path="ToolBar/Barney",
class_name="envisage.ui.workbench.action.api:ExitAction",
),
]
#### 'WorkbenchActionSet' interface #######################################
# The Ids of the perspectives that the action set is enabled in.
enabled_for_perspectives = ["Foo"]
# The Ids of the perspectives that the action set is visible in.
visible_for_perspectives = ["Foo", "Bar"]
class TestActionSet(WorkbenchActionSet):
""" An action test useful for testing. """
#### 'ActionSet' interface ################################################
# The action set's globally unique identifier.
id = "envisage.ui.workbench.test"
menus = [
Menu(name="&Test", path="MenuBar", groups=["XGroup", "YGroup"]),
Menu(name="Foo", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
Menu(name="Bar", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
]
groups = [Group(id="Fred", path="MenuBar/Test")]
tool_bars = [
ToolBar(name="Fred", groups=["AToolBarGroup"]),
ToolBar(name="Wilma"),
ToolBar(name="Barney"),
]
actions = [
Action(
path="MenuBar/Test",
group="Fred",
class_name="envisage.ui.workbench.action.api:AboutAction",
),
Action(
path="ToolBar",
class_name="envisage.ui.workbench.action.api:AboutAction",
# The action set's globally unique identifier.
id = "envisage.ui.workbench.test"
menus = [
Menu(
name="&Test",
path="MenuBar",
before="Help",
groups=["XGroup", "YGroup"],
),
Menu(name="Foo", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
Menu(name="Bar", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
]
groups = [Group(id="Fred", path="MenuBar/Test")]
tool_bars = [
ToolBar(name="Fred", groups=["AToolBarGroup"]),
ToolBar(name="Wilma"),
ToolBar(name="Barney"),
]
actions = [
Action(
path="MenuBar/Test",
group="Fred",
class_name="envisage.ui.workbench.action.api:AboutAction",
),
Action(
path="MenuBar/Test",
group="Fred",
class TestActionSet(WorkbenchActionSet):
""" An action test useful for testing. """
#### 'ActionSet' interface ################################################
# The action set's globally unique identifier.
id = "envisage.ui.workbench.test"
menus = [
Menu(
name="&Test",
path="MenuBar",
before="Help",
groups=["XGroup", "YGroup"],
),
Menu(name="Foo", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
Menu(name="Bar", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
]
groups = [Group(id="Fred", path="MenuBar/Test")]
tool_bars = [
ToolBar(name="Fred", groups=["AToolBarGroup"]),
ToolBar(name="Wilma"),
ToolBar(name="Barney"),
]
actions = [
Action(
path="MenuBar/Test",
group="Fred",
class_name="envisage.ui.workbench.action.api:AboutAction",
# Enthought library imports.
from envisage.ui.action.api import Action, Group, Menu, ToolBar
from envisage.ui.workbench.api import WorkbenchActionSet
class TestActionSet(WorkbenchActionSet):
""" An action test useful for testing. """
#### 'ActionSet' interface ################################################
# The action set's globally unique identifier.
id = "envisage.ui.workbench.test"
menus = [
Menu(
name="&Test",
path="MenuBar",
before="Help",
groups=["XGroup", "YGroup"],
),
Menu(name="Foo", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
Menu(name="Bar", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
]
groups = [Group(id="Fred", path="MenuBar/Test")]
tool_bars = [
ToolBar(name="Fred", groups=["AToolBarGroup"]),
ToolBar(name="Wilma"),
ToolBar(name="Barney"),
]
# Enthought library imports.
from envisage.ui.action.api import Action, Group, Menu, ToolBar
from envisage.ui.workbench.api import WorkbenchActionSet
class TestActionSet(WorkbenchActionSet):
""" An action test useful for testing. """
#### 'ActionSet' interface ################################################
# The action set's globally unique identifier.
id = "envisage.ui.workbench.test"
menus = [
Menu(name="&Test", path="MenuBar", groups=["XGroup", "YGroup"]),
Menu(name="Foo", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
Menu(name="Bar", path="MenuBar/Test", groups=["XGroup", "YGroup"]),
]
groups = [Group(id="Fred", path="MenuBar/Test")]
tool_bars = [
ToolBar(name="Fred", groups=["AToolBarGroup"]),
ToolBar(name="Wilma"),
ToolBar(name="Barney"),
]
actions = [
Action(
path="MenuBar/Test",
group="Fred",
class_name="envisage.ui.workbench.action.api:AboutAction",
#
# Modified BSD License
# Enthought library imports
from envisage.api import Plugin
from envisage.api import Service
from traits.api import List
# This module's package.
PKG = '.'.join(__name__.split('.')[:-1])
# Logging imports
import logging
logger = logging.getLogger('root.'+__name__)
class OraclePlugin(Plugin):
""" This plugin allows to create code """
ACTION_SETS = 'envisage.ui.workbench.action_sets'
# The plugin's unique identifier.
id = 'connectome.codeoracle'
# The plugin's name (suitable for displaying to the user).
name = 'Oracle Plugin'
# adding the action sets
action_sets = List(contributes_to=ACTION_SETS)
def _action_sets_default(self):
""" Trait initializer. """
from oracle_action_set import OracleActionSet
# Author: Prabhu Ramachandran
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.
from traits.api import List
from envisage.api import Plugin, ServiceOffer
# This module's package.
PKG = '.'.join(__name__.split('.')[:-1])
# The mayavi package ID.
ID = 'mayavi'
###############################################################################
# `MayaviPlugin` class.
###############################################################################
class MayaviPlugin(Plugin):
# Extension point Ids.
SERVICE_OFFERS = 'envisage.ui.workbench.service_offers'
PREFERENCES = 'envisage.preferences'
# The plugins name.
name = 'Mayavi plugin'
# Our ID.
id = ID
###### Contributions to extension points made by this plugin ######
# Services we contribute.
service_offers = List(contributes_to=SERVICE_OFFERS)
# Enthought library imports.
from envisage.ui.action.api import Action, ActionSet, Group, Menu
# This package
PKG = '.'.join(__name__.split('.')[:-1])
#### Groups ###################################################################
scene_group = Group(
id='TVTKSceneGroup',
path='MenuBar/File', before='ExitGroup'
)
view_group = Group(
id='TVTKViewGroup',
path='MenuBar/Tools', before='PreferencesGroup'
)
#### Menus ####################################################################
new_menu = Menu(
name='&New',
path='MenuBar/File', group='TVTKSceneGroup'
)
save_scene_as_menu = Menu(
id='SaveSceneAs', name="Sa&ve Scene As",
path='MenuBar/File', group='TVTKSceneGroup', after='New'
)