Package httxlib :: Module httxobject
[hide private]
[frames] | no frames]

Source Code for Module httxlib.httxobject

 1  #!/usr/bin/env python 
 2  # -*- coding: latin-1; py-indent-offset:4 -*- 
 3  ################################################################################ 
 4  #  
 5  # This file is part of HttxLib 
 6  # 
 7  # HttxLib is an HTTP(s) Python library suited multithreaded/multidomain 
 8  # applications 
 9  # 
10  # Copyright (C) 2010-2011 Daniel Rodriguez (aka Daniel Rodriksson) 
11  # Copyright (C) 2011 Sensible Odds Ltd 
12  # 
13  # You can learn more and contact the author at: 
14  # 
15  #    http://code.google.com/p/httxlib/ 
16  # 
17  # HttxLib is free software: you can redistribute it and/or modify 
18  # it under the terms of the GNU General Public License as published by 
19  # the Free Software Foundation, either version 3 of the License, or 
20  # (at your option) any later version. 
21  # 
22  # HttxLib is distributed in the hope that it will be useful, 
23  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
24  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
25  # GNU General Public License for more details. 
26  # 
27  # You should have received a copy of the GNU General Public License 
28  # along with HttxLib. If not, see <http://www.gnu.org/licenses/>. 
29  # 
30  ################################################################################ 
31  ''' 
32  Base httxlib object that ensures all objects receive a Lock 
33  ''' 
34   
35  try: 
36      from threading import Lock 
37  except: 
38      from dummy_threading import Lock 
39   
40 -class HttxObject(object):
41 ''' 42 Base HttxLib object to provide threading synchronization 43 via means of an automatically instantiated lock object 44 @ivar lock: The Lock object. 45 @type lock: threading.Lock 46 ''' 47
48 - def __init__(self):
49 ''' 50 Constructor 51 It initializes a threading lock 52 ''' 53 self.lock = Lock()
54