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

Constructor & Destructor Documentation

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

Definition at line 227 of file esMonitoring.py.

228  def __init__(self, f, write_files=[]):
229  self.f = f
230  self.fd = f.fileno()
231  self.write_files = write_files

Member Function Documentation

def esMonitoring.DescriptorCapture.close_in (   self)

Definition at line 237 of file esMonitoring.py.

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

Referenced by esMonitoring.DescriptorCapture.event_loop().

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

Definition at line 242 of file esMonitoring.py.

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

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

Definition at line 232 of file esMonitoring.py.

References esMonitoring.DescriptorCapture.write_files.

Referenced by esMonitoring.DescriptorCapture.event_loop().

233  def read_in(self, rbuf):
234  for f in self.write_files:
235  f.write(rbuf)
236  f.flush()

Member Data Documentation

esMonitoring.DescriptorCapture.f

Definition at line 228 of file esMonitoring.py.

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

esMonitoring.DescriptorCapture.fd

Definition at line 229 of file esMonitoring.py.

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

esMonitoring.DescriptorCapture.write_files

Definition at line 230 of file esMonitoring.py.

Referenced by esMonitoring.DescriptorCapture.read_in().