Changeset 78

Show
Ignore:
Timestamp:
04/02/02 15:14:56 (7 years ago)
Author:
sholloway
Message:

*** empty log message ***

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBJabber/RBJabber/SubjectObserver/StateMachine.py

    r77 r78  
    4646    _handled = 0 
    4747 
    48     def __init__(self, Description="", ReduceFn=and_): 
     48    def __init__(self, ReduceFn=and_, **kw): 
     49        self.__dict__.update(kw) 
    4950        super(State, self).__init__() 
    50         self.Description = Description  
    5151        self._Influxs = [] 
    5252        self._StateSubject = Subject() 
     
    7373 
    7474    def SetHandled(self): 
    75         self._handled = 1 
     75        self._handled += 1 
    7676 
    7777    def CheckInfluxs(self, subject, **kw): 
     
    9696def _Test_StateMachine(): 
    9797    def PrintDescription(StateSubject, precondition): 
    98         print StateSubject.Description, precondition 
     98        print StateSubject.__doc__ 
    9999        StateSubject.SetState() 
    100100 
    101     a = State("Initial").AddObserver(PrintDescription) 
    102     b = State("Middle B").AddObserver(PrintDescription) 
    103     c = State("Middle C").AddObserver(PrintDescription) 
    104     d = State("Final").AddObserver(PrintDescription) 
     101    a = State(__doc__="A").AddObserver(PrintDescription) 
     102    b = State(__doc__="B").AddObserver(PrintDescription) 
     103    c = State(__doc__="C").AddObserver(PrintDescription) 
     104    d = State(__doc__="D").AddObserver(PrintDescription) 
    105105 
    106106    b.AddInflux(a)