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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 217 of file DiskUtils.py.

217  def __init__(self, prefix='root://eosatlas.cern.ch/'): self.prefix = prefix
218 
219 

Member Function Documentation

◆ _call()

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

Definition at line 245 of file DiskUtils.py.

245  def _call(self, *args):
246  with open(os.devnull, 'w') as null:
247  retcode = subprocess.call(args, stderr=null)
248  return retcode
249 

◆ children()

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

Reimplemented from python.DiskUtils.Backend.

Definition at line 239 of file DiskUtils.py.

239  def children(self, path):
240  with open(os.devnull, 'w') as null:
241  output = subprocess.check_output(['eos', '-b', 'find', '-f',
242  self.unwrap(path)], stderr=null)
243  return [l.strip() for l in output.split('\n')]
244 

◆ exists()

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

Reimplemented from python.DiskUtils.Backend.

Definition at line 230 of file DiskUtils.py.

230  def exists(self, path):
231  return self._call('eos', '-b', 'ls', '-s', self.unwrap(path)) == 0
232 

◆ glob()

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

Reimplemented in python.DiskUtils.Local.

Definition at line 194 of file DiskUtils.py.

194  def glob(self, pattern): raise NotImplementedError

◆ is_directory()

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

Reimplemented from python.DiskUtils.Backend.

Definition at line 236 of file DiskUtils.py.

236  def is_directory(self, path):
237  return self._call('eos', '-b', 'sat', '-d', self.unwrap(path)) == 0
238 

◆ is_file()

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

Reimplemented from python.DiskUtils.Backend.

Definition at line 233 of file DiskUtils.py.

233  def is_file(self, path):
234  return self._call('eos', '-b', 'sat', '-f', self.unwrap(path)) == 0
235 

◆ unwrap()

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

Definition at line 225 of file DiskUtils.py.

225  def unwrap(self, path):
226  if path.startswith(self.prefix):
227  path = path[len(self.prefix):]
228  return path
229 

◆ wrap()

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

Reimplemented from python.DiskUtils.Backend.

Definition at line 220 of file DiskUtils.py.

220  def wrap(self, path):
221  if path.startswith('/'):
222  path = self.prefix + path
223  return path
224 

Member Data Documentation

◆ prefix

python.DiskUtils.EOS.prefix

Definition at line 218 of file DiskUtils.py.


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