Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] Toggling usual status of sources
@ 2010-05-12  0:28 Ben Walton
  2010-05-12  4:44 ` Tero Tilus
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Walton @ 2010-05-12  0:28 UTC (permalink / raw)
  To: sup-devel

Hi All,

I'm looking to redefine my mail storage and want to implement a somewhat 
unorthodox hook[1].  I want to dynamically add new sources to sup while 
sup is running using the after-poll hook.

So far, I've succeeded in adding a source with the following:

--snip--
u = "maildir:/u/bwalton/Maildir/.test2/"

unless Redwood::SourceManager.source_for(u)
   Redwood::Logger.force_message "test2 not setup yet." 

   Redwood::SourceManager.add_source 
Recoverable.new(Redwood::Maildir.new(u)) un\
less Redwood::SourceManager.source_for(u)
end
--snip--

(Sorry about the wrapping...Thunderbird is driving me nuts.)

Now, what I really want to do is something like:

--snip--
d = Date.today
s = "maildir:/u/bwalton/Maildir/.incoming.#{d.year}.#{d.strftime('%m')}"

unless Redwood::SourceManager.source_for(s)
   # determine currently 'primary' source (decrement month,
   # possibly wrap month to 12 and decrement year)
   #add source
   #toggle usual status on previous source
end
--snip--

I don't see a way, currently, to toggle that flag.  Would there be 
objections to adding support for that?  Is what I'm proposing _too_ nuts?

I already have my procmail recipe delivering into the 
.incoming.$year.$month folders and have given up filing individual lists 
into separate folders...With a good before-add-message hook, I can give 
up on assigning labels based on folders and just have monthly mailboxes 
that are added automatically. :)

Thoughts?

Thanks
-Ben

[1] This is along the lines of my 'patterned/dynamic source' idea that I 
briefly described a few nights back, but I think that was eaten...
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [sup-devel] Toggling usual status of sources
  2010-05-12  0:28 [sup-devel] Toggling usual status of sources Ben Walton
@ 2010-05-12  4:44 ` Tero Tilus
  2010-05-13 14:15   ` Ben Walton
  0 siblings, 1 reply; 3+ messages in thread
From: Tero Tilus @ 2010-05-12  4:44 UTC (permalink / raw)
  To: sup-devel

Ben Walton, 2010-05-12 03:28:
>    #toggle usual status on previous source
> [...]
> I don't see a way, currently, to toggle that flag.  Would there be
> objections to adding support for that?  Is what I'm proposing _too_
> nuts?

Not at all.  If you do that, I'll switch to rotating inbox.

> [1] This is along the lines of my 'patterned/dynamic source' idea
> that I briefly described a few nights back, but I think that was
> eaten...

Patterned/dynamic/recursive sources are in my todo-list.  Haven't got
around implementing it yet.  Gave it some thought though.  Did you
consider them "virtual" (as in bunch of "physical" maildir/mbox stores
made transparently look like one source) or "meta" (as in template
source which sup uses to generate a set of "physical" sources)?  Which
one would be better?

I think rotating inbox would pretty clean to implement using either
"virtual" or "meta" source.  If either of them ever got implemented.

-- 
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [sup-devel] Toggling usual status of sources
  2010-05-12  4:44 ` Tero Tilus
@ 2010-05-13 14:15   ` Ben Walton
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Walton @ 2010-05-13 14:15 UTC (permalink / raw)
  To: sup-devel

Excerpts from Tero Tilus's message of Wed May 12 00:44:29 -0400 2010:

> Not at all.  If you do that, I'll switch to rotating inbox.

Cool!

> > [1] This is along the lines of my 'patterned/dynamic source' idea
> > that I briefly described a few nights back, but I think that was
> > eaten...
> 
> Patterned/dynamic/recursive sources are in my todo-list.  Haven't
> got around implementing it yet.  Gave it some thought though.  Did
> you consider them "virtual" (as in bunch of "physical" maildir/mbox
> stores made transparently look like one source) or "meta" (as in
> template source which sup uses to generate a set of "physical"
> sources)?  Which one would be better?

I was thinking meta, but virtual is interesting too.  I _think_ that
meta would be easier to implement given the current code structure.  I
also think having each of the 'dynamic' sources listed explicitly in
sources.yaml has some merit.

Thanks
-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-13 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-12  0:28 [sup-devel] Toggling usual status of sources Ben Walton
2010-05-12  4:44 ` Tero Tilus
2010-05-13 14:15   ` Ben Walton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox