Package elisa :: Package core :: Module action

Source Code for Module elisa.core.action

 1  # -*- coding: utf-8 -*- 
 2  # Moovida - Home multimedia server 
 3  # Copyright (C) 2006-2009 Fluendo Embedded S.L. (www.fluendo.com). 
 4  # All rights reserved. 
 5  # 
 6  # This file is available under one of two license agreements. 
 7  # 
 8  # This file is licensed under the GPL version 3. 
 9  # See "LICENSE.GPL" in the root of this distribution including a special 
10  # exception to use Moovida with Fluendo's plugins. 
11  # 
12  # The GPL part of Moovida is also available under a commercial licensing 
13  # agreement from Fluendo. 
14  # See "LICENSE.Moovida" in the root directory of this distribution package 
15  # for details on that license. 
16  # 
17   
18  from elisa.core.utils import defer 
19   
20  import gobject 
21   
22 -class ContextualAction(gobject.GObject):
23 24 """ 25 DOCME 26 27 @cvar name: DOCME 28 @type name: DOCME 29 @cvar label: DOCME 30 @type label: DOCME 31 """ 32 33 __gsignals__ = { 34 'name-changed': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), 35 } 36 37 label = '' 38
39 - def __init__(self, controller):
40 super(ContextualAction, self).__init__() 41 self.controller = controller 42 self._name = None
43
44 - def _get_name(self):
45 return self._name
46
47 - def _set_name(self, new_name):
48 self._name = new_name 49 self.emit('name-changed')
50 51 name = property(_get_name, _set_name) 52
53 - def execute(self, item):
54 # Default implementation 55 return defer.fail(NotImplementedError())
56