Changeset 3514
- Timestamp:
- 03/03/10 03:28:36 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
tea4cups/trunk/tea4cups
r3512 r3514 76 76 import pwd 77 77 import errno 78 import random 78 79 import md5 79 80 import cStringIO … … 914 915 def waitForLock(self) : 915 916 """Waits until we can acquire the lock file.""" 917 random.seed() 916 918 lockfilename = self.DeviceURI.replace("/", ".") 917 919 lockfilename = lockfilename.replace(":", ".") … … 925 927 try : 926 928 # open the lock file, optionally creating it if needed. 929 self.LockFile = None 927 930 self.LockFile = open(lockfilename, "a+") 928 931 … … 944 947 except IOError : 945 948 self.logDebug("I/O Error while waiting for lock %s" % lockfilename) 946 time.sleep(0.25) 949 if self.LockFile is not None : 950 self.LockFile.close() 951 time.sleep(0.25 + random.random()) 947 952 948 953 def readConfig(self) :