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: Kyoshiro <mib...@us...> - 2004-09-27 14:59:51
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23534/ngetsuite Modified Files: core.rb downloader.rb nfo.rb queue.rb utils.rb web.rb Log Message: sampleconfig: add httpd error and access log entries web/ top.rhtml: add (*) pseudo group to remove group filtering release.rhtml: remove non working pretty_date release.rhtml: add release view by filter queueview.rhtml: increase queue_add regex maxlength queueview.rhtml: add sort links to queue's columns headers queueview.rhtml: reorganize queue columns queueview.rhtml: replace regex input field with link to articles list (release view by filter) group.rhtml: remove non working pretty_date search.rhtml: add file, allow searching with web interface ngetsuite/ web.rb: add some form attributes recognition web.rb: add start_html, end_html, urlencode methods queue.rb: add shortgroup method, enhance output (more \n) nfo.rb: add getnfobyregex method nfo.rb: add search method downloader.rb: remove db locks ngetsuite.rb, specif.txt, core.rb: add --search-nfo-by-subject (-N) and --search-nfo (-F) options which work like -g and -G daemon.rb: add mime types handling to make webrick send text/html for .rhtml files daemon.rb: make webrick log access/errors into files instead of output mime.types: contains css and rhtml type definitions... Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** downloader.rb 27 Sep 2004 13:04:05 -0000 1.39 --- downloader.rb 27 Sep 2004 14:59:40 -0000 1.40 *************** *** 180,186 **** @start_time = Time.new @status = 'PROCESSING' ! Db.dbh.do 'lock tables queue write' Db.dbh.do "update queue set `status`='PROCESSING', `date_started`=NOW() where `queueindex`='#{@queueindex}'" ! Db.dbh.do 'unlock tables' ignoreme = (Db.dbh.select_one "select `ignoreregex` from `groups` where `groupindex`='#{Group.getindex(@group)}'")[0] if ignoreme and ignoreme.length > 0 --- 180,186 ---- @start_time = Time.new @status = 'PROCESSING' ! # Db.dbh.do 'lock tables queue write' Db.dbh.do "update queue set `status`='PROCESSING', `date_started`=NOW() where `queueindex`='#{@queueindex}'" ! # Db.dbh.do 'unlock tables' ignoreme = (Db.dbh.select_one "select `ignoreregex` from `groups` where `groupindex`='#{Group.getindex(@group)}'")[0] if ignoreme and ignoreme.length > 0 Index: core.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/core.rb,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** core.rb 27 Sep 2004 13:04:05 -0000 1.43 --- core.rb 27 Sep 2004 14:59:40 -0000 1.44 *************** *** 109,112 **** --- 109,120 ---- end + def search_nfo_by_subject(groupid, regex) + puts Nfo.searchbysubject(groupid, regex) + end + + def search_nfo(groupid, regex) + puts Nfo.search(groupid, regex) + end + def list_releases(groupid = '') Release.list(groupid) *************** *** 246,250 **** # Simple check on the status of the queue if q._status == 'PROCESSING' ! get_manager.stop_downloader(arg) else puts "No current download for this queue" --- 254,258 ---- # Simple check on the status of the queue if q._status == 'PROCESSING' ! get_manager.stop_downloader(q._queueindex) else puts "No current download for this queue" Index: nfo.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/nfo.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** nfo.rb 27 Sep 2004 13:04:05 -0000 1.9 --- nfo.rb 27 Sep 2004 14:59:40 -0000 1.10 *************** *** 10,13 **** --- 10,49 ---- Db.autotable(Nfo, 'nfos') + def Nfo.searchbysubject(groupid, filter) + groupindex = Group.getindex(groupid) + req = "select n.artindex, n.groupindex, a.subject from `articles` a right join `nfos` n using (`artindex`) " + req += "where a.groupindex='#{groupindex}' and a.subject RLIKE '#{filter}' " + req += "order by `subject`" + sth = Db.dbh.execute req + + i = 0 + sth.fetch do |row| + puts "NFO id: #{row[0]}" + puts "Article: #{row[2]}" + i += 1 + end + sth.finish + return "No nfos found." if i == 0 + end + + def Nfo.search(groupid, filter) + groupindex = Group.getindex(groupid) + req = "select n.artindex, n.groupindex, a.subject from `articles` a " + req += "right join `nfos` n using (`artindex`) " + req += "where a.groupindex='#{groupindex}' and n.text RLIKE '#{filter}' " + req += "order by `subject`" + sth = Db.dbh.execute req + + i = 0 + sth.fetch do |row| + puts "NFO id: #{row[0]}" + puts "Article: #{row[2]}" + print "\n" + i += 1 + end + sth.finish + return "No nfos found." if i == 0 + end + def Nfo.get(groupid, n) groupindex = Group.getindex(groupid) Index: queue.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/queue.rb,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** queue.rb 9 Sep 2004 12:11:10 -0000 1.29 --- queue.rb 27 Sep 2004 14:59:40 -0000 1.30 *************** *** 127,132 **** end def to_s ! s = "#{yellow '<'}#{blue @_queueindex}#{yellow '>'} [#{red group}] #{yellow @_value}, prio : #{@_priority}, dest : #{green @_subdir}, status : #{@_status}" if (@_status == FAILED || @_status == PROCESSING) a = Db.dbh.select_all("select `status` from `queue_files` where `queueindex`='#{@_queueindex}'") --- 127,136 ---- end + def shortgroup + Group._shortname + end + def to_s ! s = "#{yellow '<'}#{blue @_queueindex}#{yellow '>'} [#{red group}] #{yellow @_value},\n\tdest : #{green @_subdir},\n\tprio : #{@_priority}, status : #{@_status} " if (@_status == FAILED || @_status == PROCESSING) a = Db.dbh.select_all("select `status` from `queue_files` where `queueindex`='#{@_queueindex}'") Index: web.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/web.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** web.rb 21 Feb 2004 15:58:18 -0000 1.8 --- web.rb 27 Sep 2004 14:59:40 -0000 1.9 *************** *** 7,11 **** class Web include Utils ! attr_reader :group, :rlsartind, :offset, :articles_by_page, :filter, :date def initialize(servlet_request) --- 7,12 ---- class Web include Utils ! attr_reader :group, :groups, :want_release, :rlsartind, :offset, :articles_by_page, :filter, ! :date, :sort, :age_max, :groupindex def initialize(servlet_request) *************** *** 21,28 **** @status = @query['status' ].list() if @query.has_key? 'status' @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' ! @rlsartind = @query['rlsartind' ].to_s if @query.has_key? 'rlsartind' @group = NgetSuite::Group.getgroup(@query['group'].to_s) if @query.has_key? 'group' @articles_by_page = 60 --- 22,51 ---- @status = @query['status' ].list() if @query.has_key? 'status' @value = @query['value' ].list() if @query.has_key? 'value' ! @groups = @query['groups' ].list() if @query.has_key? 'groups' ! @sort = @query['sort' ].to_s if @query.has_key? 'sort' @date = @query['date' ].to_s if @query.has_key? 'date' ! @rlsartind = @query['rlsartind' ].to_s if @query.has_key? 'rlsartind' ! @groupindex = @query['groupindex'].to_s if @query.has_key? 'groupindex' ! @filter = @query['filter' ].to_s if @query.has_key? 'filter' ! @group = NgetSuite::Group.getgroup(@query['group'].to_s) if @query.has_key? 'group' + @want_release = @query['want_release'] if @query.has_key? 'want_release' + if (@query.has_key? 'aging' and @query.has_key? 'aging_unit' and + @query['aging'] != '') + @age_max = @query['aging'].to_s+" " + aging_unit = @query['aging_unit'].to_s + if (aging_unit == 'd') + @age_max += 'DAY' + elsif (aging_unit == 'h') + @age_max += 'HOUR' + elsif (aging_unit == 'w') + @age_max = @query['aging'].to_i + @age_max *= 7 + @age_max = @age_max.to_s + @age_max += ' DAY' + else + @age_max += 'DAY' + end + end @articles_by_page = 60 *************** *** 124,127 **** --- 147,173 ---- end + def start_html(title) + '<?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>'+title+'</title> + </head> + <body>'+"\n" + end + + def end_html() + "</body></html>\n" + end + + def urlencode(text) + text.gsub(/[^a-zA-Z0-9\-,.*_]/) { |x| "%"+sprintf('%2X', x[0]) } + end + + # def urldecode(text) + # text.gsub(/%(\d\d)/) { |x| sprintf('%s', x[1]) } + # end + end #class Index: utils.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/utils.rb,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** utils.rb 9 Sep 2004 12:11:10 -0000 1.18 --- utils.rb 27 Sep 2004 14:59:40 -0000 1.19 *************** *** 80,83 **** --- 80,87 ---- end + def Utils.rebg msg + color(msg,RED_BG,1) + end + def format_date(date) if date.class == Time |
From: Kyoshiro <mib...@us...> - 2004-09-27 14:59:51
|
Update of /cvsroot/ngetsuite/ngetsuite/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23534/web Modified Files: group.rhtml queueview.rhtml release.rhtml top.rhtml Added Files: search.rhtml Log Message: sampleconfig: add httpd error and access log entries web/ top.rhtml: add (*) pseudo group to remove group filtering release.rhtml: remove non working pretty_date release.rhtml: add release view by filter queueview.rhtml: increase queue_add regex maxlength queueview.rhtml: add sort links to queue's columns headers queueview.rhtml: reorganize queue columns queueview.rhtml: replace regex input field with link to articles list (release view by filter) group.rhtml: remove non working pretty_date search.rhtml: add file, allow searching with web interface ngetsuite/ web.rb: add some form attributes recognition web.rb: add start_html, end_html, urlencode methods queue.rb: add shortgroup method, enhance output (more \n) nfo.rb: add getnfobyregex method nfo.rb: add search method downloader.rb: remove db locks ngetsuite.rb, specif.txt, core.rb: add --search-nfo-by-subject (-N) and --search-nfo (-F) options which work like -g and -G daemon.rb: add mime types handling to make webrick send text/html for .rhtml files daemon.rb: make webrick log access/errors into files instead of output mime.types: contains css and rhtml type definitions... Index: release.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/release.rhtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** release.rhtml 21 Feb 2004 15:58:34 -0000 1.4 --- release.rhtml 27 Sep 2004 14:59:41 -0000 1.5 *************** *** 15,30 **** attr_reader :articles, :nfos ! def initialize(groupindex,artindex,date) @articles = Array.new @nfos = Array.new ! @rls = NgetSuite::Release.new(groupindex,artindex,true) if artindex ! artq = "select * from `articles` a left join `nfos` n using (`artindex`) " ! artq += "where a.groupindex='#{groupindex}' and `rlsartindex`='#{artindex}'" ! artq += "and DATE_FORMAT(`time`, '%Y-%m-%d')='#{date}' " if date != "any" ! artq += "order by `subject`" - puts artq @sth = NgetSuite::Db.dbh.execute artq --- 15,36 ---- attr_reader :articles, :nfos ! def initialize(groupindex,artindex,filter,date) @articles = Array.new @nfos = Array.new ! if (artindex) ! @rls = NgetSuite::Release.new(groupindex,artindex,true) if artindex ! artq = "select * from `articles` a left join `nfos` n using (`artindex`) " ! artq += "where a.groupindex='#{groupindex}' and `rlsartindex`='#{artindex}' " ! artq += "and DATE_FORMAT(`time`, '%Y-%m-%d')='#{date}' " if date != "any" ! artq += "order by `subject`" ! else ! artq = "select * from `articles` a left join `nfos` n using (`artindex`) " ! artq += "where a.groupindex='#{groupindex}' and a.subject RLIKE '#{filter}' " ! artq += "and DATE_FORMAT(`time`, '%Y-%m-%d')='#{date}' " if date != "any" ! artq += "order by `subject`" ! end @sth = NgetSuite::Db.dbh.execute artq *************** *** 46,55 **** <body> ! <% rls = ReleaseArticles.new(web.group._groupindex, web.rlsartind, web.date) %> ! - <% if web.rlsartind %> <a name="top"></a> <h1>Release details</h1> --- 52,69 ---- <body> ! <% ! if (web.group != nil and web.group != "") ! idx = web.group._groupindex ! elsif (web.groupindex != nil and web.groupindex != "") ! idx = web.groupindex ! else ! raise NoSuchGroupException(nil) ! end ! rls = ReleaseArticles.new(idx, web.rlsartind, web.filter, web.date) + if web.rlsartind || web.filter + %> <a name="top"></a> <h1>Release details</h1> *************** *** 91,95 **** <% rls.articles.each { |art| %> <tr class="article"> ! <td class="time"><%= NgetSuite::Utils.pretty_date(art["time"]) %></td> <td class="subject"><%= art["subject"] %></td> <td class="size"><%= NgetSuite::Utils.pretty_size(art["size"]) %></td> --- 105,109 ---- <% rls.articles.each { |art| %> <tr class="article"> ! <td class="time"><%= art["time"] %></td> <td class="subject"><%= art["subject"] %></td> <td class="size"><%= NgetSuite::Utils.pretty_size(art["size"]) %></td> Index: queueview.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/queueview.rhtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** queueview.rhtml 20 Feb 2004 23:35:17 -0000 1.4 --- queueview.rhtml 27 Sep 2004 14:59:40 -0000 1.5 *************** *** 1,4 **** <% - require 'ngetsuite/db' require 'ngetsuite/utils' --- 1,3 ---- *************** *** 38,42 **** <%= web.offset_input %> <%= web.group_input %> ! <input class='regexp' type='text' name='regexp_to_add' size='15' maxlength='15'> subdir: <input class='regexp' type='text' name='subdir' size='20'> --- 37,41 ---- <%= web.offset_input %> <%= web.group_input %> ! <input class='regexp' type='text' name='regexp_to_add' size='15' maxlength='25'> subdir: <input class='regexp' type='text' name='subdir' size='20'> *************** *** 50,54 **** </form> </div> ! <% end %> <form method='post' name='queue'> --- 49,55 ---- </form> </div> ! <% ! end ! %> <form method='post' name='queue'> *************** *** 58,64 **** <tr class='headers'> <th><input type='checkbox' name="markall" onClick="CA(document.queue);"></th> ! <th>Queue index</th><th>Group</th><th>Value</th> ! <th>Priority</th><th>Status</th><th>Added</th> ! <th>Started</th><th>Finished</th><th>Delete</th> </tr> --- 59,72 ---- <tr class='headers'> <th><input type='checkbox' name="markall" onClick="CA(document.queue);"></th> ! <th>Del</th> ! <% # TODO in sort links, avoid losing other get values such as group... %> ! <th><a href="?sort=queueindex">Idx</a></th> ! <th><a href="?sort=groupindex">Group</a></th> ! <th><a href="?sort=value">Filter</a></th> ! <th><a href="?sort=priority">Prio</a></th> ! <th><a href="?sort=status">Status</a></th> ! <th><a href="?sort=date_added">Added</a></th> ! <th><a href="?sort=date_started">Started</a></th> ! <th><a href="?sort=date_finished">Finished</a></th> </tr> *************** *** 68,72 **** filter += " where `groupindex` = '#{web.group._groupindex}'" end ! filter += ' order by `priority` desc' NgetSuite::QueueList.new(filter).each { |q| --- 76,87 ---- filter += " where `groupindex` = '#{web.group._groupindex}'" end ! if web.sort == 'groupindex' or web.sort == 'queueindex' or web.sort == ! 'value' or web.sort == 'status' or ! web.sort == 'date_added' or web.sort == 'date_started' or ! web.sort == 'date_finished' ! filter += ' order by `'+web.sort+'` asc' ! else ! filter += ' order by `priority` desc' ! end NgetSuite::QueueList.new(filter).each { |q| *************** *** 76,82 **** <tr class='<%= q._status %>'> <td><input type='checkbox' name='selected' value='<%= q._queueindex %>'></td> <td class='id'><%= q._queueindex %></td> ! <td class='group'><a href='?group=<%= q.group %>'><%= q.group %></a></td> ! <td class='value'><input type='text' name='value' value='<%= q._value %>'></td> <td class='prio'><select name='prio'> <% for i in 1..10 %> --- 91,100 ---- <tr class='<%= q._status %>'> <td><input type='checkbox' name='selected' value='<%= q._queueindex %>'></td> + <td><input type='checkbox' name='toremove' value='<%= q._queueindex %>'></td> <td class='id'><%= q._queueindex %></td> ! <td class='group'><a target="_top" href='index.rhtml?group=<%= q.group %>'><%= q.group %></a></td> ! <!--td class='value'><input type='text' name='value' value='<%= q._value %>'></td--> ! <td class='value'><a target="left" href="release.rhtml?group=<%= q.group ! %>&filter=<%= web.urlencode(q._value) %>"><%= q._value %></a></td> <td class='prio'><select name='prio'> <% for i in 1..10 %> *************** *** 92,96 **** <td><%= q._date_started ? q._date_started.strftime("%d/%m/%y %H:%M") : "N/A" %></td> <td><%= q._date_finished ? q._date_finished.strftime("%d/%m/%y %H:%M") : "N/A" %></td> - <td><input type='checkbox' name='toremove' value='<%= q._queueindex %>'></td> </tr> --- 110,113 ---- --- NEW FILE: search.rhtml --- <% require 'ngetsuite/db' require 'ngetsuite/utils' require 'ngetsuite/group' require 'ngetsuite/web' web = NgetSuite::Web.new(servlet_request) web.handle_args web.update_queue class SearchInfo attr_reader :articles, :nfos def initialize(groups,want_release,filter,age_max) @articles = Array.new @nfos = Array.new groups.collect! { |x| NgetSuite::Group.getgroup(x)._groupindex} if (! groups.empty? ) if (want_release == "1") artq = "select r.*,a.`subject` from `releases` r " artq += "left join `articles` a on r.artindex=a.artindex " artq += "where 1 " artq += "and r.`groupindex` IN ('"+groups.join("', '")+"') " if (! groups.empty? ) artq += "and r.`time` > DATE_SUB(NOW(), INTERVAL #{age_max}) " if age_max artq += "and a.subject RLIKE '#{filter}' " if filter artq += "order by `completeness` desc, `nbactual` desc, r.`time` desc limit 100" @sth = NgetSuite::Db.dbh.execute artq else artq = "select * from `articles` where 1 " artq += "and `groupindex` IN ('"+groups.join("', '")+"') " if (! groups.empty? ) artq += "and `subject` RLIKE '#{filter}' " if filter artq += "and `time` > DATE_SUB(NOW(), INTERVAL #{age_max}) " if age_max artq += "order by `subject` limit 100" @sth = NgetSuite::Db.dbh.execute artq @sth.fetch_hash { |row| @articles.push row } end end def each return unless @sth @sth.fetch_hash { |row| row["graphmap"] = "<div class=\"rlsmap\">#{row["nbactual"]}/#{row["nbexpected"]} " if row["rlsmap"] and row["rlsmap"] != "" for i in 0..row["rlsmap"].size-1 if row["rlsmap"][i] == "#"[0] then row["graphmap"] += "<img src=\"green.png\" width=\"3\" height=\"5\">" else row["graphmap"] += "<img src=\"red.png\" width=\"3\" height=\"5\">" end end else for i in 1..row["nbactual"] row["graphmap"] += "<img src=\"cyan.png\" width=\"3\" height=\"5\">" end end row["graphmap"] += "</div>" yield row } end end %> <%= web.start_html("Release/Article search") %> <% if web.filter == nil %> <h3>Search releases/articles</h3> <div class="search_form"> <form method='post' name='search' target="left"> Filter <input class='regexp' type='text' name="filter" size='30' maxlength='50' /> <br /> <input type='radio' name='want_release' value="1" checked="checked" /> Search for releases <br /> <input type='radio' name='want_release' value="0" /> Search for articles <br /> <input type="text" name="aging" size="5" maxlength="5" /> <select name="aging_unit" /> <option value="w">weeks</option> <option value="d" selected="selected">days</option> <option value="h">hours</option> </select> old articles only <br /> Limit search to these groups : <select name="groups" multiple="multiple" size="8" /> <% NgetSuite::GroupList.new("order by `shortname`").each { |group| %> <%= '<option selected="selected">'+group._shortname+"</option>\n" %> <% } %> </select> <br /> <br /> <input type='submit' value='Search now!'> </form> </div> <% else rls = SearchInfo.new(web.groups, web.want_release, web.filter, web.age_max) if (web.want_release == "1") %> <h3>Search results</h3> <table class='articles'> <tr class='headers'> <th>Date/Size</th><th>Subject</th> </tr> <% rls.each { |rlss| %> <tr class="article"> <td class="time"><i><%= rlss["time"] %></i><br> <b><%= NgetSuite::Utils.pretty_size(rlss["size"]) %><b></td> <td class="subject"> <a class="rlslink" target="right" href="release.rhtml?groupindex=<%= rlss["groupindex"] %> &rlsartind=<%= rlss["artindex"].to_s %>"><%= rlss["subject"] %></a><br> <%= rlss["graphmap"] %> </tr> <% } %> </table> <% else %> <a name="top"></a> <h1>Files found</h1> <ul> <% if !rls.nfos.empty? %> <li><a href="#nfos"><%= rls.nfos.size %> viewable text file(s)</a></li> <% end %> <li><a href="#artlist">View articles list</a></li> </ul> <a name="artlist"></a> <div class="sectiontitle">Articles list</div> <table class="articles"> <tr class="headers"> <th>Date</th><th>Subject</th><th>Size</th> </tr> <% rls.articles.each { |art| %> <tr class="article"> <td class="time"><%= art["time"] %></td> <td class="subject"><%= art["subject"] %></td> <td class="size"><%= NgetSuite::Utils.pretty_size(art["size"]) %></td> </tr> <% } %> </table> <% end end #<%= web.end_html() %> <% NgetSuite::Db.dbh.disconnect %> Index: group.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/group.rhtml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** group.rhtml 16 Mar 2004 22:21:40 -0000 1.7 --- group.rhtml 27 Sep 2004 14:59:40 -0000 1.8 *************** *** 78,82 **** <% releases.each { |rls| %> <tr class="article"> ! <td class="time"><i><%= NgetSuite::Utils.pretty_date(rls["time"]).split(" ")[1] %></i><br> <b><%= NgetSuite::Utils.pretty_size(rls["size"]) %><b></td> <td class="subject"><a class="rlslink" target="right" href="release.rhtml?group=<%= web.group._fullname %>&rlsartind=<%= rls["artindex"].to_s %>"><%= rls["subject"] %></a><br> --- 78,82 ---- <% releases.each { |rls| %> <tr class="article"> ! <td class="time"><i><%= rls["time"] %></i><br> <b><%= NgetSuite::Utils.pretty_size(rls["size"]) %><b></td> <td class="subject"><a class="rlslink" target="right" href="release.rhtml?group=<%= web.group._fullname %>&rlsartind=<%= rls["artindex"].to_s %>"><%= rls["subject"] %></a><br> Index: top.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/top.rhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** top.rhtml 16 Mar 2004 22:21:43 -0000 1.3 --- top.rhtml 27 Sep 2004 14:59:41 -0000 1.4 *************** *** 58,61 **** --- 58,62 ---- <table> <tr> + <td class="grouptab"><a href="index.rhtml" target="_top">*</a></td> <% NgetSuite::GroupList.new("order by `shortname`").each { |group| %> <td class="<%= (servlet_request.query["group"] == group._fullname) ? "grouptabsel" : "grouptab" %>"><a href="index.rhtml?group=<%= group._fullname %>" target="_top"><%= group._shortname %></a></td> |
From: Kyoshiro <mib...@us...> - 2004-09-27 14:59:50
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23534 Modified Files: daemon.rb ngetsuite.rb sampleconfig specifs.txt Added Files: mime.types Log Message: sampleconfig: add httpd error and access log entries web/ top.rhtml: add (*) pseudo group to remove group filtering release.rhtml: remove non working pretty_date release.rhtml: add release view by filter queueview.rhtml: increase queue_add regex maxlength queueview.rhtml: add sort links to queue's columns headers queueview.rhtml: reorganize queue columns queueview.rhtml: replace regex input field with link to articles list (release view by filter) group.rhtml: remove non working pretty_date search.rhtml: add file, allow searching with web interface ngetsuite/ web.rb: add some form attributes recognition web.rb: add start_html, end_html, urlencode methods queue.rb: add shortgroup method, enhance output (more \n) nfo.rb: add getnfobyregex method nfo.rb: add search method downloader.rb: remove db locks ngetsuite.rb, specif.txt, core.rb: add --search-nfo-by-subject (-N) and --search-nfo (-F) options which work like -g and -G daemon.rb: add mime types handling to make webrick send text/html for .rhtml files daemon.rb: make webrick log access/errors into files instead of output mime.types: contains css and rhtml type definitions... Index: sampleconfig =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/sampleconfig,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** sampleconfig 6 Feb 2004 23:46:59 -0000 1.10 --- sampleconfig 27 Sep 2004 14:59:40 -0000 1.11 *************** *** 61,63 **** # should the daemon start the httpd httpd_autostart = true ! --- 61,64 ---- # should the daemon start the httpd httpd_autostart = true ! httpd_error_log = '/home/nget/weberrors.log' ! httpd_access_log = '/home/nget/webaccess.log' --- NEW FILE: mime.types --- text/html htm html shtml rhtml text/css css Index: ngetsuite.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite.rb,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ngetsuite.rb 3 Sep 2004 10:42:58 -0000 1.24 --- ngetsuite.rb 27 Sep 2004 14:59:40 -0000 1.25 *************** *** 25,28 **** --- 25,30 ---- [ '--search-releases', '-G', GetoptLong::REQUIRED_ARGUMENT, 'groupid,filter', 'Searches the releases matching a filter in a group' ], [ '--show-nfo', '-n', GetoptLong::REQUIRED_ARGUMENT, 'groupid,nfo_nb', 'Prints the specified nfo' ], + [ '--search-nfo', '-F', GetoptLong::REQUIRED_ARGUMENT, 'groupid,filter', 'Lists the NFOs containting filter' ], + [ '--search-nfo-by-subject', '-N', GetoptLong::REQUIRED_ARGUMENT, 'groupid,release_regex', 'Lists the NFOs associated to release matching regex' ], [ '--queue-article', '-q', GetoptLong::REQUIRED_ARGUMENT, 'groupid,articleid', 'Adds an article to the download queue'], [ '--queue-regexp', '-r', GetoptLong::REQUIRED_ARGUMENT, 'gid,regexp[,prio,period,dir]', 'Adds a regexp to the download queue' ], Index: specifs.txt =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/specifs.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** specifs.txt 23 Oct 2003 21:44:29 -0000 1.2 --- specifs.txt 27 Sep 2004 14:59:40 -0000 1.3 *************** *** 21,24 **** --- 21,34 ---- $ ngetsuite --show-nfo group nfo ... + $ ngetsuite --search-nfo-by-subject group filter + [1] NFO id: 156151320 + Article: subject + [2] NFO id: 156156100 + Article: subject + $ ngetsuite --search-nfo group filter + [1] NFO id: 156151320 + Article: subject + [2] NFO id: 156156100 + Article: subject $ ngetsuite --show-rls group [1] wam-ssx3 Index: daemon.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/daemon.rb,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** daemon.rb 15 Sep 2004 13:29:36 -0000 1.15 --- daemon.rb 27 Sep 2004 14:59:39 -0000 1.16 *************** *** 45,58 **** DRb.start_service(drburl, manager) if $config['httpd_autostart'] require 'webrick' ! port = $config['httpd_port'] puts "Starting web server on port #{port}" log 'Web server start' ! s = WEBrick::HTTPServer.new( ! :Port => port, ! :DocumentRoot => $wd + File::Separator + 'web' ! ) httpThread = Thread.new { Dir.chdir($wd) --- 45,81 ---- DRb.start_service(drburl, manager) + puts $wd if $config['httpd_autostart'] require 'webrick' ! if $config['httpd_port'] ! port = $config['httpd_port'] ! else ! port = 8000 ! end ! if $config['httpd_access_log'] ! puts "Logging web access into #{$config['httpd_access_log']}" ! access_log_stream = File.open($config['httpd_access_log'], 'w') ! else ! puts "Web access log disabled" ! access_log_stream = File.open("/dev/null", 'w') ! end ! access_log = [[ access_log_stream, WEBrick::AccessLog::COMBINED_LOG_FORMAT]] ! ! http_server_h = { ! :Port => port, ! :DocumentRoot => $wd + File::Separator + 'web', ! :MimeTypes => WEBrick::HTTPUtils::load_mime_types($wd + ! File::Separator + "mime.types"), ! :AccessLog => access_log ! } ! if $config['httpd_error_log'] ! http_server_h[:Logger] = WEBrick::Log::new($config['httpd_error_log']) ! end ! puts "Starting web server on port #{port}" log 'Web server start' ! s = WEBrick::HTTPServer.new(http_server_h) ! httpThread = Thread.new { Dir.chdir($wd) |
From: Yoann G. <jj...@us...> - 2004-09-27 13:04:23
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30103/ngetsuite Modified Files: core.rb downloader.rb downloadmanager.rb group.rb nfo.rb Log Message: misc fixes Index: nfo.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/nfo.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** nfo.rb 3 Sep 2004 10:42:59 -0000 1.8 --- nfo.rb 27 Sep 2004 13:04:05 -0000 1.9 *************** *** 18,21 **** --- 18,22 ---- raise NoSuchNfoException.new(n) end + return v end Index: downloadmanager.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloadmanager.rb,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** downloadmanager.rb 25 May 2004 22:41:59 -0000 1.25 --- downloadmanager.rb 27 Sep 2004 13:04:05 -0000 1.26 *************** *** 32,58 **** log 'Starting manager' @mainThread = Thread.new { ! begin ! loop do break unless @started log "current : #{@current_dlers}, max : #{@max_dlers}" if @lastlog_current != @current_dlers or @lastlog_max != @max_dlers @lastlog_current, @lastlog_max = @current_dlers, @max_dlers ! if (@current_dlers < @max_dlers) ! start_new_downloader ! end break unless @started check_finished_dls break unless @started sleep(@poll_interval) end - rescue Exception => e - puts "Exception : #{e} => #{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 } --- 32,56 ---- log 'Starting manager' @mainThread = Thread.new { ! loop do ! begin break unless @started log "current : #{@current_dlers}, max : #{@max_dlers}" if @lastlog_current != @current_dlers or @lastlog_max != @max_dlers @lastlog_current, @lastlog_max = @current_dlers, @max_dlers ! start_new_downloader if (@current_dlers < @max_dlers) break unless @started check_finished_dls break unless @started sleep(@poll_interval) + rescue DBI::DatabaseError => e + puts 'An error occurred' + puts 'Error code: ' + e.err + puts 'Error message: ' + e.errstr + puts 'Waiting 10mn' + sleep 600 + rescue Exception => e + puts "Exception : #{e}" + puts e.backtrace + break end end } Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** downloader.rb 15 Sep 2004 13:29:37 -0000 1.38 --- downloader.rb 27 Sep 2004 13:04:05 -0000 1.39 *************** *** 52,62 **** part, size, speed, filenb = $2, $7, $9, $12 ldebug "#{green $5+'L'}(#{green $7+'B'}) at #{$9+'B/s'} [#{blue $2}/#{blue $3}] [#{yellow $11}/#{yellow $12}]", false ! @curfile.update(part, speed, filenb, size) when /^uu_msg\(\d+\):Loaded from (.*): '.*' \((.*)\): (.*) part (\d+)\s+begin\s+(?:end\s+)?(yEnc|UUdata|Base64|XXdata|BinHex|plaintext|qptext|unknown)$/ artfile, base, filename, nb, enc = $1, $2, $3, $4, $5 ldebug "#{blue 'Decoding'} #{filename} (encoding : #{enc})", false ! @curfile._filename = filename ! @curfile.encoding = enc when /^uu_msg\(\d+\):Loaded from (.*): '.*' \(.*\):.*part (\d+)\s+end\s+(yEnc|UUdata|Base64|XXdata|BinHex|plaintext|qptext|unknown)$/ --- 52,62 ---- part, size, speed, filenb = $2, $7, $9, $12 ldebug "#{green $5+'L'}(#{green $7+'B'}) at #{$9+'B/s'} [#{blue $2}/#{blue $3}] [#{yellow $11}/#{yellow $12}]", false ! @curfile.update(part, speed, filenb, size) if @curfile when /^uu_msg\(\d+\):Loaded from (.*): '.*' \((.*)\): (.*) part (\d+)\s+begin\s+(?:end\s+)?(yEnc|UUdata|Base64|XXdata|BinHex|plaintext|qptext|unknown)$/ artfile, base, filename, nb, enc = $1, $2, $3, $4, $5 ldebug "#{blue 'Decoding'} #{filename} (encoding : #{enc})", false ! @curfile._filename = filename if @curfile ! @curfile.encoding = enc if @curfile when /^uu_msg\(\d+\):Loaded from (.*): '.*' \(.*\):.*part (\d+)\s+end\s+(yEnc|UUdata|Base64|XXdata|BinHex|plaintext|qptext|unknown)$/ *************** *** 68,72 **** when /^uu_msg\(\d+\):Loaded from (.*): '.*' \((.*)\): ?(.*) ?part (\d+)\s+(yEnc|UUdata|Base64|XXdata|BinHex|plaintext|qptext|unknown|Text)$/ artfile, base, filename, nb, enc = $1, $2, $3, $4, $5 ! if (@curfile._filename == 'unknown') @curfile._filename = filename end --- 68,72 ---- when /^uu_msg\(\d+\):Loaded from (.*): '.*' \((.*)\): ?(.*) ?part (\d+)\s+(yEnc|UUdata|Base64|XXdata|BinHex|plaintext|qptext|unknown|Text)$/ artfile, base, filename, nb, enc = $1, $2, $3, $4, $5 ! if (@curfile and @curfile._filename == 'unknown') @curfile._filename = filename end *************** *** 78,98 **** ldebug "#{blue 'Retrieving'} #{subject}" artindex = Db.dbh.select_one("select `artindex` from `articles` where `mid`='#{mid}'") ! unless artindex ! ldebug "#{red 'BUG'}: No such article in db.articles: #{mid}" ! artindex = [nil] ! end ! artindex = artindex[0] ! @nbfiles += 1 ! Db.dbh.do "update `queue` set `nbfiles`='#{@nbfiles}' where `queueindex`='#{@queueindex}'" ! ! ldebug "#{red 'BUG'}: Old queue_file present while creating new" if @curfile ! @curfile.finish_err if @curfile ! @curfile = QueueFile.new(@queueindex, artindex, false, parts, nblines, @nbfiles) ! if not QueueFile.already_in_db(@queueindex, artindex) ! @curfile.insert_to_db else ! ldebug 'Queue_file already in db', false ! @curfile.update_from_db end --- 78,100 ---- ldebug "#{blue 'Retrieving'} #{subject}" artindex = Db.dbh.select_one("select `artindex` from `articles` where `mid`='#{mid}'") ! if artindex ! artindex = artindex[0] ! @nbfiles += 1 ! Db.dbh.do "update `queue` set `nbfiles`='#{@nbfiles}' where `queueindex`='#{@queueindex}'" ! ! if @curfile ! ldebug "#{red 'BUG'}: Old queue_file present while creating new" ! @curfile.finish_err ! end ! @curfile = QueueFile.new(@queueindex, artindex, false, parts, nblines, @nbfiles) ! if not QueueFile.already_in_db(@queueindex, artindex) ! @curfile.insert_to_db ! else ! ldebug 'Queue_file already in db', false ! @curfile.update_from_db ! end else ! ldebug "#{red 'article not in db.articles'}" end *************** *** 105,122 **** when /^decoded ok/ ! ldebug "#{green 'Decoded'} #{@curfile._filename}" ! @curfile.finish_success @finish_status = 'FINISHED' ! log "Download finished for file #{@curfile._filename}, queue #{@value}" ! @curfile.sync_to_db @curfile = nil when 'download error occured, keeping temp files.' ldebug "#{yellow 'Error'} while downloading" ! @curfile.finish_err @finish_status = 'FAILED' # we do not know the file name ! # log "Download failed for #{@curfile._filename}, queue #{@value}" ! @curfile.sync_to_db @curfile = nil --- 107,124 ---- when /^decoded ok/ ! ldebug "#{green 'Decoded'} #{@curfile._filename if @curfile}" ! @curfile.finish_success if @curfile @finish_status = 'FINISHED' ! log "Download finished for file #{@curfile._filename if @curfile}, queue #{@value}" ! @curfile.sync_to_db if @curfile @curfile = nil when 'download error occured, keeping temp files.' ldebug "#{yellow 'Error'} while downloading" ! @curfile.finish_err if @curfile @finish_status = 'FAILED' # we do not know the file name ! # log "Download failed for #{@curfile._filename if @curfile}, queue #{@value}" ! @curfile.sync_to_db if @curfile @curfile = nil *************** *** 127,135 **** when / decoding errors occured, keeping temp files\.$/ ! ldebug "#{yellow 'Error'} while decoding #{@curfile._filename}" ! @curfile.finish_err_dec @finish_status = 'FAILED' ! log "Download finished, decoding failed for #{@curfile._filename}, queue #{@value}" ! @curfile.sync_to_db @curfile = nil --- 129,137 ---- when / decoding errors occured, keeping temp files\.$/ ! ldebug "#{yellow 'Error'} while decoding #{@curfile._filename if @curfile}" ! @curfile.finish_err_dec if @curfile @finish_status = 'FAILED' ! log "Download finished, decoding failed for #{@curfile._filename if @curfile}, queue #{@value}" ! @curfile.sync_to_db if @curfile @curfile = nil *************** *** 191,204 **** begin io.each { |line| ! update_status line } rescue IOError puts 'nget got killed!' parent.stop - rescue DBI::DatabaseError => e - puts 'A DB error occurred' - puts 'Error code: ' + e.err - puts 'Error message: ' + e.errstr - parent.stop rescue Object => e puts 'Exception while parsing nget output: '+e.class.to_s, e.backtrace --- 193,206 ---- begin io.each { |line| ! begin ! update_status line ! rescue DBI::DatabaseError => e ! puts 'A DB error occurred', "Error code: #{e.err}, message: #{e.errstr}", 'sleeping 5mn' ! sleep 300 ! end } rescue IOError puts 'nget got killed!' parent.stop rescue Object => e puts 'Exception while parsing nget output: '+e.class.to_s, e.backtrace Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** group.rb 3 Sep 2004 10:42:59 -0000 1.50 --- group.rb 27 Sep 2004 13:04:05 -0000 1.51 *************** *** 279,287 **** # make the nfo the release reference ! sth = Db.dbh.execute('select articles.rlsartindex,articles.groupindex,nfos.artindex from nfos left join articles using (artindex,groupindex) where articles.artindex != articles.rlsartindex and articles.groupindex=?', @_groupindex) rls, gid, nrls = nil sth.fetch do |row| rls, gid, nrls = *row Db.dbh.do("update articles set rlsartindex='#{nrls}' where rlsartindex='#{rls}' and groupindex='#{gid}'") end sth.finish --- 279,292 ---- # make the nfo the release reference ! sth = Db.dbh.execute( ! 'select articles.rlsartindex,articles.groupindex,nfos.artindex '+ ! 'from nfos left join articles using (artindex,groupindex) '+ ! 'where articles.artindex != articles.rlsartindex and articles.groupindex=?', ! @_groupindex) rls, gid, nrls = nil sth.fetch do |row| rls, gid, nrls = *row Db.dbh.do("update articles set rlsartindex='#{nrls}' where rlsartindex='#{rls}' and groupindex='#{gid}'") + Db.dbh.do("update releases set artindex='#{nrls}' where artindex='#{rls}' and groupindex='#{gid}'") end sth.finish Index: core.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/core.rb,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** core.rb 3 Sep 2004 10:42:59 -0000 1.42 --- core.rb 27 Sep 2004 13:04:05 -0000 1.43 *************** *** 235,243 **** def set_limit(l) ! getmanager.max_dlers = l.to_i end def set_poll_interval(i) ! getmanager.poll_interval = i.to_i end --- 235,243 ---- def set_limit(l) ! get_manager.max_dlers = l.to_i end def set_poll_interval(i) ! get_manager.poll_interval = i.to_i end |
From: Yoann G. <jj...@us...> - 2004-09-15 13:29:46
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2971/ngetsuite Modified Files: downloader.rb Log Message: stupid fix Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** downloader.rb 9 Sep 2004 12:11:10 -0000 1.37 --- downloader.rb 15 Sep 2004 13:29:37 -0000 1.38 *************** *** 146,154 **** when 'ignored error (nntp_getline: connection closed unexpectedly)' ! ldebug "#{red 'Lost connection'}. Reconnecting..." when /close\(fast\)$/ when /^error, will try .* again \(server says byebye: (.*)\)/ ! ldebug red("Disconnected (#{$1})") + '. Reconnecting...' when /^nntp_doarticle: try again./ when /^make_connection/ --- 146,154 ---- when 'ignored error (nntp_getline: connection closed unexpectedly)' ! ldebug "#{red 'Lost connection'}. Reconnecting...", false when /close\(fast\)$/ when /^error, will try .* again \(server says byebye: (.*)\)/ ! ldebug red("Disconnected (#{$1})") + '. Reconnecting...', false when /^nntp_doarticle: try again./ when /^make_connection/ |
From: Yoann G. <jj...@us...> - 2004-09-15 13:29:45
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2971 Modified Files: daemon.rb Log Message: stupid fix Index: daemon.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/daemon.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** daemon.rb 27 Feb 2004 13:12:06 -0000 1.14 --- daemon.rb 15 Sep 2004 13:29:36 -0000 1.15 *************** *** 5,8 **** --- 5,13 ---- Dir.chdir($wd) + module NgetSuite + class NgetsuiteException < Exception + end + end + require 'drb' require 'ngetsuite/utils' |
From: Yoann G. <jj...@us...> - 2004-09-09 12:11:20
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30765 Modified Files: downloader.rb queue.rb utils.rb Log Message: sexier console-mode queue status Index: queue.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/queue.rb,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** queue.rb 3 Sep 2004 10:42:59 -0000 1.28 --- queue.rb 9 Sep 2004 12:11:10 -0000 1.29 *************** *** 124,140 **** def group ! Group.getname(@_groupindex) end def to_s s = "#{yellow '<'}#{blue @_queueindex}#{yellow '>'} [#{red group}] #{yellow @_value}, prio : #{@_priority}, dest : #{green @_subdir}, status : #{@_status}" case @_status when PENDING ! s += ", added #{@_date_added.strftime('%d/%m %H:%M:%S')}" when PROCESSING ! s += ", started #{@_date_started.strftime('%d/%m %H:%M:%S')}" else s += ", #{@_status.downcase}" ! s += " since #{@_date_finished.strftime('%d/%m %H:%M:%S')}" if @_date_finished end if @_period != 0 --- 124,155 ---- def group ! Group.getgroup(@_groupindex)._shortname end def to_s s = "#{yellow '<'}#{blue @_queueindex}#{yellow '>'} [#{red group}] #{yellow @_value}, prio : #{@_priority}, dest : #{green @_subdir}, status : #{@_status}" + if (@_status == FAILED || @_status == PROCESSING) + a = Db.dbh.select_all("select `status` from `queue_files` where `queueindex`='#{@_queueindex}'") + s += ' ' + yellow('[') + a.map { |x| + case x[0] + when 'FINISHED' + green '#' + when 'PROCESSING' + white '#' + when 'ERROR_DECODING' + red '#' + else + '_' + end + }.join + yellow(']') + end case @_status when PENDING ! s += ", added #{pretty_date @_date_added}" when PROCESSING ! s += ", started #{pretty_date @_date_started}" else s += ", #{@_status.downcase}" ! s += " since #{pretty_date @_date_finished}" if @_date_finished end if @_period != 0 Index: utils.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/utils.rb,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** utils.rb 3 Sep 2004 09:12:03 -0000 1.17 --- utils.rb 9 Sep 2004 12:11:10 -0000 1.18 *************** *** 89,92 **** --- 89,93 ---- def Utils.pretty_date(date) + return date.strftime('%d/%m %H:%M') if (date.class == Time) date.to_s.sub(/^....-(..)-(..) (..):(..):../, '\2/\1 \3:\4') end Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** downloader.rb 3 Sep 2004 10:42:59 -0000 1.36 --- downloader.rb 9 Sep 2004 12:11:10 -0000 1.37 *************** *** 109,112 **** --- 109,113 ---- @finish_status = 'FINISHED' log "Download finished for file #{@curfile._filename}, queue #{@value}" + @curfile.sync_to_db @curfile = nil *************** *** 117,120 **** --- 118,122 ---- # we do not know the file name # log "Download failed for #{@curfile._filename}, queue #{@value}" + @curfile.sync_to_db @curfile = nil *************** *** 129,132 **** --- 131,135 ---- @finish_status = 'FAILED' log "Download finished, decoding failed for #{@curfile._filename}, queue #{@value}" + @curfile.sync_to_db @curfile = nil |
From: Yoann G. <jj...@us...> - 2004-09-03 10:43:10
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25191/ngetsuite Modified Files: core.rb db.rb downloader.rb group.rb nfo.rb queue.rb Log Message: code cleanup in core, more to come added -M option to change the value for the regex of a queue Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** downloader.rb 6 Jul 2004 10:41:21 -0000 1.35 --- downloader.rb 3 Sep 2004 10:42:59 -0000 1.36 *************** *** 199,203 **** parent.stop rescue Object => e ! puts 'Exception while parsing nget output: '+e.class.to_s + "\n" + e.backtrace.join("\n") parent.stop raise --- 199,203 ---- parent.stop rescue Object => e ! puts 'Exception while parsing nget output: '+e.class.to_s, e.backtrace parent.stop raise Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** group.rb 3 Sep 2004 09:12:03 -0000 1.49 --- group.rb 3 Sep 2004 10:42:59 -0000 1.50 *************** *** 6,10 **** module NgetSuite ! class NoSuchGroupException < Exception attr_reader :groupindex --- 6,10 ---- module NgetSuite ! class NoSuchGroupException < NgetsuiteException attr_reader :groupindex Index: core.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/core.rb,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** core.rb 19 Jun 2004 13:27:49 -0000 1.41 --- core.rb 3 Sep 2004 10:42:59 -0000 1.42 *************** *** 1,3 **** ! # todo: move requires in the blocks needing them (move exception handling as well) require 'ngetsuite/utils' require 'ngetsuite/queue' --- 1,4 ---- ! class NgetSuite::NgetsuiteException < Exception ! end require 'ngetsuite/utils' require 'ngetsuite/queue' *************** *** 10,14 **** module NgetSuite ! class ManagerNotFoundException < Exception attr_reader :address --- 11,15 ---- module NgetSuite ! class ManagerNotFoundException < NgetsuiteException attr_reader :address *************** *** 22,26 **** end ! class NoSuchArticleException < Exception attr_reader :number --- 23,27 ---- end ! class NoSuchArticleException < NgetsuiteException attr_reader :number *************** *** 35,39 **** ! class NoSuchNfoException < Exception attr_reader :number --- 36,40 ---- ! class NoSuchNfoException < NgetsuiteException attr_reader :number *************** *** 63,67 **** end ! def search_group(groupindex, filter) Group.getgroup(groupindex).search(filter) end --- 64,68 ---- end ! def search(groupindex, filter) Group.getgroup(groupindex).search(filter) end *************** *** 173,177 **** end ! def printusage print "Usage: #{$0} command [options]\n\n" puts 'List of options:' --- 174,191 ---- end ! def help(topic = nil) ! if (topic) ! item = $args.find{ |a| a[0] == '--'+topic if a } ! arg = "#{item[0]}, #{item[1]}" ! if item.length == 5 ! arg += " #{item[3]}" ! desc = item[4] ! else ! desc = item[3] ! end ! puts "#{arg}\t#{desc}" ! return ! end ! print "Usage: #{$0} command [options]\n\n" puts 'List of options:' *************** *** 192,309 **** end ! # TODO : faudrait généraliser le split des arguments des options a coup de yield ! # en fait on doit meme pouvoir appeler la fonction qui a le meme nom que ! # l'argument de ligne de commande (faudra filtrer pour éviter '--Dir.rmdir /':) def handle_opts $opts.each do |opt, arg| begin ! case opt ! when 'debug' ! $config['debug']=true ! when 'no-debug' ! $config['debug']=false ! when 'write-config' ! $config.save(arg) ! when 'test' ! test(arg) ! when 'show-groups' ! Group.show ! when 'add-group' ! args = arg.split(',') ! add_group(*args); ! when 'delete-group' ! delete_group(arg) ! when 'update-group' ! update_group(arg) ! when 'update-all-groups' ! update_group ! when 'set-group-category' ! args = arg.split(',') ! group_set_category(*args) ! when 'set-ignore-regexp' ! args = arg.split(',') ! group_set_ignore_regexp(*args) ! when 'list-nfos' ! list_nfos(arg) ! when 'list-releases' ! list_releases(arg) ! when 'show-nfo' ! args = arg.split(',') ! show_nfo(*args) ! when 'queue-article' ! args = arg.split(',') ! queue_article(*args) ! when 'queue-regexp' ! args = arg.split(',') ! queue_regexp(*args) ! when 'delete-queue' ! arg.split(',').each{ |q| Queue.delete(q, true) } ! when 'show-queue' ! args = arg.split(',') ! Queue.show(*args) ! when 'start-manager' ! start_manager ! when 'show-status' ! show_status ! when 'search' ! args = arg.split(',') ! search_group(*args) ! when 'search-releases' ! args = arg.split(',') ! search_releases(*args) ! when 'set-period' ! args = arg.split(',') ! set_period(*args) ! when 'set-priority' ! args = arg.split(',') ! set_priority(*args) ! when 'set-status' ! args = arg.split(',') ! set_status(*args) ! when 'set-limit' ! begin ! n = Integer(arg) ! rescue ArgumentError ! raise ArgumentError.new("Incorrect args : #{arg}") ! end ! get_manager.max_dlers = n ! when 'set-poll-interval' ! begin ! n = Integer(arg) ! rescue ArgumentError ! raise ArgumentError.new("Incorrect args : #{arg}") ! end ! get_manager.poll_interval = n ! when 'stop-download' ! q = Queue.getqueue(arg) ! # Simple check on the status of the queue ! if q._status == 'PROCESSING' ! get_manager.stop_downloader(arg) ! else ! puts "No current download for this queue" ! end ! when 'show-next-queueitem' ! q = Queue.nextqueue ! if q != nil ! puts q ! else ! puts "Nothing available to download" ! end ! when 'help' ! printusage ! end # end of case ! rescue NoSuchQueueException => e ! puts e.message ! rescue NoSuchGroupException => e ! puts e.message ! rescue NoSuchNfoException => e ! puts e.message ! rescue Exception => e puts e.message - print e.backtrace.join("\n") rescue ArgumentError => e puts e.message ! print e.backtrace.join("\n") ! printusage rescue DBI::DatabaseError => e puts "An error occurred" --- 206,286 ---- end ! def debug ! $config['debug'] = true ! end ! ! def no_debug ! $config['debug'] = false ! end ! ! def write_config(fname) ! $config.save(fname) ! end ! ! def show_groups ! Group.show ! end ! ! def update_all_groups ! update_group ! end ! ! def delete_queue(*list) ! list.each { |q| Queue.delete(q, true) } ! end ! ! def show_queue(*args) ! Queue.show(*args) ! end ! ! def set_limit(l) ! getmanager.max_dlers = l.to_i ! end ! ! def set_poll_interval(i) ! getmanager.poll_interval = i.to_i ! end ! ! def stop_download(q) ! q = Queue.getqueue(q) ! # Simple check on the status of the queue ! if q._status == 'PROCESSING' ! get_manager.stop_downloader(arg) ! else ! puts "No current download for this queue" ! end ! end ! ! def show_next_queueitem ! q = Queue.nextqueue ! if q != nil ! puts q ! else ! puts "Nothing available to download" ! end ! end ! ! def set_regex(q, r) ! q = Queue.getqueue(q) ! q._value = r ! q.sync_to_db ! end ! ! # Go! def handle_opts $opts.each do |opt, arg| begin ! # Call the method which name is opt.s/-/_/g, ! # with arg.split(',') as args ! args = nil ! args = arg.split(',') if arg ! fn = opt.gsub('-', '_') ! send(fn, *args) if self.respond_to? fn ! ! rescue NgetsuiteException => e puts e.message rescue ArgumentError => e puts e.message ! help(opt) rescue DBI::DatabaseError => e puts "An error occurred" *************** *** 313,319 **** puts "Problem connecting to the manager" puts e ! ensure ! # Nothing ! end #end of begin .. rescue .. ensure end # end $opts.each do end #end handle_opts --- 290,299 ---- puts "Problem connecting to the manager" puts e ! rescue Object => e ! puts "An unknown error Occured !" ! puts e.class.ancestors ! puts "#{e}" ! raise ! end end # end $opts.each do end #end handle_opts Index: nfo.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/nfo.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nfo.rb 19 Jun 2004 13:27:49 -0000 1.7 --- nfo.rb 3 Sep 2004 10:42:59 -0000 1.8 *************** *** 13,17 **** groupindex = Group.getindex(groupid) if (n > 1000) ! return Nfo.new(n, groupindex, true) end --- 13,21 ---- groupindex = Group.getindex(groupid) if (n > 1000) ! begin ! v = Nfo.new(n, groupindex, true) ! rescue NoSuchTupleException ! raise NoSuchNfoException.new(n) ! end end Index: queue.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/queue.rb,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** queue.rb 19 Jun 2004 13:27:49 -0000 1.27 --- queue.rb 3 Sep 2004 10:42:59 -0000 1.28 *************** *** 14,18 **** REGEXP = 'REGEXP' ! class NoSuchQueueException < Exception attr_reader :queueid --- 14,18 ---- REGEXP = 'REGEXP' ! class NoSuchQueueException < NgetsuiteException attr_reader :queueid *************** *** 26,30 **** end ! class UnknownQueueTypeException < Exception attr_reader :type --- 26,30 ---- end ! class UnknownQueueTypeException < NgetsuiteException attr_reader :type Index: db.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/db.rb,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** db.rb 20 Feb 2004 16:44:39 -0000 1.24 --- db.rb 3 Sep 2004 10:42:59 -0000 1.25 *************** *** 5,9 **** ## Exceptions ! class TableNotFoundException < Exception def initialize(klass) @klass = klass --- 5,9 ---- ## Exceptions ! class TableNotFoundException < NgetsuiteException def initialize(klass) @klass = klass *************** *** 15,19 **** end ! class MissingValue < Exception def initialize(c, missing_value) --- 15,19 ---- end ! class MissingValue < NgetsuiteException def initialize(c, missing_value) *************** *** 27,31 **** end ! class NotImplemented < Exception end --- 27,41 ---- end ! class NoSuchTupleException < NgetsuiteException ! def initialize(m) ! @m = m ! end ! ! def message ! "No such data in database: #{@m}" ! end ! end ! ! class NotImplemented < NgetsuiteException end *************** *** 223,234 **** # debug 'DB: '+ req 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 ! } sth.finish end --- 233,247 ---- # debug 'DB: '+ req sth = Db.dbh.execute req ! if (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 ! } ! else ! raise NoSuchTupleException.new(req) ! end sth.finish end |
From: Yoann G. <jj...@us...> - 2004-09-03 10:43:10
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25191 Modified Files: ngetsuite.rb Log Message: code cleanup in core, more to come added -M option to change the value for the regex of a queue Index: ngetsuite.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite.rb,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ngetsuite.rb 19 Jun 2004 13:27:48 -0000 1.23 --- ngetsuite.rb 3 Sep 2004 10:42:58 -0000 1.24 *************** *** 9,13 **** [ '--debug', '-d', GetoptLong::NO_ARGUMENT, 'Enable debug mode'], [ '--no-debug', '-D', GetoptLong::NO_ARGUMENT, 'Disable debug mode'], ! [ '--help', '-h', GetoptLong::NO_ARGUMENT, 'Shows this message'], [ '--config-file', '-c', GetoptLong::REQUIRED_ARGUMENT, 'file', 'Use another config file (def: $HOME/.ngetsuite)' ], ['--write-config', '-C', GetoptLong::REQUIRED_ARGUMENT, 'file', 'Write a defaut config file'], --- 9,13 ---- [ '--debug', '-d', GetoptLong::NO_ARGUMENT, 'Enable debug mode'], [ '--no-debug', '-D', GetoptLong::NO_ARGUMENT, 'Disable debug mode'], ! [ '--help', '-h', GetoptLong::NO_ARGUMENT, 'Shows this'], [ '--config-file', '-c', GetoptLong::REQUIRED_ARGUMENT, 'file', 'Use another config file (def: $HOME/.ngetsuite)' ], ['--write-config', '-C', GetoptLong::REQUIRED_ARGUMENT, 'file', 'Write a defaut config file'], *************** *** 20,35 **** [ '--update-group', '-u', GetoptLong::REQUIRED_ARGUMENT, 'groupid', 'Update the header cache for the specified group'], [ '--update-all-groups', '-v', GetoptLong::NO_ARGUMENT, 'Update headers for all groups'], ! [ '--set-group-category', '-S', GetoptLong::REQUIRED_ARGUMENT, 'groupid,category', 'Set the category of the group'], [ '--list-nfos', '-l', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Lists already fetched nfos' ], [ '--list-releases', '-L', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Lists detected releases' ], ! [ '--search-releases', '-G', GetoptLong::REQUIRED_ARGUMENT, 'groupid,filter', 'Searches the releases matching a filter for a group' ], [ '--show-nfo', '-n', GetoptLong::REQUIRED_ARGUMENT, 'groupid,nfo_nb', 'Prints the specified nfo' ], [ '--queue-article', '-q', GetoptLong::REQUIRED_ARGUMENT, 'groupid,articleid', 'Adds an article to the download queue'], [ '--queue-regexp', '-r', GetoptLong::REQUIRED_ARGUMENT, 'gid,regexp[,prio,period,dir]', 'Adds a regexp to the download queue' ], ! [ '--set-ignore-regexp', '-I', GetoptLong::REQUIRED_ARGUMENT, 'gid[,regexp]', 'Sets the regexp that nget will use as ignore-regexp (none for remove)' ], [ '--show-queue', '-t', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Shows the current download queue'], [ '--start-manager', '-m', GetoptLong::NO_ARGUMENT, 'Launches the download manager'], [ '--show-status', '-z', GetoptLong::NO_ARGUMENT, 'Prints the manager status'], ! [ '--search', '-g', GetoptLong::REQUIRED_ARGUMENT, 'groupid,filter', 'Searches the headers matching a filter for a group' ], [ '--set-priority', '-f', GetoptLong::REQUIRED_ARGUMENT, 'queueid,prio', 'Changes the priority of the specified queue' ], [ '--set-period', '-p', GetoptLong::REQUIRED_ARGUMENT, 'queueid,period', 'Changes the period of the specified queue' ], --- 20,35 ---- [ '--update-group', '-u', GetoptLong::REQUIRED_ARGUMENT, 'groupid', 'Update the header cache for the specified group'], [ '--update-all-groups', '-v', GetoptLong::NO_ARGUMENT, 'Update headers for all groups'], ! [ '--group-set-category', '-S', GetoptLong::REQUIRED_ARGUMENT, 'groupid,category', 'Set the category of the group'], [ '--list-nfos', '-l', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Lists already fetched nfos' ], [ '--list-releases', '-L', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Lists detected releases' ], ! [ '--search-releases', '-G', GetoptLong::REQUIRED_ARGUMENT, 'groupid,filter', 'Searches the releases matching a filter in a group' ], [ '--show-nfo', '-n', GetoptLong::REQUIRED_ARGUMENT, 'groupid,nfo_nb', 'Prints the specified nfo' ], [ '--queue-article', '-q', GetoptLong::REQUIRED_ARGUMENT, 'groupid,articleid', 'Adds an article to the download queue'], [ '--queue-regexp', '-r', GetoptLong::REQUIRED_ARGUMENT, 'gid,regexp[,prio,period,dir]', 'Adds a regexp to the download queue' ], ! [ '--group-set-ignore-regexp', '-I', GetoptLong::REQUIRED_ARGUMENT, 'gid[,regexp]', 'Sets the regexp that nget will use as ignore-regexp (none to remove)' ], [ '--show-queue', '-t', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Shows the current download queue'], [ '--start-manager', '-m', GetoptLong::NO_ARGUMENT, 'Launches the download manager'], [ '--show-status', '-z', GetoptLong::NO_ARGUMENT, 'Prints the manager status'], ! [ '--search', '-g', GetoptLong::REQUIRED_ARGUMENT, 'groupid,filter', 'Searches the headers matching a filter in a group' ], [ '--set-priority', '-f', GetoptLong::REQUIRED_ARGUMENT, 'queueid,prio', 'Changes the priority of the specified queue' ], [ '--set-period', '-p', GetoptLong::REQUIRED_ARGUMENT, 'queueid,period', 'Changes the period of the specified queue' ], *************** *** 39,43 **** [ '--set-poll-interval', '-o', GetoptLong::REQUIRED_ARGUMENT, 'intervall', 'Sets the polling intervall of the download manager'], [ '--show-next-queueitem', '-b', GetoptLong::NO_ARGUMENT, 'Shows the next available queue for the manager'], ! [ '--stop-download', '-k', GetoptLong::REQUIRED_ARGUMENT, 'queueid', 'Stop the download of the specified queue'] ] --- 39,44 ---- [ '--set-poll-interval', '-o', GetoptLong::REQUIRED_ARGUMENT, 'intervall', 'Sets the polling intervall of the download manager'], [ '--show-next-queueitem', '-b', GetoptLong::NO_ARGUMENT, 'Shows the next available queue for the manager'], ! [ '--stop-download', '-k', GetoptLong::REQUIRED_ARGUMENT, 'queueid', 'Stop the download of the specified queue'], ! [ '--set-regex', '-M', GetoptLong::REQUIRED_ARGUMENT, 'queueid,newval', 'Change the regex for this queue' ] ] |
From: Yoann G. <jj...@us...> - 2004-09-03 09:12:15
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13504/ngetsuite Modified Files: articles.rb group.rb utils.rb Log Message: better release listing (console) Index: utils.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/utils.rb,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** utils.rb 27 Feb 2004 13:12:07 -0000 1.16 --- utils.rb 3 Sep 2004 09:12:03 -0000 1.17 *************** *** 21,26 **** # print +message+ if debugging is enabled ! def debug(message=nil, linefeed=true) ! Utils.debug message, linefeed end --- 21,26 ---- # print +message+ if debugging is enabled ! def debug(*args) ! Utils.debug *args end *************** *** 48,53 **** color(msg,WHITE_FG,1) end ! def white msg ! Utils.white msg end --- 48,53 ---- color(msg,WHITE_FG,1) end ! def white *args ! Utils.white *args end *************** *** 55,60 **** color(msg,RED_FG,1) end ! def red msg ! Utils.red msg end --- 55,60 ---- color(msg,RED_FG,1) end ! def red *args ! Utils.red *args end *************** *** 62,67 **** color(msg,BLUE_FG,1) end ! def blue msg ! Utils.blue msg end --- 62,67 ---- color(msg,BLUE_FG,1) end ! def blue *args ! Utils.blue *args end *************** *** 69,74 **** color(msg,GREEN_FG,1) end ! def green msg ! Utils.green msg end --- 69,74 ---- color(msg,GREEN_FG,1) end ! def green *args ! Utils.green *args end *************** *** 76,86 **** color(msg,YELLOW_FG,1) end ! def yellow msg ! Utils.yellow msg end def format_date(date) if date.class == Time ! date.strftime('%Y-%m-%d %H-%M-%S') else date --- 76,86 ---- color(msg,YELLOW_FG,1) end ! def yellow *args ! Utils.yellow *args end def format_date(date) if date.class == Time ! date.strftime('%Y-%m-%d %H:%M:%S') else date *************** *** 89,104 **** def Utils.pretty_date(date) ! if date != nil ! day,time = date.to_s.split(' ').values_at(0,1) ! y,m,d = day.split('-').values_at(0,1,2) ! h,min,s = time.split(':').values_at(0,1,2) ! "#{d}/#{m} #{h}:#{min}" ! else ! "" ! end end ! def pretty_date(date) ! Utils.pretty_date(date) end --- 89,97 ---- def Utils.pretty_date(date) ! date.to_s.sub(/^....-(..)-(..) (..):(..):../, '\2/\1 \3:\4') end ! def pretty_date(*args) ! Utils.pretty_date(*args) end *************** *** 120,132 **** Utils.spreadbase(seconds.to_i, 60, 3, ['s', 'm', 'h']) end ! def cooltime(seconds) ! Utils.cooltime(seconds) end ! def Utils.pretty_size(size) ! Utils.spreadbase(size.to_i, 1024, 1, ['b', 'kb', 'Mb', 'Gb']) end ! def pretty_size(asize) ! Utils.pretty_size(asize) end end --- 113,125 ---- Utils.spreadbase(seconds.to_i, 60, 3, ['s', 'm', 'h']) end ! def cooltime(*args) ! Utils.cooltime(*args) end ! def Utils.pretty_size(size, prec=1) ! Utils.spreadbase(size.to_i, 1024, prec, ['b', 'kb', 'Mb', 'Gb']) end ! def pretty_size(*args) ! Utils.pretty_size(*args) end end Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** group.rb 25 Jun 2004 11:10:05 -0000 1.48 --- group.rb 3 Sep 2004 09:12:03 -0000 1.49 *************** *** 126,135 **** def search_releases(filter) ! sth = Db.dbh.execute('select articles.subject,releases.rlsmap,releases.nbactual,releases.nbexpected,releases.time from releases,articles where articles.artindex = releases.artindex and articles.groupindex = ? and articles.subject RLIKE ? order by releases.time desc', @_groupindex, filter) i = 0 ! subj, rlsmap, nbact, nbtot, time = nil sth.fetch do |row| ! subj, rlsmap, nbact, nbtot, time = *row ! puts "#{time} #{yellow nbact}/#{yellow nbtot} [#{green rlsmap}] \"#{subj}\"" i += 1 end --- 126,135 ---- def search_releases(filter) ! sth = Db.dbh.execute('select articles.subject,releases.rlsmap,releases.nbactual,releases.nbexpected,releases.time,releases.size from releases,articles where articles.artindex = releases.artindex and articles.groupindex = ? and articles.subject RLIKE ? order by releases.time desc', @_groupindex, filter) i = 0 ! subj, rlsmap, nbact, nbtot, time, size = nil sth.fetch do |row| ! subj, rlsmap, nbact, nbtot, time, size = *row ! puts "#{blue pretty_date(time)} [#{yellow rlsmap}] (#{red nbact}/#{red nbtot}) \"#{subj}\" (#{green pretty_size(size, 2)})" i += 1 end *************** *** 139,145 **** def search(filter) ! sth = Db.dbh.execute("select `subject` from `articles` where `groupindex`='#{@_groupindex}' and `subject` RLIKE ? order by `time` desc", filter) sth.fetch do |row| ! puts row[0] end sth.finish --- 139,145 ---- def search(filter) ! sth = Db.dbh.execute("select `time`,`subject`,`size` from `articles` where `groupindex`='#{@_groupindex}' and `subject` RLIKE ? order by `time` desc", filter) sth.fetch do |row| ! puts "#{blue pretty_date(row[0])}#{white ':'} #{row[1]} (#{green pretty_size(row[2])})" end sth.finish Index: articles.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/articles.rb,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** articles.rb 25 Jun 2004 11:17:11 -0000 1.13 --- articles.rb 3 Sep 2004 09:12:03 -0000 1.14 *************** *** 29,33 **** def to_s ! @_subject # TODO one day... end end --- 29,33 ---- def to_s ! "#{Utils.blue _time}#{Utils.white ':'} #{@_subject}" # TODO one day... end end *************** *** 48,52 **** elsif subject =~ /[^\d](\d{1,3})\/(\d{1,3})[^\d]/ return $1.to_i, $2.to_i, $2.length ! elsif subject =~ /(\d{1,3}) *of? *(\d{1,3})/ return $1.to_i, $2.to_i, $2.length elsif subject =~ /(\d{1,3}) *sur *(\d{1,3})/ --- 48,52 ---- elsif subject =~ /[^\d](\d{1,3})\/(\d{1,3})[^\d]/ return $1.to_i, $2.to_i, $2.length ! elsif subject =~ /(\d{1,3}) *of *(\d{1,3})/ return $1.to_i, $2.to_i, $2.length elsif subject =~ /(\d{1,3}) *sur *(\d{1,3})/ |
From: Johnjohn <jj...@us...> - 2004-07-07 18:19:34
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25865 Modified Files: HOWTO Log Message: list the dependencies, include the nget setup and a sample nget config file Index: HOWTO =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/HOWTO,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** HOWTO 21 May 2004 08:40:05 -0000 1.6 --- HOWTO 7 Jul 2004 18:19:24 -0000 1.7 *************** *** 1,4 **** --- 1,30 ---- How to use ngetsuite : + Before installation, here are the requirement (for debian unstable, you should + find your way with the package names for your own distribution): + + * Please note that ruby versions older than 1.8 are untested + + apt-get install mysql-server yydecode nget ruby libdbd-mysql-ruby libdrb-ruby libzlib-ruby libwebrick-ruby + + You should also set up nget correctly (read the man to create a correct ~/.nget5/.ngetrc). You can check this by running by hand 'nget -g alt.binaries.pictures.linux' or any other newsgroup fed by your server. + + A sample .ngetrc file : + ---- snip here ---- + case=0 + complete=0 + autopar=0 + text=ignore + {halias + {myserver + addr=my.news.server.hostname + user=myusername + pass=secretpassw0rd + id=1 + linelenience=-2,2 + } + } + ---- snip here ---- + 0) Before the first run ----------------------- *************** *** 10,15 **** the most important is the login/pass for the database. ! Then set up the database ! log in mysql as root, add the database and the above user with drop, create, insert, delete, update privileges. ./resetdb.rb should set up the tables correctly inside the database --- 36,41 ---- the most important is the login/pass for the database. ! Then set up the database: ! log in mysql as root, add the database and the above user with select, insert, delete, update, create, drop privileges. ./resetdb.rb should set up the tables correctly inside the database |
From: Johnjohn <jj...@us...> - 2004-07-06 10:41:30
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5710/ngetsuite Modified Files: config.rb downloader.rb ngetcache.rb Log Message: new version of the nget cache copy your ~/.nget4/.ngetrc to ~/.nget5, remove ~/.nget4 and update all (don't forget to change your config if you need to) Index: ngetcache.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/ngetcache.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ngetcache.rb 19 Jun 2004 13:27:49 -0000 1.11 --- ngetcache.rb 6 Jul 2004 10:41:21 -0000 1.12 *************** *** 87,91 **** raise BadNgetCache.new('invalid file format') unless @line =~ /^([^\t]*)\t(\d+) ([^\t]*)$/ ! raise BadNgetCache.new('invalid file format or version number') unless $1 == 'NGET4' and $3 == '1' @partscounttotal = $2.to_i @partscountcurrent = 0 --- 87,91 ---- raise BadNgetCache.new('invalid file format') unless @line =~ /^([^\t]*)\t(\d+) ([^\t]*)$/ ! raise BadNgetCache.new('invalid file format or version number') unless ($1 == 'NGET4' or $1 == 'NGET5') and $3 == '1' @partscounttotal = $2.to_i @partscountcurrent = 0 *************** *** 120,124 **** @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) --- 120,124 ---- @lineno += 1 ! raise BadNgetCache.new('invalid file description') unless @line =~ /^(-?\d+)\t(\d+)(?:\t(\d+))?\t([^\t]*)\t([^\t]*)\t(-?\d+)\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) Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** downloader.rb 25 Jun 2004 11:10:04 -0000 1.34 --- downloader.rb 6 Jul 2004 10:41:21 -0000 1.35 *************** *** 184,188 **** downloadexpr = "-r '#{@value}'" end ! @io = IO.popen("#{"nice -n#{$config['nice_nget_download']} -- " if $config['nice_nget_download'] != 0} #{$config['nget']} -q -I -G #{@group} #{downloadexpr} 2>&1") @t = Thread.new(@io, self){ |io, parent| begin --- 184,188 ---- downloadexpr = "-r '#{@value}'" end ! @io = IO.popen("#{"nice -n#{$config['nice_nget_download']} -- " if $config['nice_nget_download'] != 0} #{$config['nget']} -q -G #{@group} #{downloadexpr} 2>&1") @t = Thread.new(@io, self){ |io, parent| begin Index: config.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/config.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config.rb 23 Feb 2004 17:08:08 -0000 1.5 --- config.rb 6 Jul 2004 10:41:21 -0000 1.6 *************** *** 17,21 **** nget = '/home/nget/bin/nget' yydecode = '/usr/bin/yydecode' ! cachedir = ENV['HOME'] + File::Separator + '.nget4' basedir = ENV['HOME'] + File::Separator + 'ngot' tempdir = ENV['TMP'] or ENV['TEMP'] or '/tmp' --- 17,21 ---- nget = '/home/nget/bin/nget' yydecode = '/usr/bin/yydecode' ! cachedir = ENV['HOME'] + File::Separator + '.nget5' basedir = ENV['HOME'] + File::Separator + 'ngot' tempdir = ENV['TMP'] or ENV['TEMP'] or '/tmp' |
From: Johnjohn <jj...@us...> - 2004-06-25 11:17:20
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23180/ngetsuite Modified Files: articles.rb Log Message: forgot a debug statement around :) Index: articles.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/articles.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** articles.rb 25 Jun 2004 11:10:04 -0000 1.12 --- articles.rb 25 Jun 2004 11:17:11 -0000 1.13 *************** *** 217,221 **** req += ' order by releases.time asc' ! Utils.debug req sth = Db.dbh.execute req --- 217,221 ---- req += ' order by releases.time asc' ! # Utils.debug req sth = Db.dbh.execute req |
From: Johnjohn <jj...@us...> - 2004-06-25 11:10:14
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21335/ngetsuite Modified Files: articles.rb downloader.rb group.rb Log Message: minor upgrade, better nfo/release handling Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** downloader.rb 19 Jun 2004 13:27:49 -0000 1.33 --- downloader.rb 25 Jun 2004 11:10:04 -0000 1.34 *************** *** 93,97 **** @curfile.insert_to_db else ! ldebug 'Queue_file already in db' @curfile.update_from_db end --- 93,97 ---- @curfile.insert_to_db else ! ldebug 'Queue_file already in db', false @curfile.update_from_db end *************** *** 121,125 **** # same as below when /^couldn't get (<.*>) from anywhere$/ ! ldebug "#{yellow 'Error'}: couldn't get #{$1}" @finish_status = 'FAILED' --- 121,125 ---- # same as below when /^couldn't get (<.*>) from anywhere$/ ! ldebug "#{yellow 'Error'}: couldn't get #{$1}", false @finish_status = 'FAILED' *************** *** 133,136 **** --- 133,138 ---- when /^Connecting to (.*)$/ ldebug "Connection to #{$1}..", false + when /^fatal error.*\(bad reply 423/ + ldebug "Error 423", false when />> 200/ ldebug green('Connected'), false Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** group.rb 19 Jun 2004 13:27:49 -0000 1.47 --- group.rb 25 Jun 2004 11:10:05 -0000 1.48 *************** *** 277,280 **** --- 277,289 ---- `rm -rf #{tempdir}` end + + # make the nfo the release reference + sth = Db.dbh.execute('select articles.rlsartindex,articles.groupindex,nfos.artindex from nfos left join articles using (artindex,groupindex) where articles.artindex != articles.rlsartindex and articles.groupindex=?', @_groupindex) + rls, gid, nrls = nil + sth.fetch do |row| + rls, gid, nrls = *row + Db.dbh.do("update articles set rlsartindex='#{nrls}' where rlsartindex='#{rls}' and groupindex='#{gid}'") + end + sth.finish debug "#{nb_nfos} nfos indexed in #{Utils.cooltime(Time.now-t)}" Index: articles.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/articles.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** articles.rb 19 Jun 2004 13:27:49 -0000 1.11 --- articles.rb 25 Jun 2004 11:10:04 -0000 1.12 *************** *** 207,228 **** def Release.list(groupid = '') ! req = 'select articles.subject,releases.rlsmap,releases.nbactual,releases.nbexpected,releases.artindex,releases.groupindex ! from releases,articles where articles.artindex = releases.artindex and articles.groupindex = releases.groupindex' if (groupid != '') groupindex = Group.getindex(groupid) ! req += " and releases.groupindex='#{groupindex}'" end req += ' order by releases.time asc' sth = Db.dbh.execute req i = 0 ! subj, rlsmap, nbact, nbtot, rlsidx, grpidx, nfo_list = nil sth.fetch do |row| ! subj, rlsmap, nbact, nbtot, rlsidx, grpidx = *row ! nfo_list = Db.dbh.select_one("select nfos.artindex from nfos,articles where articles.groupindex='#{grpidx}' and nfos.groupindex='#{grpidx}' and nfos.artindex=articles.artindex and articles.rlsartindex='#{rlsidx}'") ! puts "[#{Utils.blue i}] #{Utils.yellow nbact}/#{Utils.yellow nbtot} [#{Utils.green rlsmap if rlsmap}] \"#{subj}\"#{' nfo n°'+Utils.red(nfo_list[0]) if nfo_list}" i += 1 end --- 207,229 ---- def Release.list(groupid = '') ! req = 'select articles.subject, releases.rlsmap, releases.nbactual,releases.nbexpected, releases.artindex, releases.groupindex, nfos.artindex '+ ! 'from releases left join articles using (groupindex,artindex) '+ ! 'left join nfos using (groupindex,artindex)' if (groupid != '') groupindex = Group.getindex(groupid) ! req += " where releases.groupindex='#{groupindex}'" end req += ' order by releases.time asc' + Utils.debug req sth = Db.dbh.execute req i = 0 ! subj, rlsmap, nbact, nbtot, rlsidx, grpidx, nfo = nil sth.fetch do |row| ! subj, rlsmap, nbact, nbtot, rlsidx, grpidx, nfo = *row ! puts "[#{Utils.blue i}] #{Utils.yellow nbact}/#{Utils.yellow nbtot} [#{Utils.green rlsmap if rlsmap}] \"#{subj}\"#{' nfo n°'+Utils.red(nfo) if nfo}" i += 1 end |
From: Johnjohn <jj...@us...> - 2004-06-19 13:27:59
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16030/ngetsuite Modified Files: articles.rb core.rb downloader.rb group.rb nfo.rb ngetcache.rb queue.rb Log Message: misc updates, better command-line handling of nfos/releases Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** downloader.rb 25 May 2004 22:41:59 -0000 1.32 --- downloader.rb 19 Jun 2004 13:27:49 -0000 1.33 *************** *** 151,155 **** when /^doarticle \d+: \d+!=\d+ \|\| \d+!=\d+$/ when /^unequal line count (\d+) should equal (\d+)$/ ! ldebug "unequal line count (#{$1} != #{$2})", false when />> \d\d\d/, /<< (GROUP|AUTHINFO)/ --- 151,155 ---- when /^doarticle \d+: \d+!=\d+ \|\| \d+!=\d+$/ when /^unequal line count (\d+) should equal (\d+)$/ ! # ldebug "unequal line count (#{$1} != #{$2})", false when />> \d\d\d/, /<< (GROUP|AUTHINFO)/ Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** group.rb 14 Jun 2004 05:31:28 -0000 1.46 --- group.rb 19 Jun 2004 13:27:49 -0000 1.47 *************** *** 167,180 **** debug "Beginning updatengetcache at #{t.strftime('%H:%M:%S')}" ! n = rand(900000)+100000 ! cmdline = "#{$config['nget']} -g #{@_fullname} -cr '^#{n}Dummy' 2>&1" cmdline = "nice -n#{$config['nice_nget_update']} -- #{cmdline}" if $config['nice_nget_update'] != 0 begin ! IO.popen(cmdline).each("\r") { |line| ! debug("progress#{yellow $1} speed#{blue $2} ETA #{$3}", false) if line =~ /Retrieving headers \d+-\d+ : \d+\/\d+\/\d+(\s+\d+%)(\s+\d+B\/s)(.*s)/ } ! rescue ! print "\nInterrupted" end --- 167,192 ---- debug "Beginning updatengetcache at #{t.strftime('%H:%M:%S')}" ! cmdline = "#{$config['nget']} -g #{@_fullname} 2>&1" cmdline = "nice -n#{$config['nice_nget_update']} -- #{cmdline}" if $config['nice_nget_update'] != 0 begin ! line = '' ! IO.popen(cmdline).each_byte { |char| ! char = char.chr ! if char != "\r" and char != "\n" ! line << char ! next ! end ! if line =~ /^Retrieving headers \d+-\d+ : \d+\/\d+\/\d+(\s+\d+%)\s+(\d+B\/s)(.*s)/ ! if $1 == ' 100%' ! debug("finished, saving cache..", false) ! else ! debug("#{$2} - #{$1} (#{$3} left)", false) ! end ! end ! line = '' } ! rescue Object=>e ! print "\nInterrupted: #{e.inspect}" end *************** *** 187,191 **** nb_rows = Db.dbh.do "delete from `articles` where `groupindex`='#{@_groupindex}'" ! debug "#{nb_rows} articles deleted" cache = NgetCache.new(@_fullname, $config['cachedir']) --- 199,203 ---- nb_rows = Db.dbh.do "delete from `articles` where `groupindex`='#{@_groupindex}'" ! debug "#{nb_rows} files deleted" cache = NgetCache.new(@_fullname, $config['cachedir']) *************** *** 217,221 **** @_cache_low,@_cache_high = cache.servers[0].low, cache.servers[0].high nb_rows = Db.dbh.select_one("select count(*) from `articles` where `groupindex`='#{@_groupindex}'")[0] ! debug "#{nb_rows} articles inserted in #{Utils.cooltime(Time.now-t)}" end --- 229,233 ---- @_cache_low,@_cache_high = cache.servers[0].low, cache.servers[0].high nb_rows = Db.dbh.select_one("select count(*) from `articles` where `groupindex`='#{@_groupindex}'")[0] ! debug "#{nb_rows} files inserted in #{Utils.cooltime(Time.now-t)}" end *************** *** 224,230 **** debug "Beginning fetchnfos at #{t.strftime('%H:%M:%S')}" - nb_rows = Db.dbh.do "delete from `nfos` where `groupindex`='#{@_groupindex}'" - debug "#{nb_rows} nfos deleted" - tempdir = $config['tempdir'] + File::Separator + "ngetupdate.#{@_shortname}.#{Process.pid}" if FileTest.exists? tempdir --- 236,239 ---- *************** *** 232,235 **** --- 241,247 ---- return end + nb_rows = Db.dbh.do "delete from `nfos` where `groupindex`='#{@_groupindex}'" + debug "#{nb_rows} nfos deleted" + Dir.mkdir tempdir pwd = Dir.pwd *************** *** 276,285 **** --- 288,308 ---- debug "#{nb_rows} releases deleted" + total = Db.dbh.select_one "select count(*) from `articles` where `groupindex`='#{@_groupindex}'" articles = ArticleList.new("where `groupindex`='#{@_groupindex}' order by `subject`") + + cur = 0 + threadaff = Thread.new { + loop do + sleep 0.4 + debug("#{cur}/#{total}", false) + end + } nb_releases = Release.mkreleases(true) articles.each { |art| + cur += 1 nb_releases += Release.mkreleases(art) } nb_releases += Release.mkreleases(false) + threadaff.kill debug "#{nb_releases} releases inserted in #{Utils.cooltime(Time.now-t)}" Index: core.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/core.rb,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** core.rb 14 Jun 2004 05:31:28 -0000 1.40 --- core.rb 19 Jun 2004 13:27:49 -0000 1.41 *************** *** 104,109 **** end ! def show_nfo(nb_nfo, groupid = '') ! puts Nfo.get(Integer(nb_nfo), groupid) end --- 104,109 ---- end ! def show_nfo(groupid, nb_nfo) ! puts Nfo.get(groupid, nb_nfo.to_i) end Index: nfo.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/nfo.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** nfo.rb 23 May 2004 07:28:48 -0000 1.6 --- nfo.rb 19 Jun 2004 13:27:49 -0000 1.7 *************** *** 10,22 **** Db.autotable(Nfo, 'nfos') ! def Nfo.get(n, groupid = '') ! req = 'select nfos.artindex,nfos.groupindex from nfos,articles where nfos.artindex=articles.artindex and nfos.groupindex=articles.groupindex' ! ! if (groupid != '') ! groupindex = Group.getindex(groupid) ! req += " and nfos.groupindex='#{groupindex}'" end ! ! req += " order by articles.time asc limit #{n},1" row = Db.dbh.select_one req --- 10,20 ---- Db.autotable(Nfo, 'nfos') ! def Nfo.get(groupid, n) ! groupindex = Group.getindex(groupid) ! if (n > 1000) ! return Nfo.new(n, groupindex, true) end ! ! req = "select nfos.artindex,nfos.groupindex from nfos,articles where nfos.artindex=articles.artindex and nfos.groupindex=articles.groupindex and nfos.groupindex='#{groupindex}' order by articles.time asc limit #{n},1" row = Db.dbh.select_one req Index: queue.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/queue.rb,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** queue.rb 30 Apr 2004 12:15:58 -0000 1.26 --- queue.rb 19 Jun 2004 13:27:49 -0000 1.27 *************** *** 87,91 **** fs= status ? "`status`='#{status}'" : nil # DEPLIAGE ! filter = ([fg, fs].compact.join(' and ').map{|f| 'where '+f}[0] or '') QueueList.new(filter).each { |queue| puts queue --- 87,91 ---- fs= status ? "`status`='#{status}'" : nil # DEPLIAGE ! filter = ([fg, fs].compact.join(' and ').map{|f| 'where '+f}[0] or '') + ' order by queueindex' QueueList.new(filter).each { |queue| puts queue Index: ngetcache.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/ngetcache.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ngetcache.rb 21 May 2004 08:42:20 -0000 1.10 --- ngetcache.rb 19 Jun 2004 13:27:49 -0000 1.11 *************** *** 143,148 **** return unless readline ! raise BadNgetCache.new('invalid part description') unless (@linesplit = @line.split("\t")).length == 3 ! part = CachePart.new(@linesplit[0], @linesplit[1], @linesplit[2], Array.new) # articles giving this part --- 143,149 ---- return unless readline ! raise BadNgetCache.new('invalid part description') unless @line =~ /^(-?\d+)\t(\d+)\t([^\t]*)$/ ! ! part = CachePart.new($1, $2, $3, Array.new) # articles giving this part Index: articles.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/articles.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** articles.rb 14 Jun 2004 05:31:28 -0000 1.10 --- articles.rb 19 Jun 2004 13:27:49 -0000 1.11 *************** *** 48,52 **** elsif subject =~ /[^\d](\d{1,3})\/(\d{1,3})[^\d]/ return $1.to_i, $2.to_i, $2.length ! elsif subject =~ /(\d{1,3}) *of *(\d{1,3})/ return $1.to_i, $2.to_i, $2.length elsif subject =~ /(\d{1,3}) *sur *(\d{1,3})/ --- 48,52 ---- elsif subject =~ /[^\d](\d{1,3})\/(\d{1,3})[^\d]/ return $1.to_i, $2.to_i, $2.length ! elsif subject =~ /(\d{1,3}) *of? *(\d{1,3})/ return $1.to_i, $2.to_i, $2.length elsif subject =~ /(\d{1,3}) *sur *(\d{1,3})/ *************** *** 207,211 **** def Release.list(groupid = '') ! req = 'select articles.subject,articles.groupindex,releases.rlsmap,releases.nbactual,releases.nbexpected from releases,articles where articles.artindex = releases.artindex and articles.groupindex = releases.groupindex' --- 207,211 ---- def Release.list(groupid = '') ! req = 'select articles.subject,releases.rlsmap,releases.nbactual,releases.nbexpected,releases.artindex,releases.groupindex from releases,articles where articles.artindex = releases.artindex and articles.groupindex = releases.groupindex' *************** *** 215,228 **** end ! req += ' order by articles.time asc' sth = Db.dbh.execute req i = 0 ! subj, grpidx, rlsmap, nbact, nbtot = nil ! #rls = nil sth.fetch do |row| ! subj, grpidx, rlsmap, nbact, nbtot = *row ! puts "[#{Utils.blue i}] #{Utils.yellow nbact}/#{Utils.yellow nbtot} [#{Utils.green rlsmap if rlsmap}] \"#{subj}\"" i += 1 end --- 215,228 ---- end ! req += ' order by releases.time asc' sth = Db.dbh.execute req i = 0 ! subj, rlsmap, nbact, nbtot, rlsidx, grpidx, nfo_list = nil sth.fetch do |row| ! subj, rlsmap, nbact, nbtot, rlsidx, grpidx = *row ! nfo_list = Db.dbh.select_one("select nfos.artindex from nfos,articles where articles.groupindex='#{grpidx}' and nfos.groupindex='#{grpidx}' and nfos.artindex=articles.artindex and articles.rlsartindex='#{rlsidx}'") ! puts "[#{Utils.blue i}] #{Utils.yellow nbact}/#{Utils.yellow nbtot} [#{Utils.green rlsmap if rlsmap}] \"#{subj}\"#{' nfo n°'+Utils.red(nfo_list[0]) if nfo_list}" i += 1 end |
From: Johnjohn <jj...@us...> - 2004-06-19 13:27:57
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16030 Modified Files: ngetsuite.rb Log Message: misc updates, better command-line handling of nfos/releases Index: ngetsuite.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite.rb,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ngetsuite.rb 17 Mar 2004 10:14:18 -0000 1.22 --- ngetsuite.rb 19 Jun 2004 13:27:48 -0000 1.23 *************** *** 24,28 **** [ '--list-releases', '-L', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Lists detected releases' ], [ '--search-releases', '-G', GetoptLong::REQUIRED_ARGUMENT, 'groupid,filter', 'Searches the releases matching a filter for a group' ], ! [ '--show-nfo', '-n', GetoptLong::REQUIRED_ARGUMENT, 'nb_nfo[,groupid]', 'Prints the specified nfo' ], [ '--queue-article', '-q', GetoptLong::REQUIRED_ARGUMENT, 'groupid,articleid', 'Adds an article to the download queue'], [ '--queue-regexp', '-r', GetoptLong::REQUIRED_ARGUMENT, 'gid,regexp[,prio,period,dir]', 'Adds a regexp to the download queue' ], --- 24,28 ---- [ '--list-releases', '-L', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Lists detected releases' ], [ '--search-releases', '-G', GetoptLong::REQUIRED_ARGUMENT, 'groupid,filter', 'Searches the releases matching a filter for a group' ], ! [ '--show-nfo', '-n', GetoptLong::REQUIRED_ARGUMENT, 'groupid,nfo_nb', 'Prints the specified nfo' ], [ '--queue-article', '-q', GetoptLong::REQUIRED_ARGUMENT, 'groupid,articleid', 'Adds an article to the download queue'], [ '--queue-regexp', '-r', GetoptLong::REQUIRED_ARGUMENT, 'gid,regexp[,prio,period,dir]', 'Adds a regexp to the download queue' ], |
From: Johnjohn <jj...@us...> - 2004-06-14 05:31:40
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27914/ngetsuite Modified Files: articles.rb core.rb group.rb Log Message: misc fix, added multiple queue deletion at once Index: articles.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/articles.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** articles.rb 23 May 2004 07:28:48 -0000 1.9 --- articles.rb 14 Jun 2004 05:31:28 -0000 1.10 *************** *** 141,145 **** # or file n° 1/xx as all others if rls = @@rls[cat] ! if (rls.poster==art._from) and (rls._nbexpected==total) and ((rls._rlsmap[cur-1].chr != '#') or (cur == 1 and rls._rlsmap =~ /^#_*$/)) #NgetSuite::Utils.debug "#{cat}: part #{cur} already there {#{art._subject}}" # another art for this release --- 141,145 ---- # or file n° 1/xx as all others if rls = @@rls[cat] ! if (rls.poster==art._from) and (rls._nbexpected==total) and (rls._rlsmap[cur-1] and ((rls._rlsmap[cur-1].chr != '#') or (cur == 1 and rls._rlsmap =~ /^#_*$/))) #NgetSuite::Utils.debug "#{cat}: part #{cur} already there {#{art._subject}}" # another art for this release Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** group.rb 23 May 2004 07:28:48 -0000 1.45 --- group.rb 14 Jun 2004 05:31:28 -0000 1.46 *************** *** 126,130 **** def search_releases(filter) ! sth = Db.dbh.execute('select articles.subject,releases.rlsmap,releases.nbactual,releases.nbexpected,releases.time from releases,articles where articles.artindex = releases.artindex and articles.groupindex = ? and articles.subject RLIKE ? order by articles.time desc', @_groupindex, filter) i = 0 subj, rlsmap, nbact, nbtot, time = nil --- 126,130 ---- def search_releases(filter) ! sth = Db.dbh.execute('select articles.subject,releases.rlsmap,releases.nbactual,releases.nbexpected,releases.time from releases,articles where articles.artindex = releases.artindex and articles.groupindex = ? and articles.subject RLIKE ? order by releases.time desc', @_groupindex, filter) i = 0 subj, rlsmap, nbact, nbtot, time = nil Index: core.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/core.rb,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** core.rb 21 May 2004 08:49:56 -0000 1.39 --- core.rb 14 Jun 2004 05:31:28 -0000 1.40 *************** *** 238,242 **** queue_regexp(*args) when 'delete-queue' ! Queue.delete(arg, true) when 'show-queue' args = arg.split(',') --- 238,242 ---- queue_regexp(*args) when 'delete-queue' ! arg.split(',').each{ |q| Queue.delete(q, true) } when 'show-queue' args = arg.split(',') |
From: Johnjohn <jj...@us...> - 2004-05-25 22:42:23
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12093 Modified Files: downloader.rb downloadmanager.rb Log Message: fix typo making the download manager ignoring the period Index: downloadmanager.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloadmanager.rb,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** downloadmanager.rb 25 Feb 2004 22:37:10 -0000 1.24 --- downloadmanager.rb 25 May 2004 22:41:59 -0000 1.25 *************** *** 63,67 **** row = Db.dbh.select_one("select * from `queue` where (`status`='FINISHED' and (`period`!='0') and ((NOW()-`date_finished`) > `period`)) order by `priority` desc limit 1") if not row and $config['resume_downloads'] row = Db.dbh.select_one("select * from `queue` where (`status`='STOPPED' and (`period`!='0') and ((NOW()-`date_finished`) > `period`)) order by `priority` desc limit 1") if not row and $config['resume_downloads'] ! row = Db.dbh.select_one("select * from `queue` where (`status`='FAILED' and (`period`!='0') and ((NOW()-`date_finished`) > 'period')) order by `priority` desc limit 1") if not row and $config['resume_downloads'] return false if row == nil --- 63,67 ---- row = Db.dbh.select_one("select * from `queue` where (`status`='FINISHED' and (`period`!='0') and ((NOW()-`date_finished`) > `period`)) order by `priority` desc limit 1") if not row and $config['resume_downloads'] row = Db.dbh.select_one("select * from `queue` where (`status`='STOPPED' and (`period`!='0') and ((NOW()-`date_finished`) > `period`)) order by `priority` desc limit 1") if not row and $config['resume_downloads'] ! row = Db.dbh.select_one("select * from `queue` where (`status`='FAILED' and (`period`!='0') and ((NOW()-`date_finished`) > `period`)) order by `priority` desc limit 1") if not row and $config['resume_downloads'] return false if row == nil Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** downloader.rb 23 May 2004 07:28:48 -0000 1.31 --- downloader.rb 25 May 2004 22:41:59 -0000 1.32 *************** *** 66,72 **** ldebug "#{blue 'Loaded'} #{artfile} (last)", false ! when /^uu_msg\(\d+\):Loaded from (.*): '.*' \(.*\):.*part (\d+)\s+(yEnc|UUdata|Base64|XXdata|BinHex|plaintext|qptext|unknown)$/ ! artfile, nb = $1, $3 ! # basename artfile.sub!(/^.*\/([^\/]*)$/, '\1') ldebug "#{blue 'Loaded'} #{artfile}", false --- 66,74 ---- ldebug "#{blue 'Loaded'} #{artfile} (last)", false ! when /^uu_msg\(\d+\):Loaded from (.*): '.*' \((.*)\): ?(.*) ?part (\d+)\s+(yEnc|UUdata|Base64|XXdata|BinHex|plaintext|qptext|unknown|Text)$/ ! artfile, base, filename, nb, enc = $1, $2, $3, $4, $5 ! if (@curfile._filename == 'unknown') ! @curfile._filename = filename ! end artfile.sub!(/^.*\/([^\/]*)$/, '\1') ldebug "#{blue 'Loaded'} #{artfile}", false |
From: Johnjohn <jj...@us...> - 2004-05-23 07:28:57
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12298/ngetsuite Modified Files: articles.rb downloader.rb group.rb nfo.rb Log Message: misc minor fixes, better release recognition Index: articles.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/articles.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** articles.rb 5 Mar 2004 22:30:46 -0000 1.8 --- articles.rb 23 May 2004 07:28:48 -0000 1.9 *************** *** 50,53 **** --- 50,55 ---- elsif subject =~ /(\d{1,3}) *of *(\d{1,3})/ return $1.to_i, $2.to_i, $2.length + elsif subject =~ /(\d{1,3}) *sur *(\d{1,3})/ + return $1.to_i, $2.to_i, $2.length end end *************** *** 133,143 **** end # look for an existing release which could accept this article # (same poster, nbexpected, and file not already seen) if rls = @@rls[cat] ! if (rls.poster==art._from) and (rls._nbexpected==total)#and ((rls.lastnb<cur) or (rls.lastnb==1 and cur==1)) ! if rls._rlsmap[cur-1] == '#' #NgetSuite::Utils.debug "#{cat}: part #{cur} already there {#{art._subject}}" - end # another art for this release rls.pushart(art,cur) --- 135,146 ---- end + # index numbers found + # look for an existing release which could accept this article # (same poster, nbexpected, and file not already seen) + # or file n° 1/xx as all others if rls = @@rls[cat] ! if (rls.poster==art._from) and (rls._nbexpected==total) and ((rls._rlsmap[cur-1].chr != '#') or (cur == 1 and rls._rlsmap =~ /^#_*$/)) #NgetSuite::Utils.debug "#{cat}: part #{cur} already there {#{art._subject}}" # another art for this release rls.pushart(art,cur) Index: nfo.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/nfo.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** nfo.rb 20 Feb 2004 16:44:39 -0000 1.5 --- nfo.rb 23 May 2004 07:28:48 -0000 1.6 *************** *** 14,18 **** if (groupid != '') ! name = Group.getindex(groupid) req += " and nfos.groupindex='#{groupindex}'" end --- 14,18 ---- if (groupid != '') ! groupindex = Group.getindex(groupid) req += " and nfos.groupindex='#{groupindex}'" end Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** downloader.rb 21 May 2004 09:20:44 -0000 1.30 --- downloader.rb 23 May 2004 07:28:48 -0000 1.31 *************** *** 102,113 **** ldebug "#{green 'Already have'} '#{$1}'" - # What is autopar ? - when /^autopar: (.*) seems like a (par2?) \((.*)\)/ - subject, ft, base = $1, $2, $3 - # ldebug "#{blue 'autopar'}: found a #{ft} file: " + blue(base.length > 4 ? base : subject) - - when /^autopar: .* matches local (par2?)set \((.*)\)$/ - # ldebug "#{blue 'autopar'}: got a #{$1}, set #{blue $2}" - when /^decoded ok/ ldebug "#{green 'Decoded'} #{@curfile._filename}" --- 102,105 ---- *************** *** 160,166 **** --- 152,161 ---- when />> \d\d\d/, /<< (GROUP|AUTHINFO)/ + when /^(autopar|parfile|parset)/ + when /^(?:OK:(.*?))?(?:WARNINGS:(.*?))?(?:ERRORS:(.*?))?$/ return unless $1 or $2 or $3 ok,warn,errs = $1, $2, $3 + errs = nil if errs =~ /^\s*\d+\s*autopar\s*$/ @finish_status = (errs ? 'FAILED' : 'FINISHED') ldebug "Finished:#{' ok'+green(ok) if ok}#{' warnings'+yellow(warn) if warn}#{' errors'+red(errs) if errs}" Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** group.rb 21 May 2004 08:42:19 -0000 1.44 --- group.rb 23 May 2004 07:28:48 -0000 1.45 *************** *** 252,256 **** text = `#{$config['yydecode']} #{file} -o - 2>/dev/null `.chomp artindex = Db.dbh.select_one("select `artindex` from `articles` where `mid`='#{mid}'") ! if text and text.length < 15000 and text.length > 800 and artindex sth.execute(artindex[0], text) nb_nfos += 1 --- 252,256 ---- text = `#{$config['yydecode']} #{file} -o - 2>/dev/null `.chomp artindex = Db.dbh.select_one("select `artindex` from `articles` where `mid`='#{mid}'") ! if text and text.length < 15000 and text.length > 100 and artindex sth.execute(artindex[0], text) nb_nfos += 1 |
From: Johnjohn <jj...@us...> - 2004-05-21 09:20:55
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5722 Modified Files: downloader.rb Log Message: removed unnecessary nice from command line (doesn't suppress invocation of sh) Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** downloader.rb 17 Mar 2004 10:14:19 -0000 1.29 --- downloader.rb 21 May 2004 09:20:44 -0000 1.30 *************** *** 185,189 **** downloadexpr = "-r '#{@value}'" end ! @io = IO.popen("nice -n#{$config['nice_nget_download']} -- #{$config['nget']} -q -I -G #{@group} #{downloadexpr} 2>&1") @t = Thread.new(@io, self){ |io, parent| begin --- 185,189 ---- downloadexpr = "-r '#{@value}'" end ! @io = IO.popen("#{"nice -n#{$config['nice_nget_download']} -- " if $config['nice_nget_download'] != 0} #{$config['nget']} -q -I -G #{@group} #{downloadexpr} 2>&1") @t = Thread.new(@io, self){ |io, parent| begin |
From: Johnjohn <jj...@us...> - 2004-05-21 08:50:05
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv434 Modified Files: core.rb Log Message: fix creation of new group directory if the path is relative (make it relative to basedir) Index: core.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/core.rb,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** core.rb 17 Mar 2004 10:14:19 -0000 1.38 --- core.rb 21 May 2004 08:49:56 -0000 1.39 *************** *** 74,78 **** g = Group.new(nil, false, groupname, shortname, dir, true, desc) g.insert_to_db ! Dir.mkdir(g._directory) unless FileTest.exists? g._directory end --- 74,80 ---- g = Group.new(nil, false, groupname, shortname, dir, true, desc) g.insert_to_db ! dir = g._directory ! dir = $config['basedir'] + File::Separator + dir if (dir[0].chr != File::Separator) ! Dir.mkdir(dir) unless FileTest.exists? dir end |
From: Johnjohn <jj...@us...> - 2004-05-21 08:42:29
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31399 Modified Files: group.rb ngetcache.rb Log Message: removed unnecessary nice (doesn't seem to stop the invocation of sh) cleaner advancement printing (with timeout) Index: ngetcache.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/ngetcache.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ngetcache.rb 27 Feb 2004 13:12:07 -0000 1.9 --- ngetcache.rb 21 May 2004 08:42:20 -0000 1.10 *************** *** 59,62 **** --- 59,68 ---- read_head + tracker = Thread.new do + loop do + NgetSuite::Utils.debug "#{@partscountcurrent}/#{@partscounttotal}", false + sleep 0.6 + end + end begin read_body *************** *** 66,69 **** --- 72,76 ---- ensure @fd.close + tracker.kill end end *************** *** 144,148 **** end @partscountcurrent += 1 - NgetSuite::Utils.debug "#{@partscountcurrent}/#{@partscounttotal}", false if @partscountcurrent % 20 == 0 part end --- 151,154 ---- Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** group.rb 17 Mar 2004 10:14:19 -0000 1.43 --- group.rb 21 May 2004 08:42:19 -0000 1.44 *************** *** 168,172 **** n = rand(900000)+100000 ! cmdline = "nice -n#{$config['nice_nget_update']} -- #{$config['nget']} -g #{@_fullname} -cr '^#{n}Dummy' 2>&1" begin --- 168,173 ---- n = rand(900000)+100000 ! cmdline = "#{$config['nget']} -g #{@_fullname} -cr '^#{n}Dummy' 2>&1" ! cmdline = "nice -n#{$config['nice_nget_update']} -- #{cmdline}" if $config['nice_nget_update'] != 0 begin *************** *** 237,243 **** begin # fetches the nfos, w/o decoding ! `nice -n#{$config['nice_nget_update']} -- #{$config['nget']} --path #{tempdir} -G #{@_fullname} -K -L 150 -r '\\.nfo|\\.txt' 2>&1` # but mark them for nget as if we didn't download them ! `nice -n#{$config['nice_nget_update']} -- #{$config['nget']} --path #{tempdir} -qq -G #{@_fullname} -U -r '\\.nfo|\\.txt' 2>&1` debug "Fetchnfos: #{Dir['ngettemp-*'].length} files downloaded in #{Utils.cooltime(Time.now-t)}" --- 238,244 ---- begin # fetches the nfos, w/o decoding ! `#{"nice -n#{$config['nice_nget_update']} -- " if $config['nice_nget_update'] != 0 }#{$config['nget']} --path #{tempdir} -G #{@_fullname} -K -L 150 -r '\\.nfo|\\.txt' 2>&1` # but mark them for nget as if we didn't download them ! `#{"nice -n#{$config['nice_nget_update']} -- " if $config['nice_nget_update'] != 0 }#{$config['nget']} --path #{tempdir} -qq -G #{@_fullname} -U -r '\\.nfo|\\.txt' 2>&1` debug "Fetchnfos: #{Dir['ngettemp-*'].length} files downloaded in #{Utils.cooltime(Time.now-t)}" |
From: Johnjohn <jj...@us...> - 2004-05-21 08:40:15
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31263 Modified Files: HOWTO Log Message: typo fix Index: HOWTO =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/HOWTO,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HOWTO 14 Mar 2004 22:52:45 -0000 1.5 --- HOWTO 21 May 2004 08:40:05 -0000 1.6 *************** *** 24,28 **** ./daemon.rb & ! disown -a II) Add some groups --- 24,28 ---- ./daemon.rb & ! disown II) Add some groups |
From: Julien P. <bla...@us...> - 2004-04-30 12:16:29
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25180 Modified Files: queue.rb Log Message: DA BUGFIX Index: queue.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/queue.rb,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** queue.rb 27 Feb 2004 13:12:07 -0000 1.25 --- queue.rb 30 Apr 2004 12:15:58 -0000 1.26 *************** *** 84,88 **** def Queue.show(groupid = nil, status = nil) ! fg= groupid ? "`groupindex`='#{Groupe.getindex(groupid)}'" : nil fs= status ? "`status`='#{status}'" : nil # DEPLIAGE --- 84,88 ---- def Queue.show(groupid = nil, status = nil) ! fg= groupid ? "`groupindex`='#{Group.getindex(groupid)}'" : nil fs= status ? "`status`='#{status}'" : nil # DEPLIAGE |
From: Johnjohn <jj...@us...> - 2004-03-17 10:23:49
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv856 Modified Files: ngetcache.sql ngetsuite.rb Log Message: deleting a group deletes everything related to it in the database added a field 'ignoreregex' in groups, can be set using -I ; will prevent nget to download articles which subject matches that (using nget's -R) added a fiels 'category' for groups, can be set using -S ; actually unused Index: ngetcache.sql =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetcache.sql,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ngetcache.sql 20 Feb 2004 14:42:43 -0000 1.11 --- ngetcache.sql 17 Mar 2004 10:14:18 -0000 1.12 *************** *** 59,65 **** --- 59,67 ---- `fullname` varchar(128) NOT NULL, `shortname` varchar(32) NOT NULL default '', + `category` varchar(128) default NULL, `directory` varchar(255) NOT NULL default '', `active` set('yes','no') NOT NULL default 'yes', `description` varchar(255) default NULL, + `ignoreregex` varchar(255) default NULL, `date_added` datetime NOT NULL default '0000-00-00 00:00:00', `date_updated` datetime default NULL, Index: ngetsuite.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite.rb,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ngetsuite.rb 5 Mar 2004 15:28:04 -0000 1.21 --- ngetsuite.rb 17 Mar 2004 10:14:18 -0000 1.22 *************** *** 20,23 **** --- 20,24 ---- [ '--update-group', '-u', GetoptLong::REQUIRED_ARGUMENT, 'groupid', 'Update the header cache for the specified group'], [ '--update-all-groups', '-v', GetoptLong::NO_ARGUMENT, 'Update headers for all groups'], + [ '--set-group-category', '-S', GetoptLong::REQUIRED_ARGUMENT, 'groupid,category', 'Set the category of the group'], [ '--list-nfos', '-l', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Lists already fetched nfos' ], [ '--list-releases', '-L', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Lists detected releases' ], *************** *** 26,29 **** --- 27,31 ---- [ '--queue-article', '-q', GetoptLong::REQUIRED_ARGUMENT, 'groupid,articleid', 'Adds an article to the download queue'], [ '--queue-regexp', '-r', GetoptLong::REQUIRED_ARGUMENT, 'gid,regexp[,prio,period,dir]', 'Adds a regexp to the download queue' ], + [ '--set-ignore-regexp', '-I', GetoptLong::REQUIRED_ARGUMENT, 'gid[,regexp]', 'Sets the regexp that nget will use as ignore-regexp (none for remove)' ], [ '--show-queue', '-t', GetoptLong::OPTIONAL_ARGUMENT, '[groupid]', 'Shows the current download queue'], [ '--start-manager', '-m', GetoptLong::NO_ARGUMENT, 'Launches the download manager'], |