ATLAS Offline Software
Loading...
Searching...
No Matches
python.clidGenerator Namespace Reference

Classes

class  clidGenerator
 Athena CLID Generator Class. More...

Functions

 py2_hash (s)
 search_file (filename, search_path, pathsep=os.pathsep)
 search_files (filename, search_path, pathsep=os.pathsep)

Function Documentation

◆ py2_hash()

python.clidGenerator.py2_hash ( s)

Definition at line 14 of file clidGenerator.py.

14def py2_hash (s):
15 if len(s) == 0: return 0
16 x = ord(s[0]) << 7
17 for c in s:
18 x = (1000003*x) ^ ord(c)
19 x ^= len(s)
20 x &= 0xffffffff
21 if x == 0xffffffff:
22 x = 0xfffffffe
23 return x
24

◆ search_file()

python.clidGenerator.search_file ( filename,
search_path,
pathsep = os.pathsep )
Given a search path, find file with requested name 

Definition at line 151 of file clidGenerator.py.

151def search_file(filename, search_path, pathsep=os.pathsep):
152 """Given a search path, find file with requested name """
153 for path in string.split(search_path, pathsep):
154 candidate = os.path.join(path, filename)
155 if os.path.exists(candidate): return os.path.abspath(candidate)
156 return None
157

◆ search_files()

python.clidGenerator.search_files ( filename,
search_path,
pathsep = os.pathsep )
Given a search path, find file with requested name 

Definition at line 158 of file clidGenerator.py.

158def search_files(filename, search_path, pathsep=os.pathsep):
159 """Given a search path, find file with requested name """
160 clidFiles = []
161 for path in search_path.split(pathsep):
162 candidate = os.path.join(path, filename)
163 if os.path.exists(candidate): clidFiles.append(os.path.abspath(candidate))
164 return clidFiles