Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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",
from envisage.ui.action.api import Action, Group, Menu, ToolBar
from envisage.ui.workbench.api import WorkbenchActionSet
# This module's package.
PKG = ".".join(__name__.split(".")[:-1])
class ProjectActionSet(WorkbenchActionSet):
""" Action set of a default Project. """
# The action set's globally unique identifier.
id = "envisage.ui.single_project.action_set"
# List of menus we provide.
menus = [
Menu(
id="ProjectMenu",
name="&Project",
path="MenuBar/File",
group="ProjectGroup",
),
]
# List of groups we provide.
groups = [
Group(id="OpenGroup", path="MenuBar/File/ProjectMenu"),
Group(id="SaveGroup", path="MenuBar/File/ProjectMenu"),
Group(id="CloseGroup", path="MenuBar/File/ProjectMenu"),
Group(id="ProjectGroup", path="MenuBar/File", before="ExitGroup"),
]
# List of toolbars we provide.
# This module's package.
PKG = ".".join(__name__.split(".")[:-1])
class DefaultActionSet(ActionSet):
""" The default workbench action set. """
menus = [
Menu(
name="&File",
path="MenuBar",
groups=["OpenGroup", "SaveGroup", "ImportGroup", "ExitGroup"],
),
Menu(
path="MenuBar",
class_name="pyface.workbench.action.api:ViewMenuManager",
),
Menu(name="&Tools", path="MenuBar", groups=["PreferencesGroup"]),
Menu(name="&Help", path="MenuBar", groups=["AboutGroup"]),
]
actions = [
Action(
path="MenuBar/File",
group="ExitGroup",
class_name=PKG + ".action.api:ExitAction",
),
Action(
path="MenuBar/Tools",
group="PreferencesGroup",
class DefaultActionSet(ActionSet):
""" The default workbench action set. """
menus = [
Menu(
name="&File",
path="MenuBar",
groups=["OpenGroup", "SaveGroup", "ImportGroup", "ExitGroup"],
),
Menu(
path="MenuBar",
class_name="pyface.workbench.action.api:ViewMenuManager",
),
Menu(name="&Tools", path="MenuBar", groups=["PreferencesGroup"]),
Menu(name="&Help", path="MenuBar", groups=["AboutGroup"]),
]
actions = [
Action(
path="MenuBar/File",
group="ExitGroup",
class_name=PKG + ".action.api:ExitAction",
),
Action(
path="MenuBar/Tools",
group="PreferencesGroup",
class_name=PKG + ".action.api:EditPreferencesAction",
),
Action(
path="MenuBar/Help",
group="AboutGroup",
)
visualize_menu = Menu(
id = "VisualizeMenu",
name = "Visuali&ze",
path = "MenuBar",
before = "View"
)
modules_menu = Menu(
id = "ModulesMenu",
name = "&Modules",
path="MenuBar/VisualizeMenu",
)
filters_menu = Menu(
id = "FiltersMenu",
name = "&Filters",
path="MenuBar/VisualizeMenu",
after="ModulesMenu",
)
########################################
# File menu items.
ID = 'mayavi'
####################
# Source actions.
open_file = Action(
id = "OpenFile",
path='MenuBar/VisualizeMenu',
)
modules_group = Group(
id='ModulesGroup',
path='MenuBar/VisualizeMenu/ModulesMenu',
)
filters_group = Group(
id='FiltersGroup',
path='MenuBar/VisualizeMenu/FiltersMenu',
)
########################################
# Menus
open_menu = Menu(
id = "LoadDataMenu",
name = "&Load data",
path = 'MenuBar/File',
group='MayaviFileGroup'
)
visualize_menu = Menu(
id = "VisualizeMenu",
name = "Visuali&ze",
path = "MenuBar",
before = "View"
)
modules_menu = Menu(
id = "ModulesMenu",
name = "&Modules",
#### 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'
)
#### Actions ##################################################################
new_scene = Action(
class_name = PKG + '.actions.NewScene',
path = 'MenuBar/File/New', group='additions'
)
filters_group = Group(
id='FiltersGroup',
path='MenuBar/VisualizeMenu/FiltersMenu',
)
########################################
# Menus
open_menu = Menu(
id = "LoadDataMenu",
name = "&Load data",
path = 'MenuBar/File',
group='MayaviFileGroup'
)
visualize_menu = Menu(
id = "VisualizeMenu",
name = "Visuali&ze",
path = "MenuBar",
before = "View"
)
modules_menu = Menu(
id = "ModulesMenu",
name = "&Modules",
path="MenuBar/VisualizeMenu",
)
filters_menu = Menu(
id = "FiltersMenu",
name = "&Filters",
path="MenuBar/VisualizeMenu",