From 5590a47f21ddd7ebebc0208255b035b188c76444 Mon Sep 17 00:00:00 2001 From: Ward Wouts Date: Sun, 5 May 2002 22:18:44 +0000 Subject: [PATCH] don't sort unless you're going to safe a group and then only sort that group --- trunk/ripnews/news/article.rb | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/trunk/ripnews/news/article.rb b/trunk/ripnews/news/article.rb index 0e37d7b..59ffc79 100644 --- a/trunk/ripnews/news/article.rb +++ b/trunk/ripnews/news/article.rb @@ -125,7 +125,7 @@ def get_articles(cachedir=false) # end # end end - subject_sort unless @sorted # store cache sorted +# subject_sort unless @sorted # store cache sorted save_cache(cachedir) end @@ -178,7 +178,9 @@ def get_group_body_rest(subj, file=nil) print "Server: #{@groups[subj]["servers"][i]}\n" print "Messid: #{@groups[subj]["messages"][i]}\n" resp, id, messid, list = @connections[@groups[subj]["servers"][i]]["nntp"].body(@groups[subj]["messages"][i]) - + if resp == false + return false + end rescue Net::NNTPReplyError print "Caught Net::NNTPReplyError reading article #{@groups[subj]["messages"][0]}\n" return false @@ -238,7 +240,7 @@ end def group_subjects @groups = {} - subject_sort unless @sorted + #subject_sort unless @sorted prev_subj = "" for i in (0...@subjects.length) print "group subjects: #{i} #{@subjects[i]}\n" if Debuglevel > 1 @@ -302,7 +304,7 @@ def read_cache(cachedir) if FileTest.directory?( cachedir) and FileTest.file?( filename ) and FileTest.readable?( filename ) file = File.new( filename ) lines = file.readlines - for line in lines + lines.collect{|line| #print "line: #{line}\n" if line =~ /^(.*?)\|(\d+)\|(.*?)\|(.*)$/ #print "messid: #{$1}\n" @@ -312,15 +314,15 @@ def read_cache(cachedir) #print "First: #{@connections[$3]["first"].to_i}\n"; #print "Last: #{@connections[$3]["last"].to_i}\n"; if @connections.has_key?($3) - unless excludes.has_key?($3) and excludes[$3].has_key?($2.to_i) or - $2.to_i < @connections[$3]["first"].to_i or - $2.to_i > @connections[$3]["last"].to_i - add($1, $2, $3, $4) - @connections[$3]["skip_ids"].insert($2.to_i) - end + unless excludes.has_key?($3) and excludes[$3].has_key?($2.to_i) or + $2.to_i < @connections[$3]["first"].to_i or + $2.to_i > @connections[$3]["last"].to_i + add($1, $2, $3, $4) + @connections[$3]["skip_ids"].insert($2.to_i) + end end end - end + } end end