ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | List of all members
python.DiskUtils.EOS Class Reference
Inheritance diagram for python.DiskUtils.EOS:
Collaboration diagram for python.DiskUtils.EOS:

Public Member Functions

def __init__ (self, prefix='root://eosatlas.cern.ch/')
 
def wrap (self, path)
 
def unwrap (self, path)
 
def exists (self, path)
 
def is_file (self, path)
 
def is_directory (self, path)
 
def children (self, path)
 
def glob (self, pattern)
 

Public Attributes

 prefix
 

Private Member Functions

def _call (self, *args)
 

Detailed Description

Accesses EOS using the command line interface.
NB: when EOS is fuse-mounted on /eos this class is not really necessary.

Definition at line 240 of file DiskUtils.py.

Constructor & Destructor Documentation

◆ __init__()

def python.DiskUtils.EOS.__init__ (   self,
  prefix = 'root://eosatlas.cern.ch/' 
)

Definition at line 245 of file DiskUtils.py.

245  def __init__(self, prefix='root://eosatlas.cern.ch/'): self.prefix = prefix
246 
247 

Member Function Documentation

◆ _call()

def python.DiskUtils.EOS._call (   self,
args 
)
private

Definition at line 273 of file DiskUtils.py.

273  def _call(self, *args):
274  with open(os.devnull, 'w') as null:
275  retcode = subprocess.call(args, stderr=null)
276  return retcode
277 

◆ children()

def python.DiskUtils.EOS.children (   self,
  path 
)

Reimplemented from python.DiskUtils.Backend.

Definition at line 267 of file DiskUtils.py.

267  def children(self, path):
268  with open(os.devnull, 'w') as null:
269  output = subprocess.check_output(['eos', '-b', 'find', '-f',
270  self.unwrap(path)], stderr=null)
271  return [l.strip() for l in output.split('\n')]
272 

◆ exists()

def python.DiskUtils.EOS.exists (   self,
  path 
)

Reimplemented from python.DiskUtils.Backend.

Definition at line 258 of file DiskUtils.py.

258  def exists(self, path):
259  return self._call('eos', '-b', 'ls', '-s', self.unwrap(path)) == 0
260 

◆ glob()

def python.DiskUtils.Backend.glob (   self,
  pattern 
)
inherited

Reimplemented in python.DiskUtils.Local.

Definition at line 222 of file DiskUtils.py.

222  def glob(self, pattern): raise NotImplementedError

◆ is_directory()

def python.DiskUtils.EOS.is_directory (   self,
  path 
)

Reimplemented from python.DiskUtils.Backend.

Definition at line 264 of file DiskUtils.py.

264  def is_directory(self, path):
265  return self._call('eos', '-b', 'sat', '-d', self.unwrap(path)) == 0
266 

◆ is_file()

def python.DiskUtils.EOS.is_file (   self,
  path 
)

Reimplemented from python.DiskUtils.Backend.

Definition at line 261 of file DiskUtils.py.

261  def is_file(self, path):
262  return self._call('eos', '-b', 'sat', '-f', self.unwrap(path)) == 0
263 

◆ unwrap()

def python.DiskUtils.EOS.unwrap (   self,
  path 
)

Definition at line 253 of file DiskUtils.py.

253  def unwrap(self, path):
254  if path.startswith(self.prefix):
255  path = path[len(self.prefix):]
256  return path
257 

◆ wrap()

def python.DiskUtils.EOS.wrap (   self,
  path 
)

Reimplemented from python.DiskUtils.Backend.

Definition at line 248 of file DiskUtils.py.

248  def wrap(self, path):
249  if path.startswith('/'):
250  path = self.prefix + path
251  return path
252 

Member Data Documentation

◆ prefix

python.DiskUtils.EOS.prefix

Definition at line 246 of file DiskUtils.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Trk::open
@ open
Definition: BinningType.h:40
python.DecayParser.children
children
Definition: DecayParser.py:32
python.dummyaccess.exists
def exists(filename)
Definition: dummyaccess.py:9