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 16 of file castorBaseDir.py.

References getUserAndArea().

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

Definition at line 5 of file castorBaseDir.py.

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

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

Definition at line 31 of file castorBaseDir.py.

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