File: edit_data_action.py

package info (click to toggle)
python-envisageplugins 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,616 kB
  • ctags: 1,970
  • sloc: python: 7,047; makefile: 11; sh: 11; lisp: 1
file content (56 lines) | stat: -rw-r--r-- 1,443 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
#-----------------------------------------------------------------------------
#
#  Copyright (c) 2007 by Enthought, Inc.
#  All rights reserved.
#
#-----------------------------------------------------------------------------

"""
An action to edit the data parameters of a Data.

"""


# Standard imports.
import logging

# Local imports
from data_plugin_action import DataPluginAction


# Create a logger for this module.
logger = logging.getLogger(__name__)


class EditDataAction(DataPluginAction):
    """
    An action to edit the data parameters of a data.

    """

    ###########################################################################
    # 'Action' interface.
    ###########################################################################

    #### public interface #####################################################

    def perform(self, event):
        """
        Perform this action.

        """

        logger.debug('Performing EditDataAction [%s]', self)

        # Pull the parent for any displayed UI from the event.
        window = event.window.control

        # If we can find a target data, then perform the operation.
        data = self._get_target_data(event)
        if data is not None:
            self.data_ui_service.edit_data(window, data)

        return


#### EOF #####################################################################