Package flumotion :: Package component :: Package producers :: Module checks
[hide private]

Source Code for Module flumotion.component.producers.checks

  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  from twisted.internet import defer 
 23   
 24  from flumotion.worker.checks import check 
 25  from flumotion.common import gstreamer, messages 
 26   
 27  from flumotion.common.messages import N_ 
 28  T_ = messages.gettexter('flumotion') 
 29   
30 -def get_gst_version(gst):
31 if hasattr(gst, 'get_gst_version'): 32 return gst.get_gst_version() 33 elif hasattr(gst, 'version'): 34 return gst.version() 35 else: 36 return gst.gst_version + (0,)
37
38 -def get_pygst_version(gst):
39 if hasattr(gst, 'get_pygst_version'): 40 return gst.get_pygst_version() 41 else: 42 return gst.pygst_version + (0,)
43
44 -def checkTicket347():
45 """ 46 Check for a recent enough PyGTK to not leak python integers in message 47 processing (mostly affects soundcard, firewire) 48 """ 49 result = messages.Result() 50 import pygtk 51 pygtk.require('2.0') 52 import gobject 53 # Really, we want to check for pygobject_version, but that doesn't exist in 54 # all versions of pygtk, and this check is sufficient. 55 (major, minor, nano) = gobject.pygtk_version 56 if (major, minor, nano) < (2, 8, 6): 57 m = messages.Warning(T_( 58 N_("Version %d.%d.%d of the PyGTK library contains a memory leak.\n"), 59 major, minor, nano), 60 id = 'ticket-347') 61 m.add(T_(N_("The Soundcard and Firewire sources may leak a lot of " 62 "memory as a result, and need to be restarted frequently.\n"))) 63 m.add(T_(N_("Please upgrade '%s' to version %s or later."), 64 'pygtk', '2.8.6')) 65 result.add(m) 66 67 result.succeed(None) 68 return defer.succeed(result)
69
70 -def checkTicket348():
71 result = messages.Result() 72 import pygst 73 pygst.require('0.10') 74 import gst 75 (major, minor, nano) = gst.pygst_version 76 if (major, minor, nano) < (0, 10, 3): 77 m = messages.Warning(T_( 78 N_("Version %d.%d.%d of the gst-python library contains a large memory leak.\n"), 79 major, minor, nano), 80 id = 'ticket-348') 81 m.add(T_(N_("The Soundcard and Firewire sources may leak a lot of " 82 "memory as a result, and need to be restarted frequently.\n"))) 83 m.add(T_(N_("Please upgrade '%s' to version %s or later."), 84 'gst-python', '0.10.3')) 85 result.add(m) 86 87 result.succeed(None) 88 return defer.succeed(result)
89
90 -def checkTicket349():
91 result = messages.Result() 92 import pygst 93 pygst.require('0.10') 94 import gst 95 96 if get_gst_version(gst) < (0, 10, 4, 1): 97 major, minor, micro, nano = get_gst_version(gst) 98 m = messages.Error(T_( 99 N_("Version %d.%d.%d of the GStreamer library is too old.\n"), 100 major, minor, micro), 101 id = 'ticket-349') 102 m.add(T_(N_("The '%s' component needs a newer version of '%s'.\n"), 103 'looper', 'gstreamer')) 104 m.add(T_(N_("Please upgrade '%s' to version %s or later."), 105 'gstreamer', '0.10.5')) 106 result.add(m) 107 108 if get_pygst_version(gst) < (0, 10, 3, 1): 109 major, minor, micro, nano = get_pygst_version(gst) 110 m = messages.Error(T_( 111 N_("Version %d.%d.%d of the gst-python library is too old.\n"), 112 major, minor, micro), 113 id = 'ticket-349') 114 m.add(T_(N_("The '%s' component needs a newer version of '%s'.\n"), 115 'looper', 'gst-python')) 116 m.add(T_(N_("Please upgrade '%s' to version %s or later."), 117 'gst-python', '0.10.4')) 118 result.add(m) 119 120 result.succeed(None) 121 return defer.succeed(result)
122