CMS 3D CMS Logo

Functions
castorBaseDir Namespace Reference

Functions

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

Function Documentation

◆ castorBaseDir()

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

Definition at line 18 of file castorBaseDir.py.

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

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

◆ getUserAndArea()

def castorBaseDir.getUserAndArea (   user)
Factor out the magic user hack for use in other classes

Definition at line 7 of file castorBaseDir.py.

7 def getUserAndArea(user):
8  """Factor out the magic user hack for use in other classes"""
9 
10  area = 'user'
11 
12  tokens = user.split('_')
13  if tokens and len(tokens) > 1:
14  user = tokens[0]
15  area = tokens[1]
16  return user, area
17 

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

◆ myCastorBaseDir()

def castorBaseDir.myCastorBaseDir ( )
Gets the top level directory to use for writing for the current user

Definition at line 33 of file castorBaseDir.py.

33 def myCastorBaseDir():
34  """Gets the top level directory to use for writing for the current user"""
35  return castorBaseDir()
castorBaseDir
Definition: castorBaseDir.py:1
castorBaseDir.castorBaseDir
def castorBaseDir(user=os.environ['USER'], area=None)
Definition: castorBaseDir.py:18
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
castorBaseDir.myCastorBaseDir
def myCastorBaseDir()
Definition: castorBaseDir.py:33
castorBaseDir.getUserAndArea
def getUserAndArea(user)
Definition: castorBaseDir.py:7