File: enthought_traits_vet.py

package info (click to toggle)
matplotlib 0.98.1-1%2Blenny4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 18,624 kB
  • ctags: 22,599
  • sloc: python: 76,915; cpp: 63,459; ansic: 5,353; makefile: 111; sh: 12
file content (190 lines) | stat: -rw-r--r-- 6,596 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: David C. Morrill Date: 11/30/2004 Description: Plugin definition for
# the Traits 'View Editing Tool' (VET)
# ------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

# Enthought library imports:
from enthought.envisage.core.runtime.extension import Plugin

# Plugin extension-point imports:
from enthought.envisage.core.runtime  import Preferences
from enthought.envisage.ui            import Action, Group, Menu, UIActions, \
                                             UIViews, View
from enthought.envisage.ui.preference import PreferencePages, Page

#-------------------------------------------------------------------------------
#  Extensions:
#-------------------------------------------------------------------------------

#--- Preferences ---------------------------------------------------------------

preferences = Preferences(
    defaults = {
        'explode_on_exit': True,
    }
)

#--- Preference pages ----------------------------------------------------------

vet_preference_page = Page(
    id         = 'enthought.traits.vet.PreferencePage',
    class_name = 'enthought.traits.vet.PreferencePage',
    label      = 'VET Preferences',
    category   = '',
)

preference_pages = PreferencePages(
    pages = [ vet_preference_page ]
)

#--- Menus/Actions -------------------------------------------------------------

file_menu = Menu(
    id     = 'FileMenu',
    label  = 'File',
    path   = '',

    groups = [
        Group( name = 'AnExampleGroup' ),
        Group( name = 'AnotherGroup' ),
    ]
)

sub_menu = Menu(
    id     = 'SubMenu',
    label  = 'Sub',
    path   = 'FileMenu/AnExampleGroup',

    groups = [
        Group( name = 'MainGroup' ),
        Group( name = 'RadioGroup' ),
    ]
)

#do_it_action = Action(
#    id            = 'enthought.envisage.example.action.DoItAction',
#    class_name    = 'enthought.envisage.example.action.DoItAction',
#    label         = 'Do It!',
#    description   = "An action's description can appear in the status bar",
#    icon          = 'images/do_it.png',
#    tooltip       = 'A simple example action',
#    menu_bar_path = 'FileMenu/SubMenu/MainGroup',
#    tool_bar_path = 'additions',
#    style         = 'push',
#)
#
#higher_action = Action(
#    id            = 'enthought.envisage.example.action.HigherAction',
#    class_name    = 'enthought.envisage.example.action.DoItAction',
#    label         = 'Higher',
#    description   = "An action's description can appear in the status bar",
#    icon          = 'images/higher.png',
#    tooltip       = 'A simple example action',
#    menu_bar_path = 'FileMenu/SubMenu/RadioGroup',
#    tool_bar_path = 'RadioGroup',
#    style         = 'radio',
#)
#
#lower_action = Action(
#    id            = 'enthought.envisage.example.action.LowerAction',
#    class_name    = 'enthought.envisage.example.action.DoItAction',
#    label         = 'Lower',
#    description   = "An action's description can appear in the status bar",
#    icon          = 'images/lower.png',
#    tooltip       = 'A simple example action',
#    menu_bar_path = 'FileMenu/SubMenu/RadioGroup',
#    tool_bar_path = 'RadioGroup',
#    style         = 'radio',
#)
#
#overdrive_action = Action(
#    id            = 'enthought.envisage.example.action.OverdriveAction',
#    class_name    = 'enthought.envisage.example.action.DoItAction',
#    label         = 'Overdrive',
#    description   = "An action's description can appear in the status bar",
#    icon          = 'images/overdrive.png',
#    tooltip       = 'A simple example action',
#    menu_bar_path = 'FileMenu/SubMenu/',
#    tool_bar_path = 'additions',
#    style         = 'toggle',
#)
#
#ui_actions = UIActions(
#    menus   = [ file_menu, sub_menu ],
#    actions = [ do_it_action, higher_action, lower_action, overdrive_action ]
#)

#--- Views ---------------------------------------------------------------------

ui_views = UIViews(
    views = [
        View(
            name       = 'VET Edit View',
            icon       = 'images/stuff_view.png',
            id         = 'enthought.traits.vet.EditView',
            class_name = 'enthought.traits.vet.EditView',
            position   = 'left'
        ),
        View(
            name       = 'VET Visual View',
            icon       = 'images/stuff_view.png',
            id         = 'enthought.traits.vet.VisualView',
            class_name = 'enthought.traits.vet.VisualView',
            position   = 'top'
        ),
        View(
            name       = 'VET Property View',
            icon       = 'images/stuff_view.png',
            id         = 'enthought.traits.vet.PropertyView',
            class_name = 'enthought.traits.vet.PropertyView',
            position   = 'bottom'
        ),
    ]
)

#-------------------------------------------------------------------------------
#  Plugin definitions:
#-------------------------------------------------------------------------------

plugin = Plugin(
    # General information about the plugin:
    id            = 'enthought.traits.vet',
    name          = 'Traits View Editing Tool Plugin',
    version       = '1.0.0',
    provider_name = 'Enthought, Inc',
    provider_url  = 'www.enthought.com',
    autostart     = True,

    # The name of the class that implements the plugin:
    class_name = 'enthought.traits.vet.VETPlugin',

    # The Id's of the plugins that this plugin requires:
    requires = [
        'enthought.envisage.ui',
        'enthought.envisage.ui.preference',
        'enthought.envisage.ui.python_shell',
    ],

    # The extension points offered by this plugin to allow other plugins to
    # contribute to it:
    extension_points = [],

    # The contributions that this plugin makes to extension points offered by
    # other plugins:
    #extensions = [ ui_actions, ui_views, preferences, preference_pages ]
    extensions = [ ui_views, preferences, preference_pages ]
)