Public Member Functions | Public Attributes | Static Public Attributes | List of all members
SerialSubstitution.ProcessorsList Class Reference

Public Member Functions

def __init__ (self)
 
def __iter__ (self)
 
def __len__ (self)
 
def SetOptions (self, options)
 
def SetColors (self, colors)
 
def SelectProcessors (self, ProcessorNames)
 
def ProcessDir (self, DirPath)
 
def AddProcessor (self, processor)
 
def Describe (self)
 

Public Attributes

 options
 
 processors
 

Static Public Attributes

 Global
 

Detailed Description

Definition at line 432 of file SerialSubstitution.py.

Constructor & Destructor Documentation

def SerialSubstitution.ProcessorsList.__init__ (   self)

Member Function Documentation

def SerialSubstitution.ProcessorsList.__iter__ (   self)
def SerialSubstitution.ProcessorsList.__len__ (   self)

Definition at line 439 of file SerialSubstitution.py.

def SerialSubstitution.ProcessorsList.AddProcessor (   self,
  processor 
)

Definition at line 472 of file SerialSubstitution.py.

472  def AddProcessor(self, processor):
473  self.processors.append(processor)
474  return processor
def SerialSubstitution.ProcessorsList.Describe (   self)

Definition at line 477 of file SerialSubstitution.py.

477  def Describe(self):
478  output = [ "There are %d processors in queue" % len(self) ]
479  for processor in self:
480  output.extend(processor.Describe())
481  return output
def SerialSubstitution.ProcessorsList.ProcessDir (   self,
  DirPath 
)

Definition at line 464 of file SerialSubstitution.py.

464  def ProcessDir(self, DirPath):
465  ApplyChangesMsg = "changed" if self.options.DoIt else "would be changed"
466  nChanged = 0
467  for processor in self: nChanged += processor.ProcessDir(DirPath)
468  logging.info("%d file %s under '%s'", nChanged, ApplyChangesMsg, DirPath)
469  return nChanged
def SerialSubstitution.ProcessorsList.SelectProcessors (   self,
  ProcessorNames 
)

Definition at line 448 of file SerialSubstitution.py.

448  def SelectProcessors(self, ProcessorNames):
449  if ProcessorNames is None: return
450  selected = []
451  for ProcessorName in ProcessorNames:
452  for Processor in self.processors:
453  if Processor.name != ProcessorName: continue
454  selected.append(Processor)
455  break
456  else:
457  raise RuntimeError \
458  ("Unknown processor '%s' selected" % ProcessorName)
459  # for ... else
460  # for processor names
461  self.processors = selected
def SelectProcessors(self, ProcessorNames)
def SerialSubstitution.ProcessorsList.SetColors (   self,
  colors 
)

Definition at line 445 of file SerialSubstitution.py.

445  def SetColors(self, **colors):
446  for processor in self: processor.SetColors(**colors)
447 
def SerialSubstitution.ProcessorsList.SetOptions (   self,
  options 
)

Definition at line 441 of file SerialSubstitution.py.

441  def SetOptions(self, options):
442  self.options = options
443  for processor in self: processor.SetOptions(options)
444 

Member Data Documentation

SerialSubstitution.ProcessorsList.Global
static

Definition at line 486 of file SerialSubstitution.py.

SerialSubstitution.ProcessorsList.options

Definition at line 434 of file SerialSubstitution.py.

SerialSubstitution.ProcessorsList.processors

Definition at line 435 of file SerialSubstitution.py.


The documentation for this class was generated from the following file: