Package flumotion :: Package twisted :: Module compat
[hide private]

Source Code for Module flumotion.twisted.compat

 1  # -*- Mode: Python; test-case-name: flumotion.test.test_compat -*- 
 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  """ 
19  Flumotion Twisted compatibility assistance 
20   
21  """ 
22   
23  import warnings 
24   
25  import zope.interface as zi 
26   
27  __version__ = "$Rev$" 
28   
29  from twisted.internet import reactor 
30   
31  try: 
32      reactor.seconds  # Introduced in Twisted 8.0.0 
33  except AttributeError: 
34      from twisted.python import runtime 
35      reactor.seconds = runtime.seconds 
36   
37   
38  # The following functions are deprecated; do not use them. They no longer 
39  # provide any backwards compatibility. 
40   
41   
42 -def implementsInterface(object, interface):
43 warnings.warn( 44 "This module is deprecated, use zope.interface directly instead", 45 DeprecationWarning, stacklevel=2) 46 return interface.providedBy(object)
47 48
49 -def implementedBy(object):
50 warnings.warn( 51 "This module is deprecated, use zope.interface directly instead", 52 DeprecationWarning, stacklevel=2) 53 return zi.implementedBy(object)
54 55
56 -def isInterface(object):
57 warnings.warn( 58 "This module is deprecated, use zope.interface directly instead", 59 DeprecationWarning, stacklevel=2) 60 return isinstance(object, zi.InterfaceClass)
61 62 Interface = zi.Interface 63 implements = zi.implements 64