Trees | Indices | Help |
---|
|
1 # -*- Mode: Python; test-case-name: flumotion.test.test_feedcomponent010 -*- 2 # vi:si:et:sw=4:sts=4:ts=4 3 4 # Flumotion - a streaming media server 5 # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. 6 # Copyright (C) 2010,2011 Flumotion Services, S.A. 7 # All rights reserved. 8 # 9 # This file may be distributed and/or modified under the terms of 10 # the GNU Lesser General Public License version 2.1 as published by 11 # the Free Software Foundation. 12 # This file is distributed without any warranty; without even the implied 13 # warranty of merchantability or fitness for a particular purpose. 14 # See "LICENSE.LGPL" in the source distribution for more information. 15 # 16 # Headers in this file shall remain intact. 17 18 # this class is a bit of an experiment 19 # editor's note: "experiment" is an excuse for undocumented and uncommented 20 21238326 self.state = state 27 self.setters = setters 28 self.appenders = appenders 29 self.removers = removers 30 self.setitemers = setitemers 31 self.delitemers = delitemers 32 self.shown = False 33 34 state.addListener(self, set_=self.onSet, append=self.onAppend, 35 remove=self.onRemove, setitem=self.onSetItem, 36 delitem=self.onDelItem) 37 38 for k in appenders: 39 for v in state.get(k): 40 self.onAppend(state, k, v)4143 if self.shown: 44 for k in self.setters: 45 self.onSet(self.state, k, None) 46 self.shown = False4749 # "show" the watcher by triggering all the registered setters 50 if not self.shown: 51 self.shown = True 52 for k in self.setters: 53 self.onSet(self.state, k, self.state.get(k))54 58 62 66 70 74
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Aug 13 06:17:38 2013 | http://epydoc.sourceforge.net |