* [sup-talk] Sup sources question
@ 2007-11-08 11:18 Marcus Williams
2007-11-08 11:21 ` Marcus Williams
2007-11-12 4:03 ` William Morgan
0 siblings, 2 replies; 5+ messages in thread
From: Marcus Williams @ 2007-11-08 11:18 UTC (permalink / raw)
I cocked up when I set up one of my sources so that I added a sent
folder from imap to sup without the sent label.
What I thought I'd do is sup-dump, sup-sync everything again and then
restore my settings. Then I remembered I'd noticed that you have a
source_id in the ferret index, so I can search for messages marked
with that source_id and add the label in manually. The only problem is
I dont know the source_id (although its easy to find out in the
console.sh).
What I'm thinking is, rather than use an auto-generated id which I
assume is some index into the source.yaml could you not name the
sources in some way in the yaml so that you can then use this name to
look up certain sources? This would also stop your source.yaml and
your source_id's getting out of sync which I assume they can if you
add a source to your yaml file in the middle somewhere. On startup you
could check for uniqueness if needed.
Does this make sense?
Marcus
^ permalink raw reply [flat|nested] 5+ messages in thread
* [sup-talk] Sup sources question
2007-11-08 11:18 [sup-talk] Sup sources question Marcus Williams
@ 2007-11-08 11:21 ` Marcus Williams
2007-11-12 4:03 ` William Morgan
1 sibling, 0 replies; 5+ messages in thread
From: Marcus Williams @ 2007-11-08 11:21 UTC (permalink / raw)
On 8.11.2007, Marcus Williams wrote:
> What I'm thinking is, rather than use an auto-generated id which I
> assume is some index into the source.yaml could you not name the
> sources in some way in the yaml so that you can then use this name to
> look up certain sources? This would also stop your source.yaml and
> your source_id's getting out of sync which I assume they can if you
> add a source to your yaml file in the middle somewhere. On startup you
> could check for uniqueness if needed.
Rather embarrassingly, I just noticed the id flag in sources.yaml
which probably does exactly this :)
Ignore the noise..
^ permalink raw reply [flat|nested] 5+ messages in thread
* [sup-talk] Sup sources question
2007-11-08 11:18 [sup-talk] Sup sources question Marcus Williams
2007-11-08 11:21 ` Marcus Williams
@ 2007-11-12 4:03 ` William Morgan
2007-11-12 13:29 ` Marcus Williams
1 sibling, 1 reply; 5+ messages in thread
From: William Morgan @ 2007-11-12 4:03 UTC (permalink / raw)
Excerpts from Marcus Williams's message of Thu Nov 08 03:18:51 -0800 2007:
> What I thought I'd do is sup-dump, sup-sync everything again and then
> restore my settings. Then I remembered I'd noticed that you have a
> source_id in the ferret index, so I can search for messages marked
> with that source_id and add the label in manually.
Just curious if you managed to make this work. I sent an example to the
list a few weeks back about using console.sh to do just this sort of
thing.
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [sup-talk] Sup sources question
2007-11-12 4:03 ` William Morgan
@ 2007-11-12 13:29 ` Marcus Williams
2007-11-12 17:20 ` William Morgan
0 siblings, 1 reply; 5+ messages in thread
From: Marcus Williams @ 2007-11-12 13:29 UTC (permalink / raw)
On 12.11.2007, William Morgan wrote:
> Just curious if you managed to make this work. I sent an example to the
> list a few weeks back about using console.sh to do just this sort of
> thing.
Yep - cleaned up all of my sources without having to resync. I wrote a
little wrapper tool to do it, might clean up that and post it some
time. For info, the way I did it was almost exactly the way you
suggested (to be run in console.sh):
# remove inbox label and add sent label on all messages coming from a
# single source (id is 3)
Index.ferret.search_each("source_id:3", :limit => :all) do |id, score|
m = Index.build_message id
puts "Modifying #{m.id}\t[#{m.labels.join ','}]"
m.labels.uniq!
m.labels -= [:inbox] unless m.labels.include? :starred
m.labels += [:sent]
puts ".......to #{m.id}\t[#{m.labels.join ','}]"
Index.sync_message m
end
Index.ferret.optimize
I did notice some messages had a lot of repeated labels. Not sure why,
but calling uniq! fixed it.
Marcus
^ permalink raw reply [flat|nested] 5+ messages in thread
* [sup-talk] Sup sources question
2007-11-12 13:29 ` Marcus Williams
@ 2007-11-12 17:20 ` William Morgan
0 siblings, 0 replies; 5+ messages in thread
From: William Morgan @ 2007-11-12 17:20 UTC (permalink / raw)
Excerpts from Marcus Williams's message of Mon Nov 12 05:29:30 -0800 2007:
> I did notice some messages had a lot of repeated labels. Not sure why,
> but calling uniq! fixed it.
Interesting. Well, I'll throw a uniq into the index saving code for good
measure.
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-11-12 17:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-08 11:18 [sup-talk] Sup sources question Marcus Williams
2007-11-08 11:21 ` Marcus Williams
2007-11-12 4:03 ` William Morgan
2007-11-12 13:29 ` Marcus Williams
2007-11-12 17:20 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox