Re: Ampoule deferToAMPProcess confusion

[email protected]
Newsgroups gmane.comp.python.twisted.web
Message-ID <20111015004902.23178.1028039699.divmod.xquotient.437@localhost.localdomain>
On 14 Oct, 09:41 pm, [email protected] wrote:
>Can someone point me to some good docs on Ampoule deferToAMPProcess?
>I am trying in vain to get the simplest possible example working, with 
>no
>success.
>
>from ampoule import deferToAMPProcess, util
>from twisted.internet import reactor, defer
>
>def test():
>    return "TEST"
>
>@util.mainpoint
>def main(args):
>
>    @defer.inlineCallbacks
>    def _run():
>        val = yield deferToAMPProcess(test)
>        print val
>        reactor.stop()
>
>    reactor.callLater(1, _run)
>    reactor.run()
>
>Gives:
>
>exceptions.AttributeError: 'str' object has no attribute '_doCommand'
>
>I've tried different combinations, returnd Deferreds from the test()
>function, inline callbacks with defer.returnValue().
>Can't get it to work.
>
>Looks like I am not the only one:
>
>https://answers.launchpad.net/ampoule/+question/75143

The test suite exercises this API:

http://bazaar.launchpad.net/~dialtone/ampoule/main/view/head:/ampoule/test/test_process.py#L498

Note in particular that it takes a Command, not a function.

Jean-Paul
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.