~ubuntu-branches/debian/sid/pyro/sid

« back to all changes in this revision

Viewing changes to Pyro/util2.py

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz, Sandro Tosi, Bernd Zeimetz
  • Date: 2009-05-25 14:26:23 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090525142623-31cqgb2pdff6c1az
Tags: 3.9.1-1
[ Sandro Tosi ]
* debian/control
  - switch Vcs-Browser field to viewsvn

[ Bernd Zeimetz ]
* New upstream release.
* debian/patches/usr-bin-env-location.dpatch:
  - Dropping patch, applied usptream. 
* debian/control, debian/rules:
  - Dropping dpatch build-dep and include, not needed anymore. 
* Switching to python-support and dh 7.
* Bumping Standards-Version to 3.8.1. 
* Dropping maintainer scripts, dh creates them properly. 
* Adding missing ${misc:Depends}. 
* Fix several file permissions in the examples package.
* Add symlink to the actual docu in pyro-examples. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#############################################################################
2
2
#
3
 
#       $Id: util2.py,v 2.2 2004/02/04 23:27:00 irmen Exp $
 
3
#       $Id: util2.py,v 2.2.4.1 2008/05/16 18:34:11 irmen Exp $
4
4
#       Pyro Utilities (part 2, to avoid circular dependencies)
5
5
#       User code should never import this, always use Pyro.util!
6
6
#
9
9
#
10
10
#############################################################################
11
11
 
 
12
_supports_mt=None
 
13
_supports_comp=None
 
14
 
12
15
def supports_multithreading():
13
 
        try:
14
 
                from threading import Thread, Lock
15
 
                return 1
16
 
        except:
17
 
                return 0
 
16
        global _supports_mt
 
17
        if _supports_mt is None:
 
18
                try:
 
19
                        from threading import Thread, Lock
 
20
                        _supports_mt=1
 
21
                except:
 
22
                        _supports_mt=0
 
23
        return _supports_mt
18
24
        
19
25
def supports_compression():
20
 
        try:
21
 
                import zlib; return 1
22
 
        except:
23
 
                return 0
 
26
        global _supports_comp
 
27
        if _supports_comp is None:
 
28
                try:
 
29
                        import zlib
 
30
                        _supports_comp=1
 
31
                except:
 
32
                        _supports_comp=0
 
33
        return _supports_comp
24
34
 
25
35
if supports_multithreading():
26
36
        import threading