Package elisa :: Package plugins :: Package good :: Package xmlmenu :: Package actions :: Module enqueue_action
[hide private]
[frames] | no frames]

Source Code for Module elisa.plugins.good.xmlmenu.actions.enqueue_action

 1  # -*- coding: utf-8 -*- 
 2  # Elisa - Home multimedia server 
 3  # Copyright (C) 2006-2008 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 Elisa with Fluendo's plugins. 
11  # 
12  # The GPL part of Elisa is also available under a commercial licensing 
13  # agreement from Fluendo. 
14  # See "LICENSE.Elisa" in the root directory of this distribution package 
15  # for details on that license. 
16   
17   
18  __maintainer__ = 'Benjamin Kampmann <benjamin@fluendo.com>' 
19   
20  from elisa.base_components.action import Action 
21   
22   
23 -class EnqueueAction(Action):
24
25 - def __init__(self):
26 Action.__init__(self) 27 self.parent_model = None 28 self.playlist_model = None 29 self.empty_playlist_before = False
30
31 - def __call__(self, sth):
32 if self.empty_playlist_before: 33 self.playlist_model[:] = [] 34 35 for model in self.parent_model.children: 36 if hasattr(model, 'uri') and model.uri != None: 37 if not model.has_children: 38 self.playlist_model.append(model)
39