Trees | Indices | Help |
---|
|
1 # -*- Mode: Python -*- 2 # vi:si:et:sw=4:sts=4:ts=4 3 # 4 # Flumotion - a streaming media server 5 # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). 6 # All rights reserved. 7 8 # This file may be distributed and/or modified under the terms of 9 # the GNU General Public License version 2 as published by 10 # the Free Software Foundation. 11 # This file is distributed without any warranty; without even the implied 12 # warranty of merchantability or fitness for a particular purpose. 13 # See "LICENSE.GPL" in the source distribution for more information. 14 15 # Licensees having purchased or holding a valid Flumotion Advanced 16 # Streaming Server license may use this file in accordance with the 17 # Flumotion Advanced Streaming Server Commercial License Agreement. 18 # See "LICENSE.Flumotion" in the source distribution for more information. 19 20 # Headers in this file shall remain intact. 21 22 import os 23 import gtk 24 25 from gettext import gettext as _ 26 27 from flumotion.component.base.admin_gtk import BaseAdminGtk, BaseAdminGtkNode 2830 glade_file = os.path.join('flumotion', 'component', 'misc', 31 'httpfile', 'httpfile.glade') 32 379239 # Set _stats regardless of if condition 40 # Used to be a race where _stats was 41 # not set if widget tree was gotten before 42 # ui state 43 self._stats = stats 44 if not hasattr(self, 'statistics'): 45 # widget tree not created yet 46 return 47 48 self.updateLabels(stats) 49 50 if not self.shown: 51 # widget tree created but not yet shown 52 self.shown = True 53 self.statistics.show_all()5456 #widgetname = name.replace('-', '_') 57 #FIXME: make object member directly 58 widget = self.wtree.get_widget('label-' + name) 59 if widget: 60 self.labels[name] = widget 61 else: 62 print "FIXME: no widget %s" % name63 6769 if not hasattr(self, 'labels'): 70 return 71 72 for name in self.labels.keys(): 73 text = state.get(name) 74 if text == None: 75 text = '' 76 else: 77 self.labels[name].set_text(str(text))7880 self.labels = {} 81 self.statistics = self.wtree.get_widget('statistics-widget') 82 self.widget = self.statistics 83 for type in ('bytes-transferred', 'connected-clients'): 84 self.registerLabel(type) 85 86 if self._stats: 87 self.shown = True 88 self.updateLabels(self._stats) 89 self.statistics.show_all() 90 91 return self.statistics102 103 GUIClass = HTTPFileAdminGtk 10495 statistics = StatisticsAdminGtkNode(self.state, self.admin) 96 self.nodes['Statistics'] = statistics 97 # FIXME: maybe make a protocol instead of overriding 98 return BaseAdminGtk.setup(self)99
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Apr 11 07:40:38 2008 | http://epydoc.sourceforge.net |