I wanted to do a quick demonstration of the TempConverter example in
the Trellis docs, and tried converting to what I'm guessing is more or
less correct for Reaction... so:
class TempConverter(Component):
F = maintain(lambda self: self.C * 1.8 + 32)
C = maintain(lambda self: (self.F - 32)/1.8)
@effect_method
def show_values(self):
print "Celsius......", self.C
print "Fahrenheit...", self.F
Then:
tc = TempConverter(C=100)
tc.F = 32
tc.C = -40
etc...
However the instantiation of TempConverter(C=100) gives me an error
(included below).
Do you have a simple example corresponding to the circular
dependencies of TempConverter, or is the error obvious to you?
Cheers!
- Charlie
Stack trace of errors follows....
------------------------
tc = TempConverter(C=100)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.5/site-packages/DecoratorTools-1.7-py2.5.egg/
peak/util/decorators.py", line 634, in __call__
File "/Users/charlie/Dev/svnroot/sandbox/charlie/__init__.py", line
96, in __class_call__
File "build/bdist.macosx-10.5-i386/egg/mext/reaction/stm/
controllers.py", line 239, in __exit__
File "build/bdist.macosx-10.5-i386/egg/mext/reaction/stm/
controllers.py", line 264, in new_txn
File "build/bdist.macosx-10.5-i386/egg/mext/reaction/stm/
controllers.py", line 239, in __exit__
File "build/bdist.macosx-10.5-i386/egg/mext/reaction/stm/
controllers.py", line 274, in _new_txn
File "build/bdist.macosx-10.5-i386/egg/mext/reaction/stm/
transactions.py", line 276, in __exit__
File "build/bdist.macosx-10.5-i386/egg/mext/reaction/stm/
transactions.py", line 549, in __exit__
File "build/bdist.macosx-10.5-i386/egg/mext/reaction/stm/
transactions.py", line 475, in __exit__
File "build/bdist.macosx-10.5-i386/egg/mext/reaction/stm/
controllers.py", line 274, in _new_txn
File "build/bdist.macosx-10.5-i386/egg/mext/reaction/stm/
controllers.py", line 264, in new_txn
File "/Users/charlie/Dev/svnroot/sandbox/charlie/__init__.py", line
84, in __class_call__
File "/Library/Python/2.5/site-packages/DecoratorTools-1.7-py2.5.egg/
peak/util/decorators.py", line 649, in __class_call__
File "/Users/charlie/Dev/svnroot/sandbox/charlie/__init__.py", line
46, in init_attrs
File "build/bdist.macosx-10.5-i386/egg/mext/reaction/component/
attrs.py", line 172, in __set__
AttributeError
--
Mailing list: http://groups.google.com/group/better-python
Unsubscribe: better-pytho...@googlegroups.com
To unsubscribe from this group, send email to better-python+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.