comparison data_generation/transformations/pycaptcha/Captcha/File.py @ 184:81f8466dc121

Transient exception handling in captchas (ie. lorsque le NFS est temporairement inaccessible)
author boulanni <nicolas_boulanger@hotmail.com>
date Sat, 27 Feb 2010 19:26:26 -0500
parents 1f5937e9e530
children 7800be7bce66
comparison
equal deleted inserted replaced
183:992ca8035a4d 184:81f8466dc121
34 34
35 def _findFullPaths(self): 35 def _findFullPaths(self):
36 """From our given file list, find a list of full paths to files""" 36 """From our given file list, find a list of full paths to files"""
37 paths = [] 37 paths = []
38 for name in self.fileList: 38 for name in self.fileList:
39 path = os.path.join(dataDir, self.basePath, name) 39 if name[0] == '/':
40 path = name
41 else:
42 path = os.path.join(dataDir, self.basePath, name)
40 if os.path.isdir(path): 43 if os.path.isdir(path):
41 for content in os.listdir(path): 44 for content in os.listdir(path):
42 if self._checkExtension(content): 45 if self._checkExtension(content):
43 paths.append(os.path.join(path, content)) 46 paths.append(os.path.join(path, content))
44 else: 47 else: