On 06/25/2012 01:11 PM, Burak Arslan wrote:
On 06/25/12 20:29, C Anthony Risinger wrote:
hello,
while briefly trying to update to the spyne codebase, i am
encountering an AssertionError due to spyne enforcing a 1-to-1 mapping
between MethodDescriptor and the function it wraps:
File "/path/to/spyne/interface/_base.py", line 224, in
populate_interface
assert not s.get_method_id(method) in self.method_id_map
AssertionError
<snip>
i haven't spent much time investigating, but why is this restriction
necessary?
This was so that you don't accidentally overwrite functions. But it
seems like my assumptions were wrong.
the solution ATM means needlessly wrapping _proxy for each method
with a module level function, since lambdas probably wouldn't work
either (albeit, i didn't try :-)
how can i solve this cleanly, or better, patch spyne to not care what
callable actually implements the method (since the pattern was working
rather nicely)?
I couldn't run your code, (I don't have the awesome package)
yeah if it's not obvious i changed the name, but that file is just pure
autogenerated Model definitions, so you can sub with any file that
contains request Models and corresponding METHOD+'Response' Models, and
it *should* work :-)
but the
responsible for this is the get_method_id in ServiceBase.
https://github.com/arskom/spyne/blob/master/spyne/service.py#L200
Does replacing the 'descriptor.function.__name__' with 'descriptor.name'
solve your problem?
eureka! yes, either changing to a set() or using descriptor.name solves
the issue, thanks!
so now i just need to crack the "self-import" problem ....
--
C Anthony
-----------------------------------------
CONFIDENTIALITY: The information contained in this communication may be
confidential and is intended only for the use of the intended recipient(s). If
the reader of this message is not the intended recipient(s), you are hereby
notified that
any dissemination, distribution, or copying of this communication, or any of
its contents, is strictly prohibited. If you have received this communication
in error, please return it to the sender immediately and delete any copy of it
from your computer system.
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap