ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.fileutil.Tee Class Reference
Collaboration diagram for python.fileutil.Tee:

Public Member Functions

def __init__ (self, filename, options='', screen=sys.stdout)
 
def write (self, s)
 
def writelines (self, ls)
 
def flush (self)
 

Public Attributes

 f
 
 screen
 

Detailed Description

A file utility like unix 'tee'. It writes any output to a file and to screen (stdout by default).
<option> if it has an 'a', append to logfile file, otherwise overwrite existing file.

Definition at line 79 of file fileutil.py.

Constructor & Destructor Documentation

◆ __init__()

def python.fileutil.Tee.__init__ (   self,
  filename,
  options = '',
  screen = sys.stdout 
)

Definition at line 82 of file fileutil.py.

82  def __init__(self,filename,options='',screen=sys.stdout):
83  if 'a' in options:
84  fileMode = 'a'
85  else:
86  fileMode = 'w'
87  self.f = open (filename,fileMode)
88  self.screen = screen
89 

Member Function Documentation

◆ flush()

def python.fileutil.Tee.flush (   self)

Definition at line 103 of file fileutil.py.

103  def flush(self):
104  self.screen.flush()
105  self.f.flush()
106 
107 
108 

◆ write()

def python.fileutil.Tee.write (   self,
  s 
)

Definition at line 93 of file fileutil.py.

93  def write(self,s):
94  self.screen.write(s)
95  self.f.write(self,s)
96 
97 

◆ writelines()

def python.fileutil.Tee.writelines (   self,
  ls 
)

Definition at line 98 of file fileutil.py.

98  def writelines(self,ls):
99  self.screen.writelines(ls)
100  self.f.writelines(self,ls)
101 
102 

Member Data Documentation

◆ f

python.fileutil.Tee.f

Definition at line 87 of file fileutil.py.

◆ screen

python.fileutil.Tee.screen

Definition at line 88 of file fileutil.py.


The documentation for this class was generated from the following file:
FullCPAlgorithmsTest_eljob.flush
flush
Definition: FullCPAlgorithmsTest_eljob.py:186
python.ByteStreamConfig.write
def write
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:248
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18