filtering on poster
This commit is contained in:
parent
7720fca967
commit
67d17ba6ef
5 changed files with 36 additions and 3 deletions
|
|
@ -1,5 +1,10 @@
|
|||
# $Dwarf: CHANGELOG,v 1.39 2005/05/10 20:52:58 ward Exp $
|
||||
# $Source$
|
||||
# $Id$
|
||||
# $URL$
|
||||
|
||||
from 0.5.3 to ...
|
||||
- filtering on posters useing OPT_IF, OPT_XF, OPT_MRF
|
||||
- cacheconverter2 to convert caches (or just throw them away)
|
||||
- OPT_CP also includes poster in combined name
|
||||
|
||||
from 0.5.2 to 0.5.3
|
||||
- fix the occasional deadlock
|
||||
|
|
|
|||
|
|
@ -116,16 +116,20 @@ Supported config options:
|
|||
-------------------------
|
||||
|
||||
OPT_I=<pattern> Set include pattern.
|
||||
OPT_IF=<patter> Set include from pattern. Filters on poster.
|
||||
OPT_L=<bool> Set long filenames.
|
||||
OPT_C=<bool> Sets combined filenames.
|
||||
OPT_CP=<bool> Sets poster combined filenames.
|
||||
OPT_X=<pattern> Set exclude pattern. Ripnews will read articles
|
||||
matching this pattern but it will not attempt
|
||||
to download them.
|
||||
OPT_XF=<pattern> Set exclude from pattern. Filters on posters.
|
||||
OPT_MR=<pattern> Set "mark read" pattern. Ripnews will place
|
||||
articles matching this pattern in your newsrc,
|
||||
afterwards they will never be present in memory
|
||||
again. Great for reducing memory usage when
|
||||
checking a group for the first time.
|
||||
OPT_MRF=<patter> Set "mark read from" pattern. Filters on posters.
|
||||
OPT_MRR=<bool> Mark Remaining Read. If this is set to
|
||||
true and the article doesn't match an exclude or
|
||||
include pattern, the article will be
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
[ ] there is a bug in handling half fetched parts, they'll be fetched
|
||||
twice this should be buffered until it's gotten correctly, then
|
||||
added to the main buffer
|
||||
[ ] match on poster
|
||||
[ ] running without a tempdir doesn't work at all
|
||||
[ ] don't drop connections to servers when switching groups
|
||||
[ ] keep connections to newsservers alive (don't timeout)
|
||||
|
|
|
|||
|
|
@ -659,6 +659,15 @@ def get_group_subjects
|
|||
return @groups.keys
|
||||
end
|
||||
|
||||
def get_group_poster(subj)
|
||||
group_subject_sort(subj)
|
||||
unless @groups[subj]["messageinfo"] != nil && @groups[subj]["messageinfo"][0][:from]
|
||||
p "ieks komt niet door lame check heen"
|
||||
return false
|
||||
end
|
||||
return @groups[subj]["messageinfo"][0][:from]
|
||||
end
|
||||
|
||||
def group_is_complete(subj)
|
||||
group_subjects unless @grouped
|
||||
#print "Subject: #{subj}\n"
|
||||
|
|
|
|||
|
|
@ -570,6 +570,14 @@ def output_data(subject, mode, filename="", body="")
|
|||
if outfile.length > @maxfilelength
|
||||
outfile = filename[0...@maxfilelength]
|
||||
end
|
||||
elsif @config[group].has_key?("-CP") and @config[group]["-CP"]
|
||||
print "combinedname\n" if Debuglevel > 1
|
||||
poster = @articles.get_group_poster(subject)
|
||||
outfile = sub[0...@maxfilelength-poster.length-filename.length-6]
|
||||
outfile = "#{outfile} [#{poster}] [#{filename}]"
|
||||
if outfile.length > @maxfilelength
|
||||
outfile = filename[0...@maxfilelength]
|
||||
end
|
||||
else
|
||||
print "shortname\n" if Debuglevel > 1
|
||||
outfile = filename[0...@maxfilelength]
|
||||
|
|
@ -704,15 +712,23 @@ def main
|
|||
|
||||
for subj in @articles.get_group_subjects.sort{|a, b| ward_sort(a, b)}
|
||||
print "#{subj}\n" if Debuglevel > 2
|
||||
poster = @articles.get_group_poster(subj)
|
||||
# explicitly mark as read
|
||||
if @config[group].has_key?("-MR") and subj =~ /#{@config[group]["-MR"]}/
|
||||
print "Marking '#{subj}' as read\n"
|
||||
_mark_read(subj)
|
||||
# get the juicy bits
|
||||
elsif @config[group].has_key?("-MRF") and poster =~ /#{@config[group]["-MRF"]}/
|
||||
print "Marking poster '#{poster}' as read\n"
|
||||
_mark_read(subj)
|
||||
elsif !(@config[group].has_key?("-X") and subj =~ /#{@config[group]["-X"]}/) and
|
||||
subj =~ /#{@config[group]["-I"]}/
|
||||
print "Match: #{subj}\n" if Debuglevel > 0
|
||||
_get_article(subj, group)
|
||||
elsif !(@config[group].has_key?("-XF") and poster =~ /#{@config[group]["-XF"]}/) and
|
||||
@config[group].has_key?("-IF") and poster =~ /#{@config[group]["-IF"]}/
|
||||
print "Poster match: #{poster}\n" if Debuglevel > 0
|
||||
_get_article(subj, group)
|
||||
else
|
||||
_mark_remaining(subj, group)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue