All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
SerialSubstitution.ProcessorsList Class Reference

Public Member Functions

def __init__
 
def __iter__
 
def __len__
 
def SetOptions
 
def SetColors
 
def SelectProcessors
 
def ProcessDir
 
def AddProcessor
 
def Describe
 

Public Attributes

 options
 
 processors
 

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)

Definition at line 438 of file SerialSubstitution.py.

def __iter__(self): return iter(self.processors)
def SerialSubstitution.ProcessorsList.__len__ (   self)

Definition at line 439 of file SerialSubstitution.py.

440  def __len__(self): return len(self.processors)
def SerialSubstitution.ProcessorsList.AddProcessor (   self,
  processor 
)

Definition at line 472 of file SerialSubstitution.py.

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

Definition at line 477 of file SerialSubstitution.py.

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

Definition at line 464 of file SerialSubstitution.py.

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

Definition at line 448 of file SerialSubstitution.py.

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

Definition at line 445 of file SerialSubstitution.py.

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

Definition at line 441 of file SerialSubstitution.py.

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

Member Data Documentation

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: