You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(4) |
Feb
(56) |
Mar
(10) |
Apr
(1) |
May
(6) |
Jun
(5) |
Jul
(2) |
Aug
|
Sep
(22) |
Oct
(7) |
Nov
(1) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2006 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ys...@us...> - 2004-02-04 03:10:27
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3058/ngetsuite Modified Files: core.rb group.rb web.rb Added Files: articles.rb Log Message: Now recognizing releases! Web interface improved! J'ai toujours pas de stage! Make sure you've updated your dbs. --- NEW FILE: articles.rb --- require 'ngetsuite/utils' require 'ngetsuite/db' module NgetSuite class ArticleList < Db::DbList def getclass Article end end class Article include Utils include Db Db.autotable(Article, 'articles') def initialize(group, mid, fetch_from_db = false, nbparts = 0, rlsnb = 0, size = 0, subject = nil, from = nil, time = nil, release = nil) @_mid = mid @_group = group @_nbparts = nbparts @_size = size @_subject = subject @_from = from @_time = time @_release = release update_from_db if fetch_from_db end def to_s @_subject # TODO one day... end end class Release include Utils include Db Db.autotable(Release, 'releases') def initialize(group, mid, fetch_from_db = false ) @files = Array.new @_mid = mid @_group = group @_size = 0 @_nbexpected = 0 @_nbactual = 0 @_time = Time.gm("1980") update_from_db if fetch_from_db end def pushart(art, pos) art._rlsnb = pos art._release = @_mid @_size += art._size @_nbactual += 1 @_time = art._time if art._time > @_time @_completeness = @_nbactual.to_f / @_nbexpected.to_f * 100.to_f if @_nbexpected > 0 and @_nbactual <= @_nbexpected if @_rlsmap @_rlsmap[pos-1] = '#' if pos > 0 and pos <= @_rlsmap.size end @files.push art end # Returns the index of current file/nb of files # if guessed from the subject (0 if not) def Release.filenb_from_subject(subject) subject =~ /[\[\(]?(\d+)([\/]|\s*of\s*)(\d+)[\]\)]?/ return [$1.to_i, $3.to_i] end # Returns the common part between this subject and # the reference subject. We work with arrays of words def compare_subjects(subject) common = Array.new i = 0 while @refsubject[i] != nil and subject[i] != nil and @refsubject[i] == subject[i] common.push subject[i] i += 1 end return common end # Magic function to tell if an article belongs to a release # It adds it and return true if it does, return false if not def add?(art) fn = Release.filenb_from_subject(art._subject) if !@files.empty? # Deal with trivial cases # if the file sequence number is present and # seems correct, we can add the article without # further investigation return false if art._from != @poster if fn[1] > 0 and fn[0] > 0 return false if fn[1] != @_nbexpected return false if fn[0] <= @lastnb pushart(art,fn[0]) return true end else # First article: add it, # and keep the subject's words @refsubject = art._subject.split(' ') @poster = art._from @_nbexpected = fn[1] if fn[1] > 0 @lastnb = fn[0] if fn[0] > 0 @_rlsmap = '_' * @_nbexpected pushart(art,fn[0]) return true end # If we're here, the file sequence number # ("[xx/xx]"-like thing) was not found in the subject # We have to compare it with the reference subject # This is ugly and *a little* error prone, but hell... if @files.size == 1 # Second article: update the reference by storing # only the common words between the 2 subjects, # and add the article if there are any of these @refsubject = compare_subjects(art._subject.split(' ')) if @refsubject.size > 0 pushart(art,fn[0]) return true else return false end else # Already 2 or more articles in the release # Add the article if the common words between # its subject and the reference *is* the reference if compare_subjects(art._subject.split(' ')) == @refsubject pushart(art,fn[0]) return true else return false end end end def insert_to_db(only_mandatory = false) # A release contains at least 3 articles return if @files.size < 3 super(only_mandatory) # Update the articles too @files.each { |art| art.sync_to_db } end def to_s @_mid + ": " + @_nbactual.to_s + "/" + @_nbexpected.to_s + " [" + @_rlsmap + ']' end end end Index: core.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/core.rb,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** core.rb 4 Feb 2004 01:45:38 -0000 1.27 --- core.rb 4 Feb 2004 03:07:57 -0000 1.28 *************** *** 20,23 **** --- 20,36 ---- end + class NoSuchArticleException < Exception + attr_reader :number + + def initialize(number) + @number = number + end + + def message + "No such article : #{@number}" + end + end + + class NoSuchNfoException < Exception attr_reader :number Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** group.rb 4 Feb 2004 01:45:39 -0000 1.26 --- group.rb 4 Feb 2004 03:07:57 -0000 1.27 *************** *** 1,4 **** --- 1,5 ---- require 'ngetsuite/utils' require 'ngetsuite/queue' + require 'ngetsuite/articles' require 'ngetsuite/ngetcache' *************** *** 141,147 **** clear_articles clear_nfos announceupdate mknewscache ! fetchnfos @_date_updated = Time.now sync_to_db --- 142,150 ---- clear_articles clear_nfos + clear_releases announceupdate mknewscache ! fetchnfos unless $config['extern_nfo_fetch'].split(',').include?(@_shortname) ! recognizereleases @_date_updated = Time.now sync_to_db *************** *** 162,165 **** --- 165,176 ---- end + + def clear_releases + debug "Beginning clear_releases at #{Time.now.strftime('%H:%M:%S')}" + nb_rows = Db.dbh.do "delete from `releases` where `group` = '#{@_fullname}'" + debug "#{nb_rows} releases deleted" + debug "End clear_releases at #{Time.now.strftime('%H:%M:%S')}" + + end def queue_regexp(regexp, prio) *************** *** 180,187 **** def mknewscache debug "Beginning mknewscache at #{Time.now.strftime('%H:%M:%S')}" ! sth = Db.dbh.prepare 'insert into articles(`group`, `mid`, `nbparts`, `size`, `subject`, `from`, `time`, `rls_subject`) values (?, ?, ?, ?, ?, ?, FROM_UNIXTIME(?), ?)' filecallback = Proc.new{ |f| if f.req >= 1 - rsubj = f.subject.gsub(/^(.* )(- .*)?".*$/, '\1').gsub(/\d{1,3}(\/| of )\d{1,3}/, '#\1#').gsub(/ \d\d? /, ' # ') partcnt = 0 size = 0 --- 191,197 ---- def mknewscache debug "Beginning mknewscache at #{Time.now.strftime('%H:%M:%S')}" ! sth = Db.dbh.prepare 'insert into articles(`group`, `mid`, `nbparts`, `size`, `subject`, `from`, `time`, `rls_subject`) values (?, ?, ?, ?, ?, ?, FROM_UNIXTIME(?))' filecallback = Proc.new{ |f| if f.req >= 1 partcnt = 0 size = 0 *************** *** 193,197 **** partcnt += 1 if partcnt >= f.req ! sth.execute(@_fullname, p.mid, f.req, size, f.subject, f.author, p.date, rsubj) end end --- 203,207 ---- partcnt += 1 if partcnt >= f.req ! sth.execute(@_fullname, p.mid, f.req, size, f.subject, f.author, p.date) end end *************** *** 237,240 **** --- 247,271 ---- Dir.chdir(pwd) end + + def recognizereleases + articles = NgetSuite::ArticleList.new("where `group`='#{@_fullname}' order by `subject`") + @rls = nil + articles.each { |art| + @rls = NgetSuite::Release.new(art._group, art._mid) if !@rls + + if @rls.add?(art) == false then + # New release! Commit the current one to the db + @rls.insert_to_db + + # And make another + @rls = NgetSuite::Release.new(art._group, art._mid) + @rls.add?(art) + end + } + + @rls.insert_to_db + @rls = nil + end + end # class Index: web.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/web.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** web.rb 27 Dec 2003 00:41:05 -0000 1.3 --- web.rb 4 Feb 2004 03:07:57 -0000 1.4 *************** *** 8,12 **** class Web include Utils ! attr_reader :group, :offset, :articles_by_page, :filter def initialize(servlet_request) --- 8,12 ---- class Web include Utils ! attr_reader :group, :rlsmid, :offset, :articles_by_page, :filter, :date def initialize(servlet_request) *************** *** 14,17 **** --- 14,19 ---- @query = servlet_request.query + @date = "any" + @ids = @query['id' ].list() if @query.has_key? 'id' @selected = @query['selected'].list() if @query.has_key? 'selected' *************** *** 21,24 **** --- 23,28 ---- @value = @query['value' ].list() if @query.has_key? 'value' @filter = @query['filter' ].to_s if @query.has_key? 'filter' + @date = @query['date' ].to_s if @query.has_key? 'date' + @rlsmid = @query['rlsmid' ].to_s if @query.has_key? 'rlsmid' @group = NgetSuite::Group.getgroup(@query['group'].to_s) if @query.has_key? 'group' *************** *** 103,106 **** --- 107,119 ---- end + def date_str + if @date == "any" + "All articles" + else + y, m, d = date.split('-') + Time.local(y,m,d).strftime("%A, %B %d") + end + end + end #class |
From: <ys...@us...> - 2004-02-04 03:10:15
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3058 Modified Files: ngetcache.sql testngetcache.rb Log Message: Now recognizing releases! Web interface improved! J'ai toujours pas de stage! Make sure you've updated your dbs. Index: ngetcache.sql =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetcache.sql,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ngetcache.sql 3 Feb 2004 21:29:38 -0000 1.9 --- ngetcache.sql 4 Feb 2004 03:07:56 -0000 1.10 *************** *** 21,29 **** `mid` varchar(128) NOT NULL default '', `nbparts` smallint(6) NOT NULL default '0', `size` double NOT NULL default '0', `subject` varchar(255) NOT NULL default '', `from` varchar(128) NOT NULL default '', `time` datetime NOT NULL default '0000-00-00 00:00:00', ! `rls_subject` varchar(255) NOT NULL default '', PRIMARY KEY (`mid`,`group`) ) TYPE=MyISAM; --- 21,48 ---- `mid` varchar(128) NOT NULL default '', `nbparts` smallint(6) NOT NULL default '0', + `rlsnb` smallint(6) NOT NULL default '0', `size` double NOT NULL default '0', `subject` varchar(255) NOT NULL default '', `from` varchar(128) NOT NULL default '', `time` datetime NOT NULL default '0000-00-00 00:00:00', ! `release` varchar(128) default '', ! PRIMARY KEY (`mid`,`group`) ! ) TYPE=MyISAM; ! ! # -------------------------------------------------------- ! ! # ! # Table structure for table `releases` ! # ! ! CREATE TABLE `releases` ( ! `group` varchar(64) NOT NULL default '', ! `mid` varchar(128) NOT NULL default '', ! `nbexpected` smallint(6) NOT NULL default '0', ! `nbactual` smallint(6) NOT NULL default '0', ! `completeness` double NOT NULL default '0', ! `size` double NOT NULL default '0', ! `rlsmap` varchar(255) default NULL, ! `time` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`mid`,`group`) ) TYPE=MyISAM; Index: testngetcache.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/testngetcache.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testngetcache.rb 3 Feb 2004 12:58:45 -0000 1.1 --- testngetcache.rb 4 Feb 2004 03:07:56 -0000 1.2 *************** *** 7,10 **** end puts 'Testing cache for ' + ARGV[0] ! NgetCache.new(ARGV[0], NgetSuite::Config.new(ENV['HOME']+'/'+'.ngetsuite')['cachedir']) puts 'Done.' --- 7,17 ---- end puts 'Testing cache for ' + ARGV[0] ! cache = NgetCache.new(ARGV[0], NgetSuite::Config.new(ENV['HOME']+'/'+'.ngetsuite')['cachedir']) ! ! cache.files.sort! { |x,y| ! x.subject <=> y.subject ! }.each { |file| ! puts file.subject ! } ! puts 'Done.' |
From: <jj...@us...> - 2004-02-04 01:47:56
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21764 Modified Files: ngetsuite.rb Log Message: added --delete-queue (-x), changed callback when parsing nget cache Index: ngetsuite.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ngetsuite.rb 2 Feb 2004 02:41:34 -0000 1.14 --- ngetsuite.rb 4 Feb 2004 01:45:38 -0000 1.15 *************** *** 14,17 **** --- 14,18 ---- + # reste -p, -w, -y $args = Array[ [ '--debug', '-d', GetoptLong::NO_ARGUMENT, 'Enable debug mode'], *************** *** 33,36 **** --- 34,38 ---- [ '--set-priority', '-f', GetoptLong::REQUIRED_ARGUMENT, 'queueid,prio', 'Changes the priority of the specified queue' ], [ '--set-status', '-i', GetoptLong::REQUIRED_ARGUMENT, 'queueid,status', 'Changes the status of the specified queue'], + [ '--delete-queue', '-x', GetoptLong::REQUIRED_ARGUMENT, 'queueid', 'Changes the status of the specified queue'], [ '--set-limit', '-j', GetoptLong::REQUIRED_ARGUMENT, 'limit', 'Sets the maximum limit of parallel downloads'], [ '--set-poll-interval', '-o', GetoptLong::REQUIRED_ARGUMENT, 'intervall', 'Sets the polling intervall of the download manager'], |
From: <bla...@us...> - 2004-02-03 21:34:04
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18240 Modified Files: db.rb Log Message: use ? quoting for insert and update Index: db.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/db.rb,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** db.rb 2 Feb 2004 02:41:57 -0000 1.21 --- db.rb 3 Feb 2004 21:31:32 -0000 1.22 *************** *** 259,264 **** end ! def exec_request(req) ! Db.dbh.do req end --- 259,268 ---- end ! def exec_request(req, values = nil) ! if values ! Db.dbh.do(req, *values) ! else ! Db.dbh.do(req) ! end end *************** *** 266,270 **** check_missing_values table = Db.get_table(self.class) ! req = "insert into `#{table}` (" req += fields_list_to_s(only_mandatory, true) --- 270,274 ---- check_missing_values table = Db.get_table(self.class) ! values = Array.new req = "insert into `#{table}` (" req += fields_list_to_s(only_mandatory, true) *************** *** 274,283 **** value = method('_'+name).call next if not value ! "'#{field.todb(value)}'" }.compact.join ', ' req += ')' debug 'DB: ' + req ! exec_request req end --- 278,288 ---- value = method('_'+name).call next if not value ! values << field.todb(value) ! " ? " }.compact.join ', ' req += ')' debug 'DB: ' + req ! exec_request(req, values) end *************** *** 304,318 **** check_missing_values table = Db.get_table(self.class) ! req = "update #{table} set " req += fields(self.class).map{ |name,field| v = method('_'+name).call next if not v ! value = field.todb(v) ! "`#{name}`='#{value}'" }.compact.join ', ' req += ' where ' + ids_constraint ! exec_request req end --- 309,323 ---- check_missing_values table = Db.get_table(self.class) ! values = Array.new req = "update #{table} set " req += fields(self.class).map{ |name,field| v = method('_'+name).call next if not v ! values << field.todb(v) ! "`#{name}`= ? " }.compact.join ', ' req += ' where ' + ids_constraint ! exec_request(req, values) end |
From: <jj...@us...> - 2004-02-03 18:13:01
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9158/ngetsuite Modified Files: group.rb ngetcache.rb Log Message: added callbacks (o...k...) Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** group.rb 3 Feb 2004 12:58:45 -0000 1.24 --- group.rb 3 Feb 2004 16:33:28 -0000 1.25 *************** *** 180,233 **** def mknewscache debug "Beginning mknewscache at #{Time.now.strftime('%H:%M:%S')}" - cache = NgetCache.new(@_fullname, @cachedir) - puts "The cache file for #{@_fullname} seems corrupted !" if not cache.sane sth = Db.dbh.prepare 'insert into articles(`group`, `mid`, `nbparts`, `size`, `subject`, `from`, `time`, `rls_subject`) values (?, ?, ?, ?, ?, ?, FROM_UNIXTIME(?), ?)' ! cache.files.each { |f| ! next if f.req < 1 ! partcnt, size, a = 0, 0, nil ! rsubj = f.subject.gsub(/^(.* )(- .*)?".*$/, '\1').gsub(/\d{1,3}(\/| of )\d{1,3}/, '#\1#').gsub(/ \d\d? /, ' # ') ! f.parts.each { |p| ! next if p.articles.empty? a = p.articles[0] ! size += a.bytes / ( a.bytes<100*a.lines ? 1.39 : 1.0334) ! partcnt += 1 ! if partcnt >= f.req ! sth.execute(@_fullname, p.mid, f.req, size, f.subject, f.author, p.date, rsubj) end - } - } - if false - while (cachefile.gets != ".\n") - end - while line = cachefile.gets - next if line !~ /^(\d+)\t0\t/ or $1.to_i < 1 - parts, subject, from = line.split(/\t/).values_at(0, 3, 4) - parts = parts.to_i - while (cachefile.gets != ".\n") end ! partcnt = 0 ! size = 0 ! line = cachefile.gets ! while line != ".\n" ! line =~ /^\d+\t(.*)\t(.*)$/ ! time, mid = $1, $2 ! while (line = cachefile.gets) != ".\n" ! serverid, bytes, lines = line.split(/\t/).values_at(1,2,3).collect {|x| x.to_i} ! end ! lines = 1 if lines < 1 ! linelength = (bytes / lines).to_i ! size = size.to_i + (bytes / ( linelength < 100 ? 1.39 : 1.0334 )) ! partcnt += 1 ! ! if parts <= partcnt ! # info about file if file is complete ! # make the release subject from the subject ! rsubj = subject.gsub(/^(.* )(- .*)?".*$/, '\1').gsub(/\d{1,3}(\/| of )\d{1,3}/, '#\1#').gsub(/ \d\d? /, ' # ') ! sth.execute(@_fullname, mid, parts, size.to_i, subject, from, time, rsubj) ! end ! end ! end ! end debug "End mknewscache at #{Time.now.strftime('%H:%M:%S')}" end --- 180,207 ---- def mknewscache debug "Beginning mknewscache at #{Time.now.strftime('%H:%M:%S')}" sth = Db.dbh.prepare 'insert into articles(`group`, `mid`, `nbparts`, `size`, `subject`, `from`, `time`, `rls_subject`) values (?, ?, ?, ?, ?, ?, FROM_UNIXTIME(?), ?)' ! filecallback = Proc.new{ |f| ! if f.req < 1 ! @cachecb_invalid = true ! else ! @cachecb_invalid = false ! end ! @cachecb_file = f ! @cachecb_rsubj = f.subject.gsub(/^(.* )(- .*)?".*$/, '\1').gsub(/\d{1,3}(\/| of )\d{1,3}/, '#\1#').gsub(/ \d\d? /, ' # ') ! @cachecb_partcnt = 0 ! @cachecb_size = 0 ! } ! partcallback = Proc.new{ |p| ! unless @cachecb_invalid or p.articles.empty? a = p.articles[0] ! @cachecb_size += a.bytes / ( a.bytes < 100*a.lines ? 1.39 : 1.0334 ) ! @cachecb_partcnt += 1 ! if @cachecb_partcnt >= @cachecb_file.req ! sth.execute(@_fullname, p.mid, @cachecb_file.req, @cachecb_size, @cachecb_file.subject, @cachecb_file.author, p.date, @cachecb_rsubj) end end + } ! NgetCache.new(@_fullname, @cachedir, nil, filecallback, partcallback) debug "End mknewscache at #{Time.now.strftime('%H:%M:%S')}" end Index: ngetcache.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/ngetcache.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ngetcache.rb 3 Feb 2004 12:58:45 -0000 1.2 --- ngetcache.rb 3 Feb 2004 16:33:28 -0000 1.3 *************** *** 18,24 **** CacheArticle = Struct.new('CacheArticle', 'serverid', 'articlenum', 'bytes', 'lines') ! def initialize(groupname, path='.', sanitycheck = true, limit=nil) @servers = Array.new @files = Array.new @sane = true --- 18,25 ---- CacheArticle = Struct.new('CacheArticle', 'serverid', 'articlenum', 'bytes', 'lines') ! def initialize(groupname, path='.', limit=nil, filecallback=nil, partcallback=nil, articlecallback=nil) @servers = Array.new @files = Array.new + @filecallback, @partcallback, @articlecallback = filecallback, partcallback, articlecallback @sane = true *************** *** 57,61 **** # files list while (file = read_file) ! @files << file if limit break if (limit -= 1) < 0 --- 58,62 ---- # files list while (file = read_file) ! @files << file unless @filecallback if limit break if (limit -= 1) < 0 *************** *** 83,86 **** --- 84,89 ---- end + @filecallback.call(file) if @filecallback + # parts of the file while (part = read_part) *************** *** 105,108 **** --- 108,112 ---- part.articles << article end + @partcallback.call(part) if @partcallback part end *************** *** 111,115 **** return unless readline raise BadNgetCache.new('invalid article description') unless @line =~ /^(\d+)\t(\d+)\t(\d+)\t(\d+)$/ ! CacheArticle.new($1.to_i, $2.to_i, $3.to_i, $4.to_i) end --- 115,121 ---- return unless readline raise BadNgetCache.new('invalid article description') unless @line =~ /^(\d+)\t(\d+)\t(\d+)\t(\d+)$/ ! article = CacheArticle.new($1.to_i, $2.to_i, $3.to_i, $4.to_i) ! @articlecallback.call(article) if @articlecallback ! article end |
From: <jj...@us...> - 2004-02-03 13:00:58
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22528/ngetsuite Modified Files: group.rb ngetcache.rb Log Message: bugfix Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** group.rb 3 Feb 2004 01:31:49 -0000 1.23 --- group.rb 3 Feb 2004 12:58:45 -0000 1.24 *************** *** 193,197 **** partcnt += 1 if partcnt >= f.req ! sth.execute(@_fullname, p.mid, f.req, size, f.subject, f.from, p.time, rsubj) end } --- 193,197 ---- partcnt += 1 if partcnt >= f.req ! sth.execute(@_fullname, p.mid, f.req, size, f.subject, f.author, p.date, rsubj) end } Index: ngetcache.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/ngetcache.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ngetcache.rb 3 Feb 2004 01:31:49 -0000 1.1 --- ngetcache.rb 3 Feb 2004 12:58:45 -0000 1.2 *************** *** 1,11 **** #!/usr/bin/ruby class NgetCache require 'zlib' ! attr_reader :servers, :files, :sane - class BadNgetCache < RuntimeError - end CacheServer = Struct.new('CacheServer', 'serverid', 'high', 'low', 'num') CacheFile = Struct.new('CacheFile', 'req', 'flags', 'fileid', 'subject', 'author', 'partoff', 'tailoff', 'references', 'parts') --- 1,16 ---- #!/usr/bin/ruby + class BadNgetCache < Exception + attr_reader :msg + def initialize(msg) + @msg = msg + end + end + class NgetCache require 'zlib' ! attr_reader :servers, :files, :sane, :lineno CacheServer = Struct.new('CacheServer', 'serverid', 'high', 'low', 'num') CacheFile = Struct.new('CacheFile', 'req', 'flags', 'fileid', 'subject', 'author', 'partoff', 'tailoff', 'references', 'parts') *************** *** 19,35 **** @fd = Zlib::GzipReader.open(path + File::Separator + groupname + ',cache.gz') begin read_all(limit) ! rescue BadNgetCache @sane = false ensure @fd.close end ! cache_check if sanitycheck and @sane end def readline ! raise BadNgetCache unless @line = @fd.gets @line.chomp! return true if @line != '.' end --- 24,43 ---- @fd = Zlib::GzipReader.open(path + File::Separator + groupname + ',cache.gz') + @lineno = 0 begin read_all(limit) ! rescue BadNgetCache => e @sane = false + puts "Error in the cache for #{groupname}, line #{@lineno} : #{e.msg}" ensure @fd.close end ! # cache_check if sanitycheck and @sane end def readline ! raise BadNgetCache.new('unattended EOF') unless @line = @fd.gets @line.chomp! + @lineno += 1 return true if @line != '.' end *************** *** 38,43 **** readline ! raise BadNgetCache unless @line =~ /^([^\t]*)\t(\d+) ([^\t]*)$/ ! raise BadNgetCache unless $1 == 'NGET4' and $3 == '1' @partscounttotal = $2.to_i --- 46,51 ---- readline ! raise BadNgetCache.new('not a ngetcache file') unless @line =~ /^([^\t]*)\t(\d+) ([^\t]*)$/ ! raise BadNgetCache.new('not a ngetcache file') unless $1 == 'NGET4' and $3 == '1' @partscounttotal = $2.to_i *************** *** 59,63 **** return unless readline ! raise BadNgetCache unless @line =~ /^(\d+)\t(\d+)\t(\d+)\t(\d+)$/ CacheServer.new($1.to_i, $2.to_i, $3.to_i, $4.to_i) end --- 67,71 ---- return unless readline ! raise BadNgetCache.new('invalid server description') unless @line =~ /^(\d+)\t(\d+)\t(\d+)\t(\d+)$/ CacheServer.new($1.to_i, $2.to_i, $3.to_i, $4.to_i) end *************** *** 65,70 **** def read_file return unless @line = @fd.gets ! raise BadNgetCache unless @line =~ /^(-?\d+)\t(\d+)(?:\t(\d+))?\t([^\t]*)\t([^\t]*)\t(-?\d+)\t(-?\d+)$/ file = CacheFile.new($1.to_i, $2.to_i, ($3.to_i if $3), $4, $5, $6.to_i, $7.to_i, Array.new, Array.new) --- 73,79 ---- def read_file return unless @line = @fd.gets + @lineno += 1 ! raise BadNgetCache.new('invalid file description') unless @line =~ /^(-?\d+)\t(\d+)(?:\t(\d+))?\t([^\t]*)\t([^\t]*)\t(-?\d+)\t(-?\d+)$/ file = CacheFile.new($1.to_i, $2.to_i, ($3.to_i if $3), $4, $5, $6.to_i, $7.to_i, Array.new, Array.new) *************** *** 89,93 **** return unless readline ! raise BadNgetCache unless @line =~ /^(-?\d+)\t(\d+)\t([^\t]*)$/ part = CachePart.new($1.to_i, $2.to_i, $3, Array.new) --- 98,102 ---- return unless readline ! raise BadNgetCache.new('invalid part description') unless @line =~ /^(-?\d+)\t(\d+)\t([^\t]*)$/ part = CachePart.new($1.to_i, $2.to_i, $3, Array.new) *************** *** 101,105 **** def read_article return unless readline ! raise BadNgetCache unless @line =~ /^(\d+)\t(\d+)\t(\d+)\t(\d+)$/ CacheArticle.new($1.to_i, $2.to_i, $3.to_i, $4.to_i) end --- 110,114 ---- def read_article return unless readline ! raise BadNgetCache.new('invalid article description') unless @line =~ /^(\d+)\t(\d+)\t(\d+)\t(\d+)$/ CacheArticle.new($1.to_i, $2.to_i, $3.to_i, $4.to_i) end |
From: <jj...@us...> - 2004-02-03 13:00:58
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22528 Added Files: testngetcache.rb Log Message: bugfix --- NEW FILE: testngetcache.rb --- #!/usr/bin/ruby require 'ngetsuite/ngetcache' require 'ngetsuite/config' unless ARGV[0] puts 'usage : testngetcache.rb fullname' exit end puts 'Testing cache for ' + ARGV[0] NgetCache.new(ARGV[0], NgetSuite::Config.new(ENV['HOME']+'/'+'.ngetsuite')['cachedir']) puts 'Done.' |
From: <jj...@us...> - 2004-02-03 01:34:03
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7561/ngetsuite Modified Files: group.rb Added Files: ngetcache.rb Log Message: should work --- NEW FILE: ngetcache.rb --- #!/usr/bin/ruby class NgetCache require 'zlib' attr_reader :servers, :files, :sane class BadNgetCache < RuntimeError end CacheServer = Struct.new('CacheServer', 'serverid', 'high', 'low', 'num') CacheFile = Struct.new('CacheFile', 'req', 'flags', 'fileid', 'subject', 'author', 'partoff', 'tailoff', 'references', 'parts') CachePart = Struct.new('CachePart', 'partnum', 'date', 'mid', 'articles') CacheArticle = Struct.new('CacheArticle', 'serverid', 'articlenum', 'bytes', 'lines') def initialize(groupname, path='.', sanitycheck = true, limit=nil) @servers = Array.new @files = Array.new @sane = true @fd = Zlib::GzipReader.open(path + File::Separator + groupname + ',cache.gz') begin read_all(limit) rescue BadNgetCache @sane = false ensure @fd.close end cache_check if sanitycheck and @sane end def readline raise BadNgetCache unless @line = @fd.gets @line.chomp! return true if @line != '.' end def read_all(limit) readline raise BadNgetCache unless @line =~ /^([^\t]*)\t(\d+) ([^\t]*)$/ raise BadNgetCache unless $1 == 'NGET4' and $3 == '1' @partscounttotal = $2.to_i # servers description while (server = read_server) @servers << server end # files list while (file = read_file) @files << file if limit break if (limit -= 1) < 0 end end end def read_server return unless readline raise BadNgetCache unless @line =~ /^(\d+)\t(\d+)\t(\d+)\t(\d+)$/ CacheServer.new($1.to_i, $2.to_i, $3.to_i, $4.to_i) end def read_file return unless @line = @fd.gets raise BadNgetCache unless @line =~ /^(-?\d+)\t(\d+)(?:\t(\d+))?\t([^\t]*)\t([^\t]*)\t(-?\d+)\t(-?\d+)$/ file = CacheFile.new($1.to_i, $2.to_i, ($3.to_i if $3), $4, $5, $6.to_i, $7.to_i, Array.new, Array.new) # references while (ref = read_reference) file.references << ref end # parts of the file while (part = read_part) file.parts << part end file end def read_reference return unless readline @line.chomp.sub(/^\./, '') end def read_part return unless readline raise BadNgetCache unless @line =~ /^(-?\d+)\t(\d+)\t([^\t]*)$/ part = CachePart.new($1.to_i, $2.to_i, $3, Array.new) # articles giving this part while (article = read_article) part.articles << article end part end def read_article return unless readline raise BadNgetCache unless @line =~ /^(\d+)\t(\d+)\t(\d+)\t(\d+)$/ CacheArticle.new($1.to_i, $2.to_i, $3.to_i, $4.to_i) end def save_tofile(groupname, path) @fd = Zlib::GzipWriter.open(path + File::Separator + groupname + ',cache.newformat.gz') write_all @fd.close end def write_all @fd.puts "NGET4\t#{@partscounttotal} 1" @servers.each { |s| write_server s } @fd.puts '.' @files.each { |f| write_file f } end def write_server(s) @fd.puts [s.serverid, s.high, s.low, s.num].join("\t") end def write_file(f) @fd.puts [f.req, f.flags, f.subject, f.author, f.partoff, f.tailoff].join("\t") f.references.each { |r| write_reference(r) } @fd.puts '.' f.parts.each { |p| write_part(p) } @fd.puts '.' end def write_reference(r) ref = r ref = '.'+r if r[0] == '.' @fd.puts ref end def write_part(p) @fd.puts [p.partnum, p.date, p.mid].join("\t") p.articles.each { |a| write_article(a) } @fd.puts '.' end def write_article(a) @fd.puts [a.serverid, a.articlenum, a.bytes, a.lines].join("\t") end def cache_check partscount = 0 @files.each { |f| partscount += f.parts.length } @sane = false if partscount != @totalpartscount @files.each { |f| f.parts.each { |p| p.articles.each { |a| @sane = false unless @servers.map{ |s| s.serverid }.include? a.serverid }}} puts "INSANE" unless @sane end end Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** group.rb 2 Feb 2004 17:44:19 -0000 1.22 --- group.rb 3 Feb 2004 01:31:49 -0000 1.23 *************** *** 1,5 **** require 'ngetsuite/utils' require 'ngetsuite/queue' ! require 'zlib' module NgetSuite --- 1,5 ---- require 'ngetsuite/utils' require 'ngetsuite/queue' ! require 'ngetsuite/ngetcache' module NgetSuite *************** *** 27,31 **** include Db ! Db.autotable(Group, "groups") def Group.getname(id) --- 27,31 ---- include Db ! Db.autotable(Group, 'groups') def Group.getname(id) *************** *** 104,109 **** def _shortname if (@_shortname == nil) ! @_shortname = '' ! @_fullname.split('.').each {|item| @_shortname << item[0] } end --- 104,108 ---- def _shortname if (@_shortname == nil) ! @_shortname = @_fullname.split('.').map {|item| item[0] }.join('') end *************** *** 127,138 **** --- 126,150 ---- end + def announceupdate + #Db.dbh.execute "insert into `articles` (`group`, `action`) values ('#{@_fullname}', 'updating')" + end + def announcedupdate + #'updating' == Db.dbh.execute "select `action` from `articles` where `group` == '#{@_fullname}'" + end + def finishupdate + #Db.dbh.execute "delete from `articles` where `group`='#{@_fullname}', `action`='updating'" + end + def update + puts "Warning: A headers update seems to be running !" if announcedupdate updatecache unless $config['extern_headers_update'].split(',').include?(@_shortname) clear_articles clear_nfos + announceupdate mknewscache fetchnfos @_date_updated = Time.now sync_to_db + finishupdate end *************** *** 168,175 **** def mknewscache debug "Beginning mknewscache at #{Time.now.strftime('%H:%M:%S')}" ! sth = Db.dbh.prepare 'insert into articles(`group`, `mid`, `nbparts`, `size`, ! `subject`, `from`, `time`, `rls_subject`) values (?, ?, ?, ?, ?, ?, FROM_UNIXTIME(?), ?)' ! debug 'Parsing cache' ! cachefile = Zlib::GzipReader.open("#{@cachedir}/#{@_fullname},cache.gz") while (cachefile.gets != ".\n") end --- 180,201 ---- def mknewscache debug "Beginning mknewscache at #{Time.now.strftime('%H:%M:%S')}" ! cache = NgetCache.new(@_fullname, @cachedir) ! puts "The cache file for #{@_fullname} seems corrupted !" if not cache.sane ! sth = Db.dbh.prepare 'insert into articles(`group`, `mid`, `nbparts`, `size`, `subject`, `from`, `time`, `rls_subject`) values (?, ?, ?, ?, ?, ?, FROM_UNIXTIME(?), ?)' ! cache.files.each { |f| ! next if f.req < 1 ! partcnt, size, a = 0, 0, nil ! rsubj = f.subject.gsub(/^(.* )(- .*)?".*$/, '\1').gsub(/\d{1,3}(\/| of )\d{1,3}/, '#\1#').gsub(/ \d\d? /, ' # ') ! f.parts.each { |p| ! next if p.articles.empty? ! a = p.articles[0] ! size += a.bytes / ( a.bytes<100*a.lines ? 1.39 : 1.0334) ! partcnt += 1 ! if partcnt >= f.req ! sth.execute(@_fullname, p.mid, f.req, size, f.subject, f.from, p.time, rsubj) ! end ! } ! } ! if false while (cachefile.gets != ".\n") end *************** *** 203,207 **** end end ! cachefile.close debug "End mknewscache at #{Time.now.strftime('%H:%M:%S')}" end --- 229,233 ---- end end ! end debug "End mknewscache at #{Time.now.strftime('%H:%M:%S')}" end |
From: <bla...@pr...> - 2004-02-02 17:46:25
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv347/ngetsuite Modified Files: core.rb downloader.rb downloadmanager.rb group.rb queue_file.rb utils.rb Log Message: httpd is now started by daemon.rb, misc fixes Index: core.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/core.rb,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** core.rb 2 Feb 2004 02:41:57 -0000 1.25 --- core.rb 2 Feb 2004 17:44:19 -0000 1.26 *************** *** 40,45 **** def get_manager DRb.start_service() ! port = $config['port'] ! manager = DRbObject.new(nil, 'druby://localhost:' + port) if !manager raise ManagerNotFoundException.new("localhost:#{port}") --- 40,45 ---- def get_manager DRb.start_service() ! port = $config.fetch('port', 12345) ! manager = DRbObject.new(nil, 'druby://localhost:' + port.to_s) if !manager raise ManagerNotFoundException.new("localhost:#{port}") Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** downloader.rb 2 Feb 2004 02:41:57 -0000 1.16 --- downloader.rb 2 Feb 2004 17:44:19 -0000 1.17 *************** *** 40,44 **** def update_status(line) ! debug(Utils.red("begin update_status")) if line =~ /^already have .*\n$/ @nbfiles += 1 --- 40,44 ---- def update_status(line) ! #debug(Utils.red("begin update_status")) if line =~ /^already have .*\n$/ @nbfiles += 1 *************** *** 60,70 **** speed = $3 filenb = $4 - #if (!@nbfiles) - # @nbfiles = $4 - # debug "before sql" - # $dbh.do "update queue set `nbfiles`='#{@nbfiles}' - # where `id`='#{@id}'" - # debug "after sql" - #end @curfile.update(part, speed, filenb, size) elsif line =~ /^uu_msg\(\d+\):Loaded from .*: '.*' \(.*\): (.*) part \d+.*end (.*)\n$/ --- 60,63 ---- *************** *** 77,81 **** #TODO : handle decoding failures (=> @curfile.finish(false)) end ! debug (Utils.red "end update_status") end --- 70,74 ---- #TODO : handle decoding failures (=> @curfile.finish(false)) end ! #debug (Utils.red "end update_status") end Index: downloadmanager.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloadmanager.rb,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** downloadmanager.rb 2 Feb 2004 02:41:57 -0000 1.13 --- downloadmanager.rb 2 Feb 2004 17:44:19 -0000 1.14 *************** *** 20,23 **** --- 20,24 ---- @poll_interval = 30 @started = false + start if $config.fetch('autostart', false) end Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** group.rb 2 Feb 2004 02:41:57 -0000 1.21 --- group.rb 2 Feb 2004 17:44:19 -0000 1.22 *************** *** 92,97 **** @_description = description @_date_added = Time.now ! @nget = $config['nget'] ! @yydecode = $config['yydecode'] @cachedir = $config['cachedir'] update_from_db if fetch_from_db --- 92,97 ---- @_description = description @_date_added = Time.now ! @nget = $config.fetch('nget', '/usr/bin/nget') ! @yydecode = $config.fetch('yydecode', '/usr/bin/yydecode') @cachedir = $config['cachedir'] update_from_db if fetch_from_db Index: queue_file.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/queue_file.rb,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** queue_file.rb 27 Dec 2003 20:01:54 -0000 1.13 --- queue_file.rb 2 Feb 2004 17:44:19 -0000 1.14 *************** *** 41,45 **** def update(part, speed, filenb, size) ! puts "begin update : part = #{part}, speed = #{speed}, filenb = #{filenb}, size = #{size}" @part = part @_filenumber = filenb --- 41,45 ---- def update(part, speed, filenb, size) ! #puts "begin update : part = #{part}, speed = #{speed}, filenb = #{filenb}, size = #{size}" @part = part @_filenumber = filenb *************** *** 73,77 **** sync_to_db ! end end --- 73,81 ---- sync_to_db ! end ! ! def to_s ! "-- #{@_filename} : [#{@part}/#{@dlparts}], speed = #{@_avgspeed}" ! end end Index: utils.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/utils.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** utils.rb 2 Feb 2004 02:41:57 -0000 1.9 --- utils.rb 2 Feb 2004 17:44:19 -0000 1.10 *************** *** 24,28 **** def Utils.debug(message=nil) ! puts "DEBUG: #{message}" if($config['debug'] && message) end --- 24,28 ---- def Utils.debug(message=nil) ! puts "DEBUG: #{message}" if($config.fetch('debug', false) && message) end |
From: <bla...@pr...> - 2004-02-02 17:46:25
|
Update of /cvsroot/ngetsuite/ngetsuite/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv347/web Modified Files: webrick.rhtml Log Message: httpd is now started by daemon.rb, misc fixes Index: webrick.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/webrick.rhtml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** webrick.rhtml 28 Dec 2003 20:04:04 -0000 1.6 --- webrick.rhtml 2 Feb 2004 17:44:19 -0000 1.7 *************** *** 73,77 **** req += " order by `time` desc limit #{web.offset},#{web.articles_by_page} " - puts req sth = NgetSuite::Db.dbh.execute req sth.fetch do |row| %> --- 73,76 ---- *************** *** 166,173 **** <div class='search'> <form method='post' name='articles'> - <%= web.offset_input %> <%= web.group_input %> <p>Search in the current group : </p> ! <p><input class='search' type='text' name='filter' size='15' maxlength='15'></p> </form> </div> --- 165,173 ---- <div class='search'> <form method='post' name='articles'> <%= web.group_input %> <p>Search in the current group : </p> ! <!--<p><input class='search' type='text' name='filter' size='15' ! maxlength='15'></p>--> ! <p><input class='search' type='text' name='filter'></p> </form> </div> *************** *** 177,181 **** <%= web.group_input %> <p>Queue this regexp :</p> ! <input class='regexp' type='text' name='regexp_to_add' size='15' maxlength='15'> <select name='prio'> <% for i in 1..10 %> --- 177,183 ---- <%= web.group_input %> <p>Queue this regexp :</p> ! <!--<input class='regexp' type='text' name='regexp_to_add' size='15' ! maxlength='15'>--> ! <input class='regexp' type='text' name='regexp_to_add'> <select name='prio'> <% for i in 1..10 %> |
From: <bla...@pr...> - 2004-02-02 17:46:24
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv347 Modified Files: daemon.rb sampleconfig Log Message: httpd is now started by daemon.rb, misc fixes Index: daemon.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/daemon.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** daemon.rb 31 Oct 2003 13:11:12 -0000 1.9 --- daemon.rb 2 Feb 2004 17:44:18 -0000 1.10 *************** *** 5,23 **** require 'ngetsuite/config' ! conf_file = ENV['HOME'] + File::Separator + '.ngetsuite' $config = NgetSuite::Config.new(conf_file) require 'ngetsuite/downloadmanager' ! $dbh = DBI.connect("DBI:Mysql:#{$config['dbname']}", $config['dbuser'], $config['dbpass']) ! $nget = $config['nget'] ! basedir = $config['basedir'] ! max_dls = $config['max_dls'].to_i ! port = $config['port'] ! logfile = $config['daemon_log'] $logger = File.new(logfile, 'a') ! $debug = $config['debug'] def log(msg=nil) --- 5,32 ---- require 'ngetsuite/config' ! homedir = ENV['HOME'] + File::Separator ! conf_file = homedir + '.ngetsuite' $config = NgetSuite::Config.new(conf_file) require 'ngetsuite/downloadmanager' ! dbuser = $config.fetch('dbuser', 'nget') ! dbname = $config.fetch('dbname', 'ngetcache') ! if not $config.include? 'dbpass' ! puts "Missing required value in config file : dbpass" ! exit 1 ! end ! ! $dbh = DBI.connect("DBI:Mysql:#{dbname}", dbuser, $config['dbpass']) ! ! $nget = $config.fetch('nget', '/usr/bin/nget') ! basedir = $config.fetch('basedir', homedir + 'ngetsuite') ! max_dls = $config.fetch('max_dls', 2) ! port = $config.fetch('port', 12345) ! logfile = $config.fetch('daemon_log', basedir + 'daemon.log') $logger = File.new(logfile, 'a') ! $debug = $config.fetch('debug', false) def log(msg=nil) *************** *** 28,31 **** $manager = NgetSuite::DownloadManager.new(max_dls, basedir) ! DRb.start_service('druby://localhost:' + port, $manager) DRb.thread.join --- 37,53 ---- $manager = NgetSuite::DownloadManager.new(max_dls, basedir) ! DRb.start_service('druby://localhost:' + port.to_s, $manager) ! ! if $config.fetch('autostart_httpd', false) ! require 'webrick' ! include WEBrick ! s = HTTPServer.new( ! :Port => ($config.fetch('httpd_port', 2000)), ! :DocumentRoot => Dir::pwd + "/web" ! ) ! trap("INT"){ s.shutdown } ! httpThread = Thread.new { s.start } ! httpThread.join ! end ! DRb.thread.join Index: sampleconfig =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/sampleconfig,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sampleconfig 2 Feb 2004 02:41:34 -0000 1.7 --- sampleconfig 2 Feb 2004 17:44:18 -0000 1.8 *************** *** 14,18 **** debug = false httpd_port = 2000 ! --- 14,20 ---- debug = false + extern_headers_update = '' httpd_port = 2000 ! autostart = true ! autostart_httpd = true |
From: <bla...@pr...> - 2004-02-02 12:38:35
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32701 Removed Files: index.php ngetupdate rubydaemon rubyupdate Log Message: die die die --- index.php DELETED --- --- ngetupdate DELETED --- --- rubydaemon DELETED --- --- rubyupdate DELETED --- |
From: <jj...@pr...> - 2004-02-02 02:44:02
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32633 Modified Files: ngetsuite.rb sampleconfig Log Message: new config file format, rhs are now evaluated (strings must be quoted) new config option to disable the headers update by the program (extern_headers_update) the working directory is changed to where the main script is located at its startup (to allow the invocation by cron) misc bugfixes Index: ngetsuite.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite.rb,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ngetsuite.rb 2 Nov 2003 19:14:29 -0000 1.13 --- ngetsuite.rb 2 Feb 2004 02:41:34 -0000 1.14 *************** *** 1,4 **** --- 1,6 ---- #!/usr/bin/env ruby + Dir.chdir(__FILE__.sub(/\/[^\/]*$/, '')) + $opts = Hash.new $opts['config-file'] = ENV['HOME'] + File::Separator + '.ngetsuite' unless $opts['config-file'] Index: sampleconfig =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/sampleconfig,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sampleconfig 14 Jan 2004 22:42:15 -0000 1.6 --- sampleconfig 2 Feb 2004 02:41:34 -0000 1.7 *************** *** 1,17 **** ! dbuser = nget ! dbpass = cache4pdv ! dbname = ngetcache ! nget = /home/nget/bin/nget ! yydecode = /usr/bin/yydecode ! cachedir = /home/nget/.nget4 ! basedir = /home/nget/testdl max_dls = 3 port = 12345 ! daemon_log = /tmp/nget-daemon.log ! debug = 0 httpd_port = 2000 --- 1,17 ---- ! dbuser = 'nget' ! dbpass = 'cache4pdv' ! dbname = 'ngetcache' ! nget = '/home/nget/bin/nget' ! yydecode = '/usr/bin/yydecode' ! cachedir = '/home/nget/.nget4' ! basedir = '/home/nget/testdl' max_dls = 3 port = 12345 ! daemon_log = '/tmp/nget-daemon.log' ! debug = false httpd_port = 2000 |
From: <jj...@pr...> - 2004-02-02 02:43:55
|
Update of /cvsroot/ngetsuite/ngetsuite/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32633/web Modified Files: dump.rhtml Log Message: new config file format, rhs are now evaluated (strings must be quoted) new config option to disable the headers update by the program (extern_headers_update) the working directory is changed to where the main script is located at its startup (to allow the invocation by cron) misc bugfixes Index: dump.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/dump.rhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dump.rhtml 28 Dec 2003 12:34:15 -0000 1.1 --- dump.rhtml 2 Feb 2004 02:41:57 -0000 1.2 *************** *** 31,35 **** # if guessed from the subject (0 if not) def Release.filenb_from_subject(subject) ! subject =~ /[\[\( ](\d+)([\/]|\s?of\s?)(\d+)[\]\) ]/ return [$1.to_i, $3.to_i] --- 31,35 ---- # if guessed from the subject (0 if not) def Release.filenb_from_subject(subject) ! subject =~ /[\[\(]?(\d+)([\/]|\s*of\s*)(\d+)[\]\)]?/ return [$1.to_i, $3.to_i] |
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32633/ngetsuite Modified Files: config.rb core.rb db.rb downloader.rb downloadmanager.rb group.rb nfo.rb queue.rb utils.rb Log Message: new config file format, rhs are now evaluated (strings must be quoted) new config option to disable the headers update by the program (extern_headers_update) the working directory is changed to where the main script is located at its startup (to allow the invocation by cron) misc bugfixes Index: config.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/config.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** config.rb 23 Oct 2003 21:44:29 -0000 1.2 --- config.rb 2 Feb 2004 02:41:34 -0000 1.3 *************** *** 13,17 **** next if(line =~ /^\s*(#|$)/) if(line =~ /^\s*(\S+)\s*=\s*(.*)$/) ! self[$1] = $2 if($2) end end --- 13,17 ---- next if(line =~ /^\s*(#|$)/) if(line =~ /^\s*(\S+)\s*=\s*(.*)$/) ! self[$1] = eval($2) if($2) end end Index: core.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/core.rb,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** core.rb 14 Jan 2004 22:01:43 -0000 1.24 --- core.rb 2 Feb 2004 02:41:57 -0000 1.25 *************** *** 73,77 **** groups = $dbh.select_all 'select `fullname` from `groups` where active="yes"' - puts "kikoo" groups.each do |group| name = group.to_s --- 73,76 ---- Index: db.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/db.rb,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** db.rb 28 Dec 2003 20:04:03 -0000 1.20 --- db.rb 2 Feb 2004 02:41:57 -0000 1.21 *************** *** 215,219 **** req += " from #{table} where " + ids_constraint ! puts req sth = Db.dbh.execute req hash = sth.fetch_hash --- 215,219 ---- req += " from #{table} where " + ids_constraint ! debug 'DB: '+ req sth = Db.dbh.execute req hash = sth.fetch_hash *************** *** 278,282 **** req += ')' ! puts req exec_request req end --- 278,282 ---- req += ')' ! debug 'DB: ' + req exec_request req end Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** downloader.rb 27 Dec 2003 20:01:54 -0000 1.15 --- downloader.rb 2 Feb 2004 02:41:57 -0000 1.16 *************** *** 131,135 **** @io.close @t.exit ! time = `date`.chomp $dbh.do 'lock tables queue write' $dbh.do "update queue set `status` = 'FINISHED', `date_finished`=NOW() where `id` = '#{@id}'" --- 131,135 ---- @io.close @t.exit ! time = Time.now.to_s $dbh.do 'lock tables queue write' $dbh.do "update queue set `status` = 'FINISHED', `date_finished`=NOW() where `id` = '#{@id}'" Index: downloadmanager.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloadmanager.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** downloadmanager.rb 28 Dec 2003 20:04:04 -0000 1.12 --- downloadmanager.rb 2 Feb 2004 02:41:57 -0000 1.13 *************** *** 29,33 **** begin loop do ! log "current : #{@current_dlers}, max : #{@max_dlers}" if (@current_dlers < @max_dlers) start_new_downloader --- 29,33 ---- begin loop do ! # log "current : #{@current_dlers}, max : #{@max_dlers}" if (@current_dlers < @max_dlers) start_new_downloader Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** group.rb 27 Dec 2003 18:13:36 -0000 1.20 --- group.rb 2 Feb 2004 02:41:57 -0000 1.21 *************** *** 65,72 **** def Group.show(onlyactive = false) ! labels = Array["Added" , "Last update" , "Directory", "Active"] ! keys = Array["date_added", "date_updated", "directory", "active"] ! req = "" req = " where `active` = 'yes' " if onlyactive req += 'order by `date_added`' --- 65,72 ---- def Group.show(onlyactive = false) ! labels = Array['Added' , 'Last update' , 'Directory', 'Active'] ! keys = Array['date_added', 'date_updated', 'directory', 'active'] ! req = '' req = " where `active` = 'yes' " if onlyactive req += 'order by `date_added`' *************** *** 120,125 **** def search(filter) ! sth = Db.dbh.execute("select * from `articles` where `group` = ? and ! `subject` LIKE ? order by `time` desc", @_fullname, "%"+filter+"%") sth.fetch_hash do |row| puts row['subject'] --- 120,124 ---- def search(filter) ! sth = Db.dbh.execute('select * from `articles` where `group` = ? and `subject` LIKE ? order by `time` desc', @_fullname, '%'+filter+'%') sth.fetch_hash do |row| puts row['subject'] *************** *** 129,135 **** def update clear_articles clear_nfos - updatecache mknewscache fetchnfos --- 128,134 ---- def update + updatecache unless $config['extern_headers_update'].split(',').include?(@_shortname) clear_articles clear_nfos mknewscache fetchnfos *************** *** 139,152 **** def clear_articles ! debug "Beginning clear_articles at #{`date`.chomp}" nb_rows = Db.dbh.execute "delete from `articles` where `group` = '#{@_fullname}'" ! debug "End clear_articles at #{`date`.chomp}" end def clear_nfos ! debug "Beginning clear_nfos at #{`date`.chomp}" nb_rows = Db.dbh.do "delete from `nfos` where `group` = '#{@_fullname}'" ! puts "#{nb_rows} nfos deleted" ! debug "End clear_nfos at #{`date`.chomp}" end --- 138,151 ---- def clear_articles ! debug "Beginning clear_articles at #{Time.now.strftime('%H:%M:%S')}" nb_rows = Db.dbh.execute "delete from `articles` where `group` = '#{@_fullname}'" ! debug "End clear_articles at #{Time.now.strftime('%H:%M:%S')}" end def clear_nfos ! debug "Beginning clear_nfos at #{Time.now.strftime('%H:%M:%S')}" nb_rows = Db.dbh.do "delete from `nfos` where `group` = '#{@_fullname}'" ! debug "#{nb_rows} nfos deleted" ! debug "End clear_nfos at #{Time.now.strftime('%H:%M:%S')}" end *************** *** 160,195 **** def updatecache ! debug "Beginning updatecache at #{`date`.chomp}" ! `nice -n19 #{@nget} -q -g #{@_fullname} -l 99999 -r 'DummyString'` ! debug "End updatecache at #{`date`.chomp}" end def mknewscache ! debug "Beginning mknewscache at #{`date`.chomp}" sth = Db.dbh.prepare 'insert into articles(`group`, `mid`, `nbparts`, `size`, `subject`, `from`, `time`, `rls_subject`) values (?, ?, ?, ?, ?, ?, FROM_UNIXTIME(?), ?)' debug 'Parsing cache' cachefile = Zlib::GzipReader.open("#{@cachedir}/#{@_fullname},cache.gz") while line = cachefile.gets next if line !~ /^(\d+)\t0\t/ or $1.to_i < 1 parts, subject, from = line.split(/\t/).values_at(0, 3, 4) parts = parts.to_i ! next if cachefile.gets != ".\n" partcnt = 0 - line = cachefile.gets - size = 0 while line != ".\n" ! time, mid = /^\d+\t(.*)\t(.*)$/.match(line).values_at(1,2) ! while line = cachefile.gets ! if line == ".\n" ! line = cachefile.gets ! break ! else ! serverid, bytes, lines = line.split(/\t/).values_at(1,2,3).collect {|x| x.to_i} ! end end ! lines = lines<1 ? 1 : lines linelength = (bytes / lines).to_i size = size.to_i + (bytes / ( linelength < 100 ? 1.39 : 1.0334 )) --- 159,194 ---- def updatecache ! debug "Beginning updatecache at #{Time.now.strftime('%H:%M:%S')}" ! # to avoid ngetsuite poisoning ! n = rand(900000)+100000 ! `nice -n19 #{@nget} -q -g #{@_fullname} -c -r '^#{n}Dummy'` ! debug "End updatecache at #{Time.now.strftime('%H:%M:%S')}" end def mknewscache ! debug "Beginning mknewscache at #{Time.now.strftime('%H:%M:%S')}" sth = Db.dbh.prepare 'insert into articles(`group`, `mid`, `nbparts`, `size`, `subject`, `from`, `time`, `rls_subject`) values (?, ?, ?, ?, ?, ?, FROM_UNIXTIME(?), ?)' debug 'Parsing cache' cachefile = Zlib::GzipReader.open("#{@cachedir}/#{@_fullname},cache.gz") + while (cachefile.gets != ".\n") + end while line = cachefile.gets next if line !~ /^(\d+)\t0\t/ or $1.to_i < 1 parts, subject, from = line.split(/\t/).values_at(0, 3, 4) parts = parts.to_i ! while (cachefile.gets != ".\n") ! end partcnt = 0 size = 0 + line = cachefile.gets while line != ".\n" ! line =~ /^\d+\t(.*)\t(.*)$/ ! time, mid = $1, $2 ! while (line = cachefile.gets) != ".\n" ! serverid, bytes, lines = line.split(/\t/).values_at(1,2,3).collect {|x| x.to_i} end ! lines = 1 if lines < 1 linelength = (bytes / lines).to_i size = size.to_i + (bytes / ( linelength < 100 ? 1.39 : 1.0334 )) *************** *** 205,214 **** end cachefile.close ! # File.delete("#{$tempdir}/cache") ! debug "End mknewscache at #{`date`.chomp}" end def fetchnfos `nice -n19 #{@nget} --path #{$tempdir} -G #{@_fullname} -K -L 150 -r '\.nfo|\.txt'` `#{@nget} --path #{$tempdir} -qq -G #{@_fullname} -U -r '\.nfo|\.txt'` --- 204,214 ---- end cachefile.close ! debug "End mknewscache at #{Time.now.strftime('%H:%M:%S')}" end def fetchnfos + # fetches the nfos `nice -n19 #{@nget} --path #{$tempdir} -G #{@_fullname} -K -L 150 -r '\.nfo|\.txt'` + # but mark them as if we didn't download them `#{@nget} --path #{$tempdir} -qq -G #{@_fullname} -U -r '\.nfo|\.txt'` *************** *** 217,221 **** pwd = Dir.pwd Dir.chdir($tempdir) ! Dir["ngettemp-*"].each { |file| File.open(file).each { |line| line =~ /^Message-ID: (.*)$/ --- 217,221 ---- pwd = Dir.pwd Dir.chdir($tempdir) ! Dir['ngettemp-*'].each { |file| File.open(file).each { |line| line =~ /^Message-ID: (.*)$/ Index: nfo.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/nfo.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nfo.rb 6 Nov 2003 16:02:17 -0000 1.3 --- nfo.rb 2 Feb 2004 02:41:57 -0000 1.4 *************** *** 51,54 **** --- 51,55 ---- end sth.finish + puts "No nfos found." if i == 0 end Index: queue.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/queue.rb,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** queue.rb 27 Dec 2003 18:13:36 -0000 1.18 --- queue.rb 2 Feb 2004 02:41:57 -0000 1.19 *************** *** 136,141 **** s += ", finished : #{_date_finished}" end ! if @period != 0 ! s += " (period = #{_period}s)" end s --- 136,141 ---- s += ", finished : #{_date_finished}" end ! if @_period != 0 ! s += " (period = #{@_period}s)" end s Index: utils.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/utils.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** utils.rb 3 Nov 2003 14:58:06 -0000 1.8 --- utils.rb 2 Feb 2004 02:41:57 -0000 1.9 *************** *** 24,28 **** def Utils.debug(message=nil) ! puts "DEBUG: #{message}" if($config["debug"] && message) end --- 24,28 ---- def Utils.debug(message=nil) ! puts "DEBUG: #{message}" if($config['debug'] && message) end |
From: <bla...@us...> - 2004-01-20 23:15:57
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1:/tmp/cvs-serv31212 Modified Files: HOWTO Log Message: added some details Index: HOWTO =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/HOWTO,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HOWTO 15 Jan 2004 11:13:10 -0000 1.1 --- HOWTO 20 Jan 2004 23:15:54 -0000 1.2 *************** *** 1,16 **** How to use ngetsuite : - Before everything, start the daemon and optionnaly the httpd - - ./daemon.rb >/dev/null 2>&1 & - ./testhttpd.rb >testhttpd.log 2>&1 & - disown -a you can show the groups watched with ! ./ngetsuite.rb -s ! you must regularly update the news reader cache with for example a crontab like this : 10 5 * * * ~/ngetupdate.sh --- 1,29 ---- How to use ngetsuite : + I) Launching the daemon and the web server + ------------------------------------------ + Before everything, start the daemon and optionnaly the httpd : + ./daemon.rb >/dev/null 2>&1 & + ./testhttpd.rb >testhttpd.log 2>&1 & + disown -a you can show the groups watched with + ./ngetsuite.rb -s ! II) Add some groups ! ------------------- ! Add one or more groups with : ! ./ngetsuite.rb -a alt.binaries.pictures.linux,linux-pics,/home/me/download/abpl + The last two arguments are optional (see ./ngetsuite.rb -h for the full list of + possible arguments). If no id is provided, it will be created from the first + letter of each component of the full name (alt.binaries.pictures.linux => abpl). ! You can get the full list of registered newsgroup with the command : ! ./ngetsuite.rb -s ! ! III) Update the headers from the news server ! -------------------------------------------- ! you must update the news reader cache with for example a crontab like this : 10 5 * * * ~/ngetupdate.sh *************** *** 21,35 **** ./ngetsuite.rb -v you can void the output if you don't want mails from cron. ! Add one or more groups with ! ./ngetsuite.rb -a alt.binaries.martine.xxx,abmx28,/home/me/downloadMartine ! Then you select the things you want to download with ! TODO happy download ! --- 34,65 ---- ./ngetsuite.rb -v + This will fetch the headers from the news server, parse the cache file and + insert the headers into the mysql database. + you can void the output if you don't want mails from cron. + Alternatively, you can update a specific group with : + ./ngetsuite.rb -u groupid ! IV) Add a regexp to the download queue ! -------------------------------------- ! You must add a queue to download with : ! ./ngetsuite.rb -r groupid,regexp,prio ! ie : ! ./ngetsuite.rb -r linux-pics,penguin,7 + Finally, you must start the monitoring with ./ngetsuite.rb -m : the daemon will + then look for the queue with a 'PENDING' status and the greatest priority, + mark this queue as 'PROCESSING' and start a nget instance with the corresponding + regexp. ! When the nget process has finished, the queue will be marked as 'FINISHED'. If ! you want to start processing this queue again (because of a network failure), ! you just have to change the status of the queue to 'PENDING' with : ! ./ngetsuite.rb -i queueid,PENDING + You can get the list of queued items with : + ./ngetsuite.rb -m happy download ! |
From: <jj...@us...> - 2004-01-15 11:13:13
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1:/tmp/cvs-serv19692 Added Files: HOWTO Log Message: added help for end users (to complete) --- NEW FILE: HOWTO --- How to use ngetsuite : Before everything, start the daemon and optionnaly the httpd ./daemon.rb >/dev/null 2>&1 & ./testhttpd.rb >testhttpd.log 2>&1 & disown -a you can show the groups watched with ./ngetsuite.rb -s you must regularly update the news reader cache with for example a crontab like this : 10 5 * * * ~/ngetupdate.sh content of ~/ngetupdate.sh : #!/bin/sh cd ~/ngetsuite ./ngetsuite.rb -v you can void the output if you don't want mails from cron. Add one or more groups with ./ngetsuite.rb -a alt.binaries.martine.xxx,abmx28,/home/me/downloadMartine Then you select the things you want to download with TODO happy download ! |
From: <jj...@us...> - 2004-01-14 22:42:18
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1:/tmp/cvs-serv24131 Modified Files: sampleconfig testhttpd.rb Log Message: added httpd_port in config Index: sampleconfig =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/sampleconfig,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sampleconfig 27 Dec 2003 15:52:37 -0000 1.5 --- sampleconfig 14 Jan 2004 22:42:15 -0000 1.6 *************** *** 15,16 **** --- 15,18 ---- debug = 0 + httpd_port = 2000 + Index: testhttpd.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/testhttpd.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testhttpd.rb 3 Nov 2003 14:58:05 -0000 1.2 --- testhttpd.rb 14 Jan 2004 22:42:15 -0000 1.3 *************** *** 9,13 **** s = HTTPServer.new( ! :Port => 2000, :DocumentRoot => Dir::pwd + "/web" ) --- 9,13 ---- s = HTTPServer.new( ! :Port => ($config['httpd_port'] or 2000), :DocumentRoot => Dir::pwd + "/web" ) |
From: <jj...@us...> - 2004-01-14 22:01:57
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1:/tmp/cvs-serv4254/ngetsuite Modified Files: core.rb Log Message: needed string escaping in group deletion Index: core.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/core.rb,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** core.rb 3 Nov 2003 19:01:11 -0000 1.23 --- core.rb 14 Jan 2004 22:01:43 -0000 1.24 *************** *** 65,69 **** def delete_group(groupid) name = Group.getname(groupid) ! $dbh.do("delete from `groups` where `fullname` = #{name}") end --- 65,69 ---- def delete_group(groupid) name = Group.getname(groupid) ! $dbh.do("delete from `groups` where `fullname` = \"#{name}\"") end |
From: <bla...@us...> - 2003-12-28 20:04:08
|
Update of /cvsroot/ngetsuite/ngetsuite/web In directory sc8-pr-cvs1:/tmp/cvs-serv27651/web Modified Files: webrick.rhtml Log Message: some fixes ... Index: webrick.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/webrick.rhtml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** webrick.rhtml 6 Nov 2003 16:02:18 -0000 1.5 --- webrick.rhtml 28 Dec 2003 20:04:04 -0000 1.6 *************** *** 7,12 **** web = NgetSuite::Web.new(servlet_request) ! web.handle_args ! web.update_queue %> --- 7,21 ---- web = NgetSuite::Web.new(servlet_request) ! begin ! web.handle_args ! web.update_queue ! rescue Exception => e ! puts "Exception : " + e ! puts " => " + e.message ! print e.backtrace.join("\n") ! rescue Error => e ! puts "Error : " + e ! print e.backtrace.join("\n") ! end %> *************** *** 131,137 **** <% } %> </select></td> ! <td><%= NgetSuite::Utils.pretty_date q._date_added %></td> ! <td><%= NgetSuite::Utils.pretty_date q._date_started %></td> ! <td><%= NgetSuite::Utils.pretty_date q._date_finished %></td> <td><input type='checkbox' name='toremove' value='<%= q._id %>'></td> </tr> --- 140,146 ---- <% } %> </select></td> ! <td><%= q._date_added.strftime("%d/%m/%y %H:%M") if q._date_added %></td> ! <td><%= q._date_started.strftime("%d/%m/%y %H:%M") if q._date_started %></td> ! <td><%= q._date_finished.strftime("%d/%m/%y %H:%M") if q._date_finished %></td> <td><input type='checkbox' name='toremove' value='<%= q._id %>'></td> </tr> |
From: <bla...@us...> - 2003-12-28 20:04:08
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1:/tmp/cvs-serv27651/ngetsuite Modified Files: db.rb downloadmanager.rb Log Message: some fixes ... Index: db.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/db.rb,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** db.rb 27 Dec 2003 20:01:54 -0000 1.19 --- db.rb 28 Dec 2003 20:04:03 -0000 1.20 *************** *** 307,312 **** req = "update #{table} set " req += fields(self.class).map{ |name,field| ! value = field.todb(method('_'+name).call) ! "`#{name}`='#{value}'" if value }.compact.join ', ' req += ' where ' + ids_constraint --- 307,314 ---- req = "update #{table} set " req += fields(self.class).map{ |name,field| ! v = method('_'+name).call ! next if not v ! value = field.todb(v) ! "`#{name}`='#{value}'" }.compact.join ', ' req += ' where ' + ids_constraint Index: downloadmanager.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloadmanager.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** downloadmanager.rb 27 Dec 2003 20:01:54 -0000 1.11 --- downloadmanager.rb 28 Dec 2003 20:04:04 -0000 1.12 *************** *** 36,40 **** sleep(@poll_interval) end ! rescue rescueException => e puts "Exception : " + e puts " => " + e.message --- 36,40 ---- sleep(@poll_interval) end ! rescue Exception => e puts "Exception : " + e puts " => " + e.message |
From: <ys...@us...> - 2003-12-28 12:34:19
|
Update of /cvsroot/ngetsuite/ngetsuite/web In directory sc8-pr-cvs1:/tmp/cvs-serv10571 Added Files: dump.rhtml Log Message: experimental test file for release detection (very incomplete; has to be handled during group update & stored into db) --- NEW FILE: dump.rhtml --- <% require 'ngetsuite/db' require 'ngetsuite/utils' require 'ngetsuite/web' web = NgetSuite::Web.new(servlet_request) web.handle_args web.update_queue class Release attr_reader :files attr_writer :files attr_reader :nbexpected attr_reader :refsubject def initialize @files = Array.new @nbfiles = 0 @lastnb = 0 end def nbactual return @files.size end # Returns the index of current file/nb of files # if guessed from the subject (0 if not) def Release.filenb_from_subject(subject) subject =~ /[\[\( ](\d+)([\/]|\s?of\s?)(\d+)[\]\) ]/ return [$1.to_i, $3.to_i] end # Magic function to tell if an article belongs to a release # It adds it and return true if it does, return false if not def add?(mid,subject,author) fn = Release.filenb_from_subject(subject) # If the release is still empty, everything matches # And this file will act as a reference for the others if @files.empty? then @refsubject = subject @author = author @nbexpected = fn[1] if fn[1] @lastnb = fn[0] if fn[0] @files.push [mid,subject,fn[0]] return true end return false if author != @author return false if fn[1] != @nbexpected return false if fn[0] <= @lastnb if 1 # TODO Compare subject with the reference @files.push [mid,subject,fn[0]] return true end end def rlsmap return "" if !@nbexpected map = '_' * @nbexpected @files.each { |file| map[file[2]-1] = '#' if file[2] > 0 and file[2] <= map.size } return map end end %> <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <link href="ngetsuite.css" rel="stylesheet" type="text/css"> <title>Queue editor</title> </head> <body style="font-size: 8pt;"> <% if web.group != nil req = "select articles.mid, DATE_FORMAT(`time`, '%e/%c %H:%i'), `subject`, `size`,`from`, nfos.mid from `articles` LEFT JOIN `nfos` USING (`mid`) where articles.group = '#{web.group._fullname}' " if web.filter != nil req += " and LOWER(`subject`) LIKE '%#{web.filter.downcase}%' " end req += "ORDER BY `subject`;" # req += " order by `time` desc limit #{web.offset},#{web.articles_by_page} " puts req sth = NgetSuite::Db.dbh.execute req rls = Release.new sth.fetch do |row| if rls.add?(row[0],row[2],row[4]) == false then # New release! Dump the footer for the current one %> <center><b><%= rls.nbactual.to_s+"/"+rls.nbexpected.to_s %> file(s), <code>[<%= rls.rlsmap %>]</code></b></center><hr> <% # And make another rls = Release.new rls.add?(row[0],row[2],row[4]) end %> <b><%= row[1] %></b> <%= (row[5]) ? "<a target=\"_blank\" href=\"nfoviewer.rhtml?mid=#{WEBrick::HTTPUtils.escape(row[0])}\">#{row[2]}</a>" : row[2] %> <br /> <% end sth.finish end %> </body> </html> <% NgetSuite::Db.dbh.disconnect %> |
From: <bla...@us...> - 2003-12-27 20:18:03
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1:/tmp/cvs-serv13933/ngetsuite Modified Files: db.rb downloader.rb downloadmanager.rb queue_file.rb Log Message: some bugfixes Index: db.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/db.rb,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** db.rb 27 Dec 2003 18:13:36 -0000 1.18 --- db.rb 27 Dec 2003 20:01:54 -0000 1.19 *************** *** 229,233 **** def ids_constraint ! ids(self.class).each{ |id| f = fields(self.class)[id] value = f.todb(method('_'+id)).call --- 229,233 ---- def ids_constraint ! ids(self.class).map{ |id| f = fields(self.class)[id] value = f.todb(method('_'+id)).call Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** downloader.rb 27 Dec 2003 18:13:36 -0000 1.14 --- downloader.rb 27 Dec 2003 20:01:54 -0000 1.15 *************** *** 1,4 **** --- 1,5 ---- require 'ngetsuite/queue_file' require 'ngetsuite/utils' + require 'ftools' module NgetSuite *************** *** 84,87 **** --- 85,89 ---- @start_time = Time.new @status = 'PROCESSING' + puts "before locking" $dbh.do 'lock tables queue write' $dbh.do "update queue set `status` = 'PROCESSING', `date_started`= NOW() where `id` = '#{@id}'" Index: downloadmanager.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloadmanager.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** downloadmanager.rb 2 Nov 2003 19:14:29 -0000 1.10 --- downloadmanager.rb 27 Dec 2003 20:01:54 -0000 1.11 *************** *** 27,37 **** @started = true @mainThread = Thread.new { ! loop do ! log "current : #{@current_dlers}, max : #{@max_dlers}" ! if (@current_dlers < @max_dlers) ! start_new_downloader end ! check_finished_dls ! sleep(@poll_interval) end } --- 27,50 ---- @started = true @mainThread = Thread.new { ! begin ! loop do ! log "current : #{@current_dlers}, max : #{@max_dlers}" ! if (@current_dlers < @max_dlers) ! start_new_downloader ! end ! check_finished_dls ! sleep(@poll_interval) end ! rescue rescueException => e ! puts "Exception : " + e ! puts " => " + e.message ! print e.backtrace.join("\n") ! rescue Error => e ! puts "Error : " + e ! print e.backtrace.join("\n") ! rescue DBI::DatabaseError => e ! puts 'An error occurred' ! puts 'Error code: ' + e.err ! puts 'Error message: ' + e.errstr end } Index: queue_file.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/queue_file.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** queue_file.rb 27 Dec 2003 18:13:36 -0000 1.12 --- queue_file.rb 27 Dec 2003 20:01:54 -0000 1.13 *************** *** 58,62 **** @_filename = 'not found' if (@_filename == nil) ! @_date_finished = format_date(Time.now) if res --- 58,62 ---- @_filename = 'not found' if (@_filename == nil) ! @_date_finished = Time.now if res |
From: <bla...@us...> - 2003-12-27 18:17:56
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1:/tmp/cvs-serv30444 Modified Files: db.rb downloader.rb group.rb queue.rb queue_file.rb Log Message: major cleanup of db abstraction Index: db.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/db.rb,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** db.rb 6 Nov 2003 16:02:17 -0000 1.17 --- db.rb 27 Dec 2003 18:13:36 -0000 1.18 *************** *** 2,6 **** module Db @@db_handler = nil ! ## Exceptions class TableNotFoundException < Exception --- 2,6 ---- module Db @@db_handler = nil ! ## Exceptions class TableNotFoundException < Exception *************** *** 31,34 **** --- 31,99 ---- class MissingAttrReader < NameError end + ## End of exceptions + + class DbField + # Some simple procedures to convert ruby internal types to db format + @@todb = Hash.new + @@todb['default'] = proc {|x| x} + @@todb['datetime'] = proc {|date| date.strftime('%Y-%m-%d %H:%M:%S')} + @@todb['int'] = proc {|i| i.to_s} + @@todb['smallint'] = proc {|i| i.to_s} + @@todb['varchar'] = proc {|x| + x.respond_to?('to_s') ? x.to_s : x + } + + @@fromdb = Hash.new + @@fromdb['default'] = proc {|x| x} + @@fromdb['datetime'] = proc {|datestr| + #datestr => 2003-12-27 01:58:43 + date, time = datestr.to_s.split(' ') + y, m, d = date.split('-') + h, min, s = time.split(':') + Time.local(y, m, d, h, min, s) + } + @@fromdb['int'] = proc {|str| str.to_i} + @@fromdb['smallint'] = proc {|str| str.to_i} + @@fromdb['double'] = proc {|str| str.to_f} + + + attr_reader :name, :type, :null, :key, :default, :extra + + def initialize(name, type, null, key, default, extra) + @name, @type, @null, @key, @default, @extra = + name, type, null, key, default, extra + end + + def todb(value) + if @@todb.has_key? @type + @@todb[@type].call(value) + else + @@todb['default'].call(value) + end + end + + def fromdb(value) + if @@fromdb.has_key? @type + @@fromdb[@type].call(value) + else + @@fromdb['default'].call(value) + end + end + + def key? + @key == 'PRI' + end + + # True if this field can be NULL + def null? + @null == 'YES' + end + + # A field is mandatory when it cannot be NULL and + # does not have a default value + def mandatory? + (not null?) and (@default == '') and (@extra != 'auto_increment') + end + end class DbList *************** *** 45,55 **** return unless @sth table = @@tables[@klass] ! attrs = @@attrs[table] ids = @@ids[table] @sth.fetch_hash do |row| ! ids_value = ids.collect { |id| row[id] } o = @klass.new(*ids_value) ! attrs.each { |attr,mandatory| ! o.method('_'+attr+'=').call(row[attr]) if row.has_key? attr } yield o --- 110,127 ---- return unless @sth table = @@tables[@klass] ! fields = @@fields[table] ids = @@ids[table] @sth.fetch_hash do |row| ! ids_value = ids.collect { |id| ! field = fields[id] ! field.fromdb(row[id]) ! } o = @klass.new(*ids_value) ! fields.each { |name, field| ! next if field.key? ! next if not row.has_key? name ! next if not row[name] ! value = field.fromdb(row[name]) ! o.method('_'+name+'=').call(value) } yield o *************** *** 57,62 **** end end - - ## End of exceptions def Db.dbh --- 129,132 ---- *************** *** 69,76 **** end - ## Database registry @@tables = Hash.new ! @@attrs = Hash.new @@ids = Hash.new --- 139,145 ---- end ## Database registry @@tables = Hash.new ! @@fields = Hash.new @@ids = Hash.new *************** *** 79,86 **** end ! def Db.attrs(klass, attrs_list) table = @@tables[klass] ! @@attrs[table] = attrs_list ! build_classattrs(klass) end --- 148,155 ---- end ! def Db.fields(klass, fields) table = @@tables[klass] ! @@fields[table] = fields ! build_accessors(klass) end *************** *** 105,110 **** end ! def attrs(klass) ! @@attrs[Db.get_table(klass)] end --- 174,179 ---- end ! def fields(klass) ! @@fields[Db.get_table(klass)] end *************** *** 113,155 **** end ! def Db.build_classattrs(klass) ! table = Db.get_table(klass) ! attrs_list = @@attrs[table] ! attrs_list.each { |attr, mandatory| ! if !respond_to?('_'+attr) ! # Defines the reader ! eval <<-"end_eval" ! class #{klass} ! attr_reader :_#{attr} ! end ! end_eval ! end ! if !respond_to?('_'+attr+'=') ! # Defines the writer ! eval <<-"end_eval" ! class #{klass} ! attr_writer :_#{attr} ! end ! end_eval ! end ! } ! ! ids = @@ids[table] ! ids.each { |id| ! # Defines the setter except for keys ! #puts "def default getter for key #{id}" eval <<-"end_eval" class #{klass} ! attr_reader :_#{id} end end_eval ! } end def update_from_db table = Db.get_table(self.class) ! req = 'select ' + attrs(self.class).keys.map{|key| "`#{key}`" }.join(',') req += " from #{table} where " + ids_constraint --- 182,216 ---- end ! def Db.build_accessors(klass) ! table = Db.get_table(klass) ! fields = @@fields[table] ! fields.each { |name, field| ! if !respond_to?('_'+name) ! # Defines the reader ! eval <<-"end_eval" ! class #{klass} ! attr_reader :_#{name} ! end ! end_eval ! end ! ! # No attr_writer for key fields ! next if field.key? ! if !respond_to?('_'+name+'=') ! # Defines the writer eval <<-"end_eval" class #{klass} ! attr_writer :_#{name} end end_eval ! end ! } end def update_from_db table = Db.get_table(self.class) ! req = 'select ' + fields(self.class).keys.map{|name| "`#{name}`" }.join(',') req += " from #{table} where " + ids_constraint *************** *** 157,163 **** sth = Db.dbh.execute req hash = sth.fetch_hash ! attrs(self.class).each_key { |attr| ! if hash.has_key?(attr) && hash[attr] ! m = method('_'+attr+'=').call(hash[attr]) end } --- 218,226 ---- sth = Db.dbh.execute req hash = sth.fetch_hash ! fields(self.class).each { |name,field| ! next if field.key? ! if hash.has_key?(name) && hash[name] ! value = field.fromdb(hash[name]) ! m = method('_'+name+'=').call(value) end } *************** *** 166,176 **** def ids_constraint ! ids(self.class).map{ |id| "`#{id}` = '#{method('_'+id).call}' " }.join 'and ' end # This method checks that each name in names corresponds to a method def check_missing_values ! attrs(self.class).each { |name,mandatory| ! next if !mandatory begin m = method('_'+name) --- 229,243 ---- def ids_constraint ! ids(self.class).each{ |id| ! f = fields(self.class)[id] ! value = f.todb(method('_'+id)).call ! "`#{id}` = '#{value}' " ! }.join 'and ' end # This method checks that each name in names corresponds to a method def check_missing_values ! fields(self.class).each { |name,field| ! next if !field.mandatory? begin m = method('_'+name) *************** *** 184,192 **** end ! def attr_list_to_s(only_mandatory = false, only_setted = false) ! attrs(self.class).map{ |attr, mandatory| ! next if only_mandatory and not mandatory ! next if only_setted and not method('_'+attr).call ! "`#{attr}`" }.compact.join ', ' end --- 251,259 ---- end ! def fields_list_to_s(only_mandatory = false, only_setted = false) ! fields(self.class).map{ |name, field| ! next if only_mandatory and not field.mandatory? ! next if only_setted and not method('_'+name).call ! "`#{name}`" }.compact.join ', ' end *************** *** 201,231 **** req = "insert into `#{table}` (" ! req += attr_list_to_s(only_mandatory, true) req += ') values (' ! req += attrs(self.class).map{ |attr, mandatory| ! next if only_mandatory and not mandatory ! value = method('_'+attr).call ! "'#{value}'" if value }.compact.join ', ' req += ')' exec_request req end def Db.autotable(klass, table) ! attrs = Hash.new ids = Array.new @@tables[klass] = table sth = Db.dbh.execute 'show fields from ' + table ! sth.fetch { |row| ! if row[3] == 'PRI' ! ids << row[0] ! end ! if row[5] != 'auto_increment' ! attrs[row[0]] = ((row[2]=='') and (row[4]=='')) end } Db.ids(klass, ids) ! Db.attrs(klass, attrs) end --- 268,302 ---- req = "insert into `#{table}` (" ! req += fields_list_to_s(only_mandatory, true) req += ') values (' ! req += fields(self.class).map{ |name, field| ! next if only_mandatory and not field.mandatory? ! value = method('_'+name).call ! next if not value ! "'#{field.todb(value)}'" }.compact.join ', ' req += ')' + + puts req exec_request req end def Db.autotable(klass, table) ! fields = Hash.new ids = Array.new @@tables[klass] = table sth = Db.dbh.execute 'show fields from ' + table ! sth.fetch_hash { |row| ! name, type, null, key, default, extra = ! row['Field'], row['Type'], row['Null'], row['Key'], row['Default'], row['Extra'] ! field = DbField.new(name, type, null, key, default, extra) ! if field.key? ! ids << name end + fields[name] = field } Db.ids(klass, ids) ! Db.fields(klass, fields) end *************** *** 235,241 **** req = "update #{table} set " ! req += attrs(self.class).keys.map{ |attr| ! value = method('_'+attr).call ! "`#{attr}`='#{value}'" if value }.compact.join ', ' req += ' where ' + ids_constraint --- 306,312 ---- req = "update #{table} set " ! req += fields(self.class).map{ |name,field| ! value = field.todb(method('_'+name).call) ! "`#{name}`='#{value}'" if value }.compact.join ', ' req += ' where ' + ids_constraint Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** downloader.rb 3 Nov 2003 14:58:06 -0000 1.13 --- downloader.rb 27 Dec 2003 18:13:36 -0000 1.14 *************** *** 39,43 **** def update_status(line) ! debug (Utils.red "begin update_status") if line =~ /^already have .*\n$/ @nbfiles += 1 --- 39,43 ---- def update_status(line) ! debug(Utils.red("begin update_status")) if line =~ /^already have .*\n$/ @nbfiles += 1 *************** *** 80,87 **** def start ! time = `date`.chomp ! `mkdir -p #{dest}` ! Dir.chdir dest ! @start_time = `date`.chomp @status = 'PROCESSING' $dbh.do 'lock tables queue write' --- 80,86 ---- def start ! File.makedirs(@dest) ! Dir.chdir(@dest) ! @start_time = Time.new @status = 'PROCESSING' $dbh.do 'lock tables queue write' *************** *** 92,100 **** begin io.each { |line| ! debug (Utils.blue line) update_status line } rescue Exception => e puts "Exception : " + e print e.backtrace.join("\n") rescue Error => e --- 91,100 ---- begin io.each { |line| ! debug(Utils.blue(line)) update_status line } rescue Exception => e puts "Exception : " + e + puts " => " + e.message print e.backtrace.join("\n") rescue Error => e Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** group.rb 3 Nov 2003 19:01:11 -0000 1.19 --- group.rb 27 Dec 2003 18:13:36 -0000 1.20 *************** *** 98,109 **** end - def _date_added - format_date(@_date_added) - end - - def _date_updated - format_date(@_date_updated) - end - def _active @_active ? 'yes' : 'no' --- 98,101 ---- Index: queue.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/queue.rb,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** queue.rb 3 Nov 2003 19:01:12 -0000 1.17 --- queue.rb 27 Dec 2003 18:13:36 -0000 1.18 *************** *** 146,162 **** <td class='prio'>#{@priority}</td><td class='status'>#{@status}</td></tr>" end - - def _date_added=(date) - @_date_added = format_date(date) - end - - def _date_started=(date) - @_date_started = format_date(date) - end - - def _date_finished=(date) - @_date_finished = format_date(date) - end - end --- 146,149 ---- Index: queue_file.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/queue_file.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** queue_file.rb 2 Nov 2003 19:14:29 -0000 1.11 --- queue_file.rb 27 Dec 2003 18:13:36 -0000 1.12 *************** *** 28,32 **** end ! def initialize(queueid, mid, fetch_from_db = false, parts = 0, nblines = 0, filenumber = 0, size = 0) @_queue_id = queueid @dlparts = Integer(parts) --- 28,32 ---- end ! def initialize(queueid, mid, fetch_from_db = false, parts = 0, nblines = 0, filenumber = 0, size = 0, filename = 'unknown') @_queue_id = queueid @dlparts = Integer(parts) *************** *** 35,48 **** @_filenumber = filenumber @_size = size ! self._date_started = Time.now update_from_db if fetch_from_db - end - - def _date_started=(date) - @_date_started = format_date(date) - end - - def _date_finished=(date) - @_date_finished = format_date(date) end --- 35,41 ---- @_filenumber = filenumber @_size = size ! @_filename = filename ! @_date_started = Time.now update_from_db if fetch_from_db end |
From: <bla...@us...> - 2003-12-27 15:52:40
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1:/tmp/cvs-serv7641 Modified Files: sampleconfig Log Message: testing loginfo Index: sampleconfig =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/sampleconfig,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sampleconfig 27 Dec 2003 15:49:01 -0000 1.4 --- sampleconfig 27 Dec 2003 15:52:37 -0000 1.5 *************** *** 14,15 **** --- 14,16 ---- debug = 0 + |