From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.142.211.12 with SMTP id j12cs143186wfg; Wed, 1 Jun 2011 12:27:09 -0700 (PDT) Received: by 10.229.48.7 with SMTP id p7mr1485755qcf.249.1306956428426; Wed, 01 Jun 2011 12:27:08 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 10si2930813qcc.17.2011.06.01.12.27.08; Wed, 01 Jun 2011 12:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id D043B1678328; Wed, 1 Jun 2011 15:27:07 -0400 (EDT) X-Greylist: delayed 300 seconds by postgrey-1.31 at rubyforge.org; Wed, 01 Jun 2011 15:23:47 EDT Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by rubyforge.org (Postfix) with ESMTP id 61C661858346 for ; Wed, 1 Jun 2011 15:23:46 -0400 (EDT) X-AuditID: 1209190d-b7bdeae0000004f8-e7-4de690549a6c Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id 24.99.01272.45096ED4; Wed, 1 Jun 2011 15:17:40 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id p51JIjZ7027891 for ; Wed, 1 Jun 2011 15:18:45 -0400 Received: from mail-yi0-f50.google.com (mail-yi0-f50.google.com [209.85.218.50]) (authenticated bits=0) (User authenticated as afarrell@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p51JIir2018625 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 1 Jun 2011 15:18:45 -0400 (EDT) Received: by yie30 with SMTP id 30so73742yie.23 for ; Wed, 01 Jun 2011 12:18:44 -0700 (PDT) Received: by 10.236.180.34 with SMTP id i22mr8711155yhm.28.1306955924298; Wed, 01 Jun 2011 12:18:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.34.134 with HTTP; Wed, 1 Jun 2011 12:18:24 -0700 (PDT) In-Reply-To: <1306928873-sup-3234@PrxServer3> References: <1306928873-sup-3234@PrxServer3> From: Andrew Farrell Date: Wed, 1 Jun 2011 12:18:24 -0700 Message-ID: To: sup-talk X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprOKsWRmVeSWpSXmKPExsUixCmqrRsy4ZmvwZMOI4vpz9kcGD327ZvI HMAYxWWTkpqTWZZapG+XwJVxv2kaa8Et9Yrlf7UbGB8odjFyckgImEjcX7KPCcIWk7hwbz1b FyMXh5DAPkaJhk27oZwzjBJvO54yQzhPmST2/znHDtIiJFAjMbtxKjOEXSjx7dA/RhCbV0BQ 4uTMJywQcS+JQ89vgdmcAroSM6ZeYYWIJ0p8WboFbA6bgLpE9/kmsDiLgIrEpslbWCDmOEj8 fXIabL4wUP2vQ+fB6kUEVCV2dL0EO5sZaP7kpnamCYyCs5CsnoUkBWHrSLzre8AMYWtLrOo9 ywRjL1v4mnkBI+sqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXSO93MwSvdSU0k2M4NCW5N3B+O6g 0iFGAQ5GJR5e+YJnvkKsiWXFlbmHGCU5mJREeZf1A4X4kvJTKjMSizPii0pzUosPMUpwMCuJ 8BomPvUV4k1JrKxKLcqHSUlzsCiJ886UVPcVEkhPLEnNTk0tSC2CycpwcChJ8L4BGSpYlJqe WpGWmVOCkGbi4AQZzgM0fBtIDW9xQWJucWY6RP4UozHHhPVbDzJyzPuw/SCjEEtefl6qlDgv MzDBCAmAlGaU5sFNg6WnV4ziQM8J8z4GGcgDTG1w814BrWICWsUeA/JHcUkiQkqqgVGN+8rd p0xFd5v3H+tYlmvzWXdPwcKE98u8FOujk6pl3cwe2PVHJIhUPGS8f8XanP/Sj1kaL3vcd75j rVrQzzTzfOiU6Gme1fKTeZanWn4QYX1YuZjh1wNL3x02mxMZr/woDCkNKjR/lX3kvtxqlsue Jheu3tk/9Xj5U6mLzWsC9rrvnmAfqabEUpyRaKjFXFScCACzmFD6KgMAAA== Subject: Re: [sup-talk] before-poll.rb does not appear to be run. Where is PollManager defined? X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1890221880==" Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org --===============1890221880== Content-Type: multipart/alternative; boundary=20cf305e236b9adbfe04a4ab6356 --20cf305e236b9adbfe04a4ab6356 Content-Type: text/plain; charset=ISO-8859-1 > Name it before-poll.rb yes, I should have mentioned that I'd done that. > View the log by... Thank you! Using this, I found that the problem was that line 12 of the hook from http://sup.rubyforge.org/wiki/wiki.pl?TriggeringMailCollection was using SourceManager. 12 def inbox_sources(sources = SourceManager.sources) 13 sources.find_all { |s| !s.archived? }.sort_by {|s| s.id } 14 end I replaced SourceManager.sources with Index.usual_sources And it works. I've replaced the relevant code in the wiki. -- Andrew Farrell On Wed, Jun 1, 2011 at 4:52 AM, Ruthard Baudach wrote: > > === Andrew Farrell schrieb am 2011-06-01 05:54: === < > > I'm trying to add a before-poll.rb hook, but this appears not to be run. > > At least, it is not running offlineIMAP and if I insert a divide-by-zero, > > nothing explodes. > To create a hook, you have to put the hook-name.rb file in the > .sup/hooks folder, and it should be executed when the hook is called. > > No need to go source diving. > > You've got a log-line in your before-poll.rb, so you should see it's > activity in the log buffer. > > Just hit ; in inbox-mode, navigate to the line saying log-mode and hit > to view the log buffer. > > If your message shows up, the before-poll hook is executed, and does not > work. Happy debugging (I used to know no Ruby as well when I started > using sup, and it's still a foreign language to me) > > > - I'm inferring that "require 'sup' " is the equivalent of python's "from > > sup import *" > Yes, it is. > > Ruthard > _______________________________________________ > sup-talk mailing list > sup-talk@rubyforge.org > http://rubyforge.org/mailman/listinfo/sup-talk > --20cf305e236b9adbfe04a4ab6356 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
> Name it before-poll.rb
yes, I should have mentioned tha= t I'd done that.

> View the log by...
=
Thank you! Using this, I found that the problem was that line 12 of th= e hook from=A0
http://sup.rubyforge.org/wiki/wiki.pl?TriggeringMailCollection
was using SourceManager.
12 def inbox_sources(sources= =3D SourceManager.sources)
13 =A0 =A0 sources.find_all { |s| !s.archived? }.sort_by {|s| s.id }
14 end=A0

<= div>I replaced=A0SourceManager.sources= =A0with=A0Index.usual_sources
And it works.

I'v= e replaced the relevant code in the wiki.

-- Andre= w Farrell

= On Wed, Jun 1, 2011 at 4:52 AM, Ruthard Baudach <rthrd@web.de> wrote:
> =3D=3D=3D Andrew Farrell schrieb am 20= 11-06-01 05:54: =3D=3D=3D <
> I'm trying to add a before-poll.rb hook, but thi= s appears not to be run.
> At least, it is not running offlineIMAP and if I insert a divide-by-ze= ro,
> nothing explodes.
To create a hook, you have to put the hook-name.rb file in the
.sup/hooks folder, and it should be executed when the hook is called.

No need to go source diving.

You've got a log-line in your before-poll.rb, so you should see it'= s
activity in the log buffer.

Just hit ; in inbox-mode, navigate to the line saying log-mode and hit
<Enter> to view the log buffer.

If your message shows up, the before-poll hook is executed, and does not work. Happy debugging (I used to know no Ruby as well when I started
using sup, and it's still a foreign language to me)

> - I'm inferring that "require 'sup' " is the equ= ivalent of python's "from
> sup import *"
Yes, it is.

Ruthard
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

--20cf305e236b9adbfe04a4ab6356-- --===============1890221880== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk --===============1890221880==--