~osomon/moovida/plugin_dependencies_graph

« back to all changes in this revision

Viewing changes to elisa-plugins/elisa/plugins/poblesec/base/list.py

  • Committer: Olivier Tilloy
  • Date: 2009-09-30 10:45:35 UTC
  • mfrom: (1074.1.464 moovida)
  • Revision ID: olivier@fluendo.com-20090930104535-0szf1k61gabhqoa8
Merged the latest Moovida.

Show diffs side-by-side

added added

removed removed

Lines of Context:
312
312
 
313
313
        @return: a 2-tuple containing the default action and a list of
314
314
                 contextual actions
315
 
        @rtype:  (L{elisa.plugins.poblesec.actions.ContextualAction}, C{list}
316
 
                  of L{elisa.plugins.poblesec.actions.ContextualAction})
 
315
        @rtype:  (L{elisa.core.action.ContextualAction}, C{list}
 
316
                  of L{elisa.core.action.ContextualAction})
317
317
        """
318
318
        return None, []
319
319
 
396
396
            for item in self.model:
397
397
                shortcut = self.get_shortcut_for_item(item)
398
398
                # we assume that self.model is sorted by shortcut
399
 
                if shortcut not in shortcuts:
 
399
                if shortcut is not None and shortcut not in shortcuts:
400
400
                    shortcuts.append(shortcut)
401
401
                yield None
402
402
 
406
406
 
407
407
    def get_shortcut_for_item(self, item):
408
408
        """
409
 
        DOCME
 
409
        @return: a shortcut for the item, or C{None}
410
410
 
411
411
        This method should be overridden by subclasses.
412
412
        """
457
457
        @return: a deferred fired when the action taken is complete
458
458
        @rtype:  L{elisa.core.utils.defer.Deferred}
459
459
        """
460
 
        if self._default_action is not None:
461
 
            return self._default_action.execute(item)
 
460
        default_action = self._default_action
 
461
        if hasattr(item, 'default_action') and item.default_action is not None:
 
462
            default_action = item.default_action
 
463
 
 
464
        if default_action:
 
465
            return default_action.execute(item)
462
466
 
463
467
        # Handle gracefully the switch to the new API: fallback to the old API
464
468
        # if needed.