CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

Mixins::_Labelable Class Reference

Inheritance diagram for Mixins::_Labelable:
Modules::_Module Modules::ESPrefer Modules::ESProducer Modules::ESSource SequenceTypes::_ModuleSequenceType SequenceTypes::DummyModule Modules::EDAnalyzer Modules::EDFilter Modules::EDProducer Modules::OutputModule SequenceTypes::EndPath SequenceTypes::Path SequenceTypes::Sequence

List of all members.

Public Member Functions

def __str__
def dumpSequenceConfig
def dumpSequencePython
def hasLabel_
def label
def label_
def setLabel

Private Member Functions

def _findDependencies

Private Attributes

 __label

Detailed Description

A 'mixin' used to denote that the class can be paired with a label (e.g. an EDProducer)

Definition at line 398 of file Mixins.py.


Member Function Documentation

def Mixins::_Labelable::__str__ (   self)

Reimplemented in SequenceTypes::_ModuleSequenceType.

Definition at line 411 of file Mixins.py.

00412                      :
00413         #this is probably a bad idea
00414         # I added this so that when we ask a path to print
00415         # we will see the label that has been assigned
        return str(self.__label)
def Mixins::_Labelable::_findDependencies (   self,
  knownDeps,
  presentDeps 
) [private]

Definition at line 420 of file Mixins.py.

00421                                                      :
00422         #print 'in labelled'
00423         myDeps=knownDeps.get(self.label_(),None)
00424         if myDeps!=None:
00425             if presentDeps != myDeps:
00426                 raise RuntimeError("the module "+self.label_()+" has two dependencies \n"
00427                                    +str(presentDeps)+"\n"
00428                                    +str(myDeps)+"\n"
00429                                    +"Please modify sequences to rectify this inconsistency")
00430         else:
00431             myDeps=set(presentDeps)
00432             knownDeps[self.label_()]=myDeps
00433         presentDeps.add(self.label_())
00434 

def Mixins::_Labelable::dumpSequenceConfig (   self)

Reimplemented in SequenceTypes::_ModuleSequenceType.

Definition at line 416 of file Mixins.py.

00417                                 :
        return str(self.__label)
def Mixins::_Labelable::dumpSequencePython (   self)

Reimplemented in SequenceTypes::_ModuleSequenceType.

Definition at line 418 of file Mixins.py.

00419                                 :
        return 'process.'+str(self.__label)
def Mixins::_Labelable::hasLabel_ (   self)

Definition at line 406 of file Mixins.py.

00407                        :
        return hasattr(self, "_Labelable__label") and self.__label is not None
def Mixins::_Labelable::label (   self)

Definition at line 408 of file Mixins.py.

00409                    :
00410         #print "WARNING: _Labelable::label() needs to be changed to label_()"
        return self.__label
def Mixins::_Labelable::label_ (   self)

Definition at line 402 of file Mixins.py.

00403                     :
00404         if not hasattr(self, "_Labelable__label"):
00405            raise RuntimeError("module has no label.  Perhaps it wasn't inserted into the process?")
        return self.__label
def Mixins::_Labelable::setLabel (   self,
  label 
)

Definition at line 400 of file Mixins.py.

00401                             :
        self.__label = label

Member Data Documentation

Definition at line 400 of file Mixins.py.