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 241 of file DiskUtils.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 246 of file DiskUtils.py.

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

Member Function Documentation

◆ _call()

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

Definition at line 274 of file DiskUtils.py.

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

◆ children()

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

Reimplemented from python.DiskUtils.Backend.

Definition at line 268 of file DiskUtils.py.

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

◆ exists()

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

Reimplemented from python.DiskUtils.Backend.

Definition at line 259 of file DiskUtils.py.

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

◆ glob()

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

Reimplemented in python.DiskUtils.Local.

Definition at line 223 of file DiskUtils.py.

223  def glob(self, pattern): raise NotImplementedError

◆ is_directory()

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

Reimplemented from python.DiskUtils.Backend.

Definition at line 265 of file DiskUtils.py.

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

◆ is_file()

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

Reimplemented from python.DiskUtils.Backend.

Definition at line 262 of file DiskUtils.py.

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

◆ unwrap()

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

Definition at line 254 of file DiskUtils.py.

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

◆ wrap()

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

Reimplemented from python.DiskUtils.Backend.

Definition at line 249 of file DiskUtils.py.

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

Member Data Documentation

◆ prefix

python.DiskUtils.EOS.prefix

Definition at line 247 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