ATLAS Offline Software
Classes | Functions
python.clidGenerator Namespace Reference

Classes

class  clidGenerator
 Athena CLID Generator Class. More...
 

Functions

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

Function Documentation

◆ py2_hash()

def python.clidGenerator.py2_hash (   s)

Definition at line 14 of file clidGenerator.py.

14 def 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()

def 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.

151 def 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()

def 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.

158 def 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
python.clidGenerator.search_files
def search_files(filename, search_path, pathsep=os.pathsep)
Definition: clidGenerator.py:158
python.clidGenerator.py2_hash
def py2_hash(s)
Definition: clidGenerator.py:14
python.clidGenerator.search_file
def search_file(filename, search_path, pathsep=os.pathsep)
Definition: clidGenerator.py:151