[00:15:32] nice... http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252525 [02:43:16] ** gpciceri has joined us [03:32:28] ** hazmat has joined us [04:05:34] jack-e|away is now known as jack-e [04:05:38] morning [04:09:25] morning [07:57:23] ** queuetue has joined us [07:57:32] Hi, all. [08:36:23] moreingn [08:36:33] ...morning [08:45:50] Is PEAK deployed anywhere? What's it actually being used for? (or, conversely, what is it's first intended use?) [09:23:47] ** gpciceri has joined us [09:51:37] ** queuetue has left us [10:18:34] ** vlado_ has joined us [10:29:06] ah, gpciceri hangs out in #supybot too [10:29:27] hello Maniac [10:29:37] hi [10:29:39] time for a question? [10:29:42] sure [10:29:55] I've seen the twisted tutorial... [10:30:24] the Finger Service that is offered to the external in several manners (web, xmlrpc, ircbot) [10:30:57] I wonder woh to obtain the same thing with peak (and jabber bot) [10:31:03] how to obtain... [10:32:06] I've studied your pybot [10:32:49] and there the service is offered only through jabber client interface [10:32:57] any idea ? [10:33:17] what are you referring to when you say "the service" [10:33:45] what i'm attempting to do is offer the plugins via several "transports" ie. IRC, jabber [10:33:55] essentially, a class that implement the desired behaviour [10:34:08] Maniac, yes [10:34:18] the idea is the same [10:34:43] but with non-IRC type transports, too (line xmlrpc, for example) [10:35:16] well, just peaking at the twisted tutorial i can't see why you can't do it in a similar way [10:36:34] Maniac, I'm missing the peak way to specify a multi-port server [10:36:42] ah [10:36:48] link in the twisted tutorial [10:37:07] you mean multi-port / multi-protocol server [10:37:44] yes, a server that serve simultaneousy xmlrpc and jabber bot requests, for example [10:37:45] i would just define my server "components" and let them "Obtain" my service [10:37:59] and have them all start "uponAssembly" [10:38:07] so this is the way [10:38:07] one sec.. [10:38:19] i thought i had an example somewhere.. [10:41:09] let's see if i get floodkicked: [10:41:12] #peak imports [10:41:12] from peak.api import * [10:41:12] from peak.running.commands import EventDriven [10:41:12] from peak.util.imports import importString [10:41:12] #twisted imports [10:41:14] from twisted.web import xmlrpc, server [10:41:19] #local imports [10:41:22] from jabberclient import JabberClient [10:41:24] #from rdm.net.jabber.jabberclient import JabberClient [10:41:27] #from rdm.net.jabber.interfaces import * [10:41:29] from xrnote import XRNoteReceiver [10:41:35] class Runner(EventDriven): [10:41:40] log = binding.Obtain('logging.logger:peakfiy.logs', offerAs=['app.log']) [10:41:45] myapp = binding.Make(lambda: config.Namespace('peakify')) [10:41:48] port = binding.Obtain('myapp/receiver-port', offerAs=['xmlrpc.port']) [10:41:51] jabberhost= binding.Obtain('myapp/jabberhost', offerAs=['jabberhost']) [10:41:54] jidstring = binding.Obtain('myapp/myJid', offerAs=['bot.jid']) [10:41:57] recipient = binding.Obtain('myapp/recipient', offerAs=['recipient']) [10:42:00] secret = binding.Obtain('myapp/secret', offerAs=['secret']) [10:42:03] reactor = binding.Obtain(running.ITwistedReactor, offerAs=[running.IBasicReactor]) [10:42:08] bot = binding.Make(JabberClient,uponAssembly=True, offerAs=['jabberbot']) [10:42:11] receiver = binding.Make(XRNoteReceiver,uponAssembly=True, offerAs=['xmlrpc_receiver']) [10:42:17] my little paste there was a little test i wrote it start two "services" i.e. the jabberbot and an xmlrpc receiver [10:42:21] (as an example) [10:42:42] you could start as many as you wanted [10:42:46] ** ildave75 has joined us [10:43:00] Maniac, THX a lot [10:43:27] in this case the xmlrpc_receiver used: bot = binding.Obtain(PropertyName('jabberbot')) [10:43:36] and then used bot methods [10:44:00] the components just need to be able to find themselves [10:44:09] which binding is great for. [10:44:47] * Maniac notes none of the above code actually works anymore.... [10:45:36] Maniac, I'll try to let it work again [10:46:18] what is xrnote ? [10:46:29] one sec [10:46:44] #peak imports [10:46:44] from peak.api import * [10:46:44] #twisted imports [10:46:44] from twisted.web import xmlrpc, server [10:46:48] class XRNoteReceiver(binding.Component,xmlrpc.XMLRPC): [10:46:51] reactor = binding.Obtain(running.ITwistedReactor) [10:46:53] port = binding.Obtain(PropertyName('xmlrpc.port')) [10:46:56] log = binding.Obtain(PropertyName('app.log')) [10:46:59] bot = binding.Obtain(PropertyName('jabberbot')) [10:47:01] recipient = binding.Obtain(PropertyName('recipient')) [10:47:06] def xmlrpc_receive(self,note): [10:47:11] self.log.info('received: '+ note) [10:47:14] self.bot.sendmsg(note,self.recipient) [10:47:16] return xmlrpc.Boolean(1) [10:47:24] def __onStart(self): [10:47:24] self.reactor.listenTCP(self.port,server.Site(self)) [10:47:27] self.log.info('starting XRNoteReceiver') [10:47:29] self.reactor.run() [10:47:34] __onStart = binding.whenAssembled(__onStart) [10:47:37] again these things were just test code [10:47:49] o.k. [10:49:04] i dont' think you need self.reactor.run() (event driven should start the reactor for you) [10:59:57] hello ildave75 what brings you to #peak [10:59:57] ? [11:14:23] ** ildave75 has left us [13:11:24] jack-e is now known as jack-e|away [14:38:41] ** _jpl_ has joined us [14:43:59] ** hazmat has joined us [15:06:45] * Maniac notices _jpl_ [15:06:48] * Maniac waves [15:24:42] <_jpl_> Hi [19:43:58] ** hazmat has joined us [23:53:00] * Maniac looks around