On Wed, Jun 23, 2010 at 11:06:33PM +0100, David Greaves wrote:
>
> I've written a python class RuoteAMQP::Participant
> 
> http://meego.gitorious.org/meego-infrastructure-tools/boss/trees/master/integration/RuoteAMQP
> 
> It is part of the r-a demo in that project.
> 
> I've also put the code in http://github.com/lbt/ruote-amqp-pyclient

Hello David,

good work !

I have added a link to it to the ruote website :

  http://ruote.rubyforge.org/source.html


> #!/usr/bin/python
> import sys
> import os
> import random
> 
> # Just until Ruote-AMQP is in a proper place
> sys.path.append(os.path.dirname(__file__)+"/../../integration")
> 
> from  RuoteAMQP.workitem import Workitem
> from  RuoteAMQP.participant import Participant
> 
> import simplejson as json
> 
> class MyPart(Participant):
>     def consume(self):
>         wi = self.workitem
>         print "Got a workitem:"
>         print json.dumps(wi.to_h(), indent=4)
>         size=random.randint(500,1000)
>         print "\nSize is %s" % size
>         wi.set_field("image.size", size)
>         wi.set_result(True)
> 
> print "Started a python participant"
> p = MyPart(ruote_queue="sizer", amqp_host="amqpvm", amqp_vhost="ruote-test")
> p.run()

This would make for an excellent README.txt file in your source tree. Github 
automatically displays those README files at the bottom of your 
http://github.com/lbt/ruote-amqp-pyclient page. It would help pyple ;-) get a 
feeling on how to use your library.

Don't forget the tests.


Many thanks,

-- 
John Mettraux - http://jmettraux.wordpress.com

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to