CMS 3D CMS Logo

Functions
castorBaseDir Namespace Reference

Functions

def castorBaseDir (user=os.environ['USER'], area=None)
 
def getUserAndArea (user)
 
def myCastorBaseDir ()
 

Function Documentation

def castorBaseDir.castorBaseDir (   user = os.environ['USER'],
  area = None 
)
Gets the top level directory to use for writing for 'user'

Definition at line 17 of file castorBaseDir.py.

References getUserAndArea(), and edm.print().

17 def castorBaseDir( user=os.environ['USER'], area = None):
18  """Gets the top level directory to use for writing for 'user'"""
19 
20  if area is None:
21  user, area = getUserAndArea(user)
22 
23  d = 'root://eoscms.cern.ch//eos/cms/store/cmst3/%s/%s/CMG' % (area,user)
24  exists = castortools.isDirectory( castortools.lfnToCastor(d) )
25  if exists:
26  return d
27  else:
28  msg = "The directory '%s' does not exist. Please check the username and area (user/group). You may need to create the directory yourself." % d
29  print(msg, file=sys.stderr)
30  raise NameError(msg)
31 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def castorBaseDir(user=os.environ['USER'], area=None)
def getUserAndArea(user)
Definition: castorBaseDir.py:6
def castorBaseDir.getUserAndArea (   user)
Factor out the magic user hack for use in other classes

Definition at line 6 of file castorBaseDir.py.

Referenced by addToDatasets.addToDatasets(), and castorBaseDir().

6 def getUserAndArea(user):
7  """Factor out the magic user hack for use in other classes"""
8 
9  area = 'user'
10 
11  tokens = user.split('_')
12  if tokens and len(tokens) > 1:
13  user = tokens[0]
14  area = tokens[1]
15  return user, area
16 
def getUserAndArea(user)
Definition: castorBaseDir.py:6
def castorBaseDir.myCastorBaseDir ( )
Gets the top level directory to use for writing for the current user

Definition at line 32 of file castorBaseDir.py.

33  """Gets the top level directory to use for writing for the current user"""
34  return castorBaseDir()