Changeset 121

Show
Ignore:
Timestamp:
04/22/02 17:24:15 (6 years ago)
Author:
brian
Message:

Bloody nonzero in statemachine was driving shane nutz. It is now... paralyzed?

Files:

Legend:

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

    r107 r121  
    5757    def __rand__(self, other): return int(self) and other 
    5858    def __and__(self, other): return int(self) and other 
    59     def __nonzero__(self): return int(self) 
     59    #def __nonzero__(self): return int(self) 
    6060    def __int__(self): return self.value 
    6161 
  • trunk/RBSkinning/RBSkinning/StateSkinTest.py

    r120 r121  
    3535states = dict([(x.name, x) for x in skin.Elements('state')]) 
    3636 
    37 def test(state, precondition): 
    38     print state.name, state.desc 
    39     state.SetState() 
    40     print "Done" 
     37#def test(state, precondition): 
     38#    print state.name, state.desc 
     39#    state.SetState() 
     40#    print "Done" 
    4141 
    42 for each in states.itervalues():  
    43     each.AddObserver(test) 
     42#for each in states.itervalues():  
     43#    each.AddObserver(test) 
    4444 
    4545states['Test1'].SetState() 
  • trunk/RBSkinning/RBSkinning/teststate.skin

    r120 r121  
    11<?xml version='1.0'?>  
    22<skin:skin xmlns:state='http://namespaces.runeblade.com/state' xmlns:skin='http://namespaces.runeblade.com/skin' xmlns:py='http://namespaces.runeblade.com/xmlPython'> 
     3    <py:inline> 
     4        from Foundation import ContextApply 
     5        self.AddNamespace(ContextApply) 
     6    </py:inline> 
    37    <!-- state stuff --> 
    4     <state:state name='Test1' desc='First State to test' /> 
    5     <state:state name='Test2' desc='Second State to test' /> 
    6     <state:state name='Test3' desc='Third State to test' /> 
     8    <state:state name='Test1' desc='First State to test' > 
     9        <py:inline> 
     10            parentObj.AddObserver(ContextApply_0(parentObj.SetState)) 
     11        </py:inline> 
     12    </state:state> 
     13    <state:state name='Test2' desc='Second State to test'> 
     14        <py:inline> 
     15            parentObj.AddObserver(ContextApply_0(parentObj.SetState)) 
     16        </py:inline> 
     17    </state:state> 
     18    <state:state name='Test3' desc='Third State to test'> 
     19        <py:inline> 
     20            #parentObj.AddObserver(ContextApply_0(parentObj.SetState)) 
     21            def test(state, precondition): 
     22                print " That TICKLES " 
     23                state.SetState() 
     24            parentObj.AddObserver(test) 
     25        </py:inline> 
     26    </state:state> 
    727    <state:arc start='Test1' end='Test2' /> 
    828    <state:arc start='Test2' end='Test3' />