CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
esMonitoring.DescriptorCapture Class Reference
Inheritance diagram for esMonitoring.DescriptorCapture:

Public Member Functions

def __init__
 
def close_in
 
def read_in
 

Static Public Member Functions

def event_loop
 

Public Attributes

 f
 
 fd
 
 write_files
 

Detailed Description

Definition at line 221 of file esMonitoring.py.

Constructor & Destructor Documentation

def esMonitoring.DescriptorCapture.__init__ (   self,
  f,
  write_files = [] 
)

Definition at line 222 of file esMonitoring.py.

223  def __init__(self, f, write_files=[]):
224  self.f = f
225  self.fd = f.fileno()
226  self.write_files = write_files

Member Function Documentation

def esMonitoring.DescriptorCapture.close_in (   self)

Definition at line 232 of file esMonitoring.py.

References esMonitoring.DescriptorCapture.fd, and esMonitoring.log().

Referenced by esMonitoring.DescriptorCapture.event_loop().

233  def close_in(self):
234  log("closed fd %d" % self.fd)
235  self.f.close()
def esMonitoring.DescriptorCapture.event_loop (   desc,
  timeout,
  timeout_call = None 
)
static

Definition at line 237 of file esMonitoring.py.

References esMonitoring.DescriptorCapture.close_in(), and esMonitoring.DescriptorCapture.read_in().

238  def event_loop(desc, timeout, timeout_call=None):
239  fd_map = {}
240  p = select.poll()
241 
242  for desc in desc:
243  fd_map[desc.fd] = desc
244  p.register(desc.fd, select.POLLIN)
245 
246  while len(fd_map) > 0:
247  events = p.poll(timeout)
248  if len(events) == 0:
249  if timeout_call:
250  timeout_call()
251 
252  for fd, ev in events:
253  rbuf = os.read(fd, 1024)
254  if len(rbuf) == 0:
255  fd_map[fd].close_in()
256 
257  p.unregister(fd)
258  del fd_map[fd]
259  else:
260  fd_map[fd].read_in(rbuf)
261 
def esMonitoring.DescriptorCapture.read_in (   self,
  rbuf 
)

Definition at line 227 of file esMonitoring.py.

References esMonitoring.DescriptorCapture.write_files.

Referenced by esMonitoring.DescriptorCapture.event_loop().

228  def read_in(self, rbuf):
229  for f in self.write_files:
230  f.write(rbuf)
231  f.flush()

Member Data Documentation

esMonitoring.DescriptorCapture.f

Definition at line 223 of file esMonitoring.py.

Referenced by Vispa.Views.RootCanvasView.RootCanvasView.createGraph(), and Vispa.Views.RootCanvasView.RootCanvasView.createLegoPlot().

esMonitoring.DescriptorCapture.fd

Definition at line 224 of file esMonitoring.py.

Referenced by progressbar.ProgressBar._handle_resize(), and esMonitoring.DescriptorCapture.close_in().

esMonitoring.DescriptorCapture.write_files

Definition at line 225 of file esMonitoring.py.

Referenced by esMonitoring.DescriptorCapture.read_in().