[Reality] in ambulation.Room where is IWalkTarget?

Lee Harr reality@twistedmatrix.com
Sat, 05 Jul 2003 17:59:43 +0000


>>I'm not entirely sure, but I think it has something to do with the 
>>metaclass of either TargetAction or MovementEvent.
>
>It's TargetAction.  All actions have certain "slots" that have to be 
>filled, and each slot has a corresponding interface.  For TargetAction, 
>those slots are Place, Target, and Actor.  You can see this defined with 
>the attribute 'interfaceTypes' in reality.actions.TargetAction.
>

Ah. ok... Looks like the magic happens in Action.subclassed()
This little patch will let you see the magic in action ;o)


>cvs diff -u reality/actions.py
Index: reality/actions.py
===================================================================
RCS file: /cvs/NewReality/reality/actions.py,v
retrieving revision 1.15
diff -u -r1.15 actions.py
--- reality/actions.py  25 May 2003 03:24:08 -0000      1.15
+++ reality/actions.py  5 Jul 2003 17:53:32 -0000
@@ -79,6 +79,11 @@
             iface = _typecopy(idefault, iname, 
methodPostfix=klass.__name__)
             iface.__module__ = klass.__module__
             setattr(mod, iname, iface)
+            print 'mod', mod
+            print 'iname', iname
+            print 'iface', iface
+            print
+            print
     subclassed = classmethod(subclassed)





I put in this patch then run something like sandbox/example1.py and
you can watch as the interfaces are generated and sorted in to their
proper places.

Not sure I understand this yet... but at least I see where it happens.

Thanks for your time.

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail