Package elisa :: Package base_components :: Module model
[hide private]
[frames] | no frames]

Source Code for Module elisa.base_components.model

 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__ = 'Lionel Martin <lionel@fluendo.com>' 
19  __maintainer2__ = 'Florian Boucault <florian@fluendo.com>' 
20   
21   
22  from elisa.core.component import Component 
23  from elisa.core.observers.observable import Observable 
24   
25   
26 -class Model(Component, Observable):
27 """ 28 Holds data that can be rendered by several 29 L{elisa.base_components.view.View}s. 30 It is provided by L{elisa.base_components.activity.Activity} components 31 that fill it with data they would like to be displayed. 32 Models can inherit from each other to include more information and can 33 also be composed of other models to build more complex screens. 34 35 @ivar activity: reference to the activity which created the Model 36 @type activity: L{elisa.base_components.activity.Activity} 37 @ivar activate_action: action fired when the Model gets activated 38 @type activate_action: L{elisa.base_components.action.Action} 39 @ivar parent: parent model; None if the model is a root 40 @type parent: L{elisa.base_components.model.Model} 41 @ivar loading: True if the model is not yet filled, False 42 otherwise 43 @type loading: boolean 44 """ 45
46 - def __init__(self):
47 Component.__init__(self) 48 Observable.__init__(self) 49 50 self.activity = None 51 self.activate_action = None 52 self.parent = None 53 self.loading = False
54