From: Micah Anderson <micah@riseup.net>
To: sup-talk@rubyforge.org
Subject: [sup-talk] offlineimap before-poll.rb undefined method 'usual_sources'
Date: Fri, 13 Nov 2009 10:53:15 -0500 [thread overview]
Message-ID: <877htul8us.fsf@pond.riseup.net> (raw)
The before-poll.rb wiki example[0] seems to be what I am interested in,
however it doesn't work and provides a traceback. It reads as follows:
def offlineimap(*folders)
cmd = "offlineimap -q -u Noninteractive.Basic"
cmd << " -f #{folders * ','}" unless folders.compact.empty?
`#{cmd}`
end
def folder_names(sources)
sources.map { |s| s.uri.split('/').last }
end
def inbox_sources(sources = Index.usual_sources)
sources.find_all { |s| !s.archived? }.sort_by {|s| s.id }
end
if (@last_fetch || Time.at(0)) < Time.now - 120
say "Running offlineimap..."
# only check non-auto-archived sources on the first run
log offlineimap(@last_fetch ? nil : folder_names(inbox_sources))
say "Finished offlineimap run."
end
@last_fetch = Time.now
When I use this hook, i get this traceback in my sup log:
[Fri Nov 13 10:51:28 -0500 2009] hook: error running hook: undefined method `usual_sources' for #<Redwood::FerretIndex:0xb7520a64>
[Fri Nov 13 10:51:28 -0500 2009] hook: /usr/lib/ruby/1.8/sup/util.rb:520:in `send'
/usr/lib/ruby/1.8/sup/util.rb:520:in `method_missing'
/home/micah/.sup/hooks/before-poll.rb:11:in `inbox_sources'
/home/micah/.sup/hooks/before-poll.rb:18:in `__run'
/usr/lib/ruby/1.8/sup/hook.rb:42:in `__run'
/usr/lib/ruby/1.8/sup/hook.rb:82:in `run'
/usr/lib/ruby/1.8/sup/util.rb:520:in `send'
/usr/lib/ruby/1.8/sup/util.rb:520:in `method_missing'
/usr/lib/ruby/1.8/sup/poll.rb:45:in `poll'
/usr/lib/ruby/1.8/sup/util.rb:520:in `send'
/usr/lib/ruby/1.8/sup/util.rb:520:in `method_missing'
/usr/bin/sup-mail:195
/usr/lib/ruby/1.8/sup.rb:76:in `reporting_thread'
/usr/lib/ruby/1.8/sup.rb:74:in `initialize'
/usr/lib/ruby/1.8/sup.rb:74:in `new'
/usr/lib/ruby/1.8/sup.rb:74:in `reporting_thread'
/usr/bin/sup-mail:195
/usr/lib/ruby/1.8/sup/modes/thread-index-mode.rb:669:in `call'
/usr/lib/ruby/1.8/sup/modes/thread-index-mode.rb:669:in `__unprotected_load_threads'
/usr/lib/ruby/1.8/sup/modes/thread-index-mode.rb:610:in `call'
/usr/lib/ruby/1.8/sup/modes/thread-index-mode.rb:610:in `load_n_threads_background'
/usr/lib/ruby/1.8/sup.rb:76:in `reporting_thread'
/usr/lib/ruby/1.8/sup.rb:74:in `initialize'
/usr/lib/ruby/1.8/sup.rb:74:in `new'
/usr/lib/ruby/1.8/sup.rb:74:in `reporting_thread'
/usr/lib/ruby/1.8/sup/modes/thread-index-mode.rb:608:in `load_n_threads_background'
/usr/lib/ruby/1.8/sup/modes/thread-index-mode.rb:679:in `__unprotected_load_threads'
(eval):12:in `load_threads'
/usr/bin/sup-mail:195
Thanks,
micah
0. http://sup.rubyforge.org/wiki/wiki.pl?Hooks
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
next reply other threads:[~2009-11-13 16:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 15:53 Micah Anderson [this message]
2009-11-14 0:12 ` Gaute Hope
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877htul8us.fsf@pond.riseup.net \
--to=micah@riseup.net \
--cc=sup-talk@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox