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 251 of file esMonitoring.py.

Constructor & Destructor Documentation

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

Definition at line 252 of file esMonitoring.py.

253  def __init__(self, f, write_files=[]):
254  self.f = f
255  self.fd = f.fileno()
256  self.write_files = write_files

Member Function Documentation

def esMonitoring.DescriptorCapture.close_in (   self)

Definition at line 262 of file esMonitoring.py.

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

Referenced by esMonitoring.DescriptorCapture.event_loop().

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

Definition at line 267 of file esMonitoring.py.

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

268  def event_loop(desc, timeout, timeout_call=None):
269  fd_map = {}
270  p = select.poll()
271 
272  for desc in desc:
273  fd_map[desc.fd] = desc
274  p.register(desc.fd, select.POLLIN)
275 
276  while len(fd_map) > 0:
277  events = p.poll(timeout)
278  if len(events) == 0:
279  if timeout_call:
280  timeout_call()
281 
282  for fd, ev in events:
283  rbuf = os.read(fd, 1024)
284  if len(rbuf) == 0:
285  fd_map[fd].close_in()
286 
287  p.unregister(fd)
288  del fd_map[fd]
289  else:
290  fd_map[fd].read_in(rbuf)
291 
def esMonitoring.DescriptorCapture.read_in (   self,
  rbuf 
)

Definition at line 257 of file esMonitoring.py.

References esMonitoring.DescriptorCapture.write_files.

Referenced by esMonitoring.DescriptorCapture.event_loop().

258  def read_in(self, rbuf):
259  for f in self.write_files:
260  f.write(rbuf)
261  f.flush()

Member Data Documentation

esMonitoring.DescriptorCapture.f

Definition at line 253 of file esMonitoring.py.

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

esMonitoring.DescriptorCapture.fd

Definition at line 254 of file esMonitoring.py.

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

esMonitoring.DescriptorCapture.write_files

Definition at line 255 of file esMonitoring.py.

Referenced by esMonitoring.DescriptorCapture.read_in().