CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
hippyaddtobaddatafiles.OneAtATime Class Reference
Inheritance diagram for hippyaddtobaddatafiles.OneAtATime:
hippyaddtobaddatafiles.KeepWhileOpenFile

Public Member Functions

def __enter__
 
def __init__
 
- Public Member Functions inherited from hippyaddtobaddatafiles.KeepWhileOpenFile
def __enter__
 
def __exit__
 
def __init__
 
def __nonzero__
 
def wouldbevalid
 

Public Attributes

 delay
 
- Public Attributes inherited from hippyaddtobaddatafiles.KeepWhileOpenFile
 bool
 
 f
 
 fd
 
 filename
 
 pwd
 

Private Attributes

 __printmessage
 

Detailed Description

Definition at line 102 of file hippyaddtobaddatafiles.py.

Constructor & Destructor Documentation

def hippyaddtobaddatafiles.OneAtATime.__init__ (   self,
  name,
  delay,
  message = None,
  printmessage = None,
  task = "doing this" 
)

Definition at line 103 of file hippyaddtobaddatafiles.py.

104  def __init__(self, name, delay, message=None, printmessage=None, task="doing this"):
105  super(OneAtATime, self).__init__(name, message=message)
106  self.delay = delay
107  if printmessage is None:
108  printmessage = "Another process is already {task}! Waiting {delay} seconds."
109  printmessage = printmessage.format(delay=delay, task=task)
110  self.__printmessage = printmessage

Member Function Documentation

def hippyaddtobaddatafiles.OneAtATime.__enter__ (   self)

Definition at line 111 of file hippyaddtobaddatafiles.py.

References hippyaddtobaddatafiles.OneAtATime.__printmessage, hippyaddtobaddatafiles.cdtemp(), hippyaddtobaddatafiles.OneAtATime.delay, and print().

112  def __enter__(self):
113  while True:
114  result = super(OneAtATime, self).__enter__()
115  if result:
116  return result
117  print(self.__printmessage)
118  time.sleep(self.delay)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

Member Data Documentation

hippyaddtobaddatafiles.OneAtATime.__printmessage
private

Definition at line 109 of file hippyaddtobaddatafiles.py.

Referenced by hippyaddtobaddatafiles.OneAtATime.__enter__().

hippyaddtobaddatafiles.OneAtATime.delay

Definition at line 105 of file hippyaddtobaddatafiles.py.

Referenced by hippyaddtobaddatafiles.OneAtATime.__enter__().