From 2b0569778fe375dba41e4d5a97916c83b371af44 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sat, 7 Jun 2008 18:19:38 +0000 Subject: Add setting for the buglist.cgi URL. --- bugzilla.rb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/bugzilla.rb b/bugzilla.rb index 60cfd97..49b74af 100644 --- a/bugzilla.rb +++ b/bugzilla.rb @@ -43,7 +43,7 @@ VALID_RESO = ['FIXED', 'INVALID', 'WONTFIX', 'LATER', 'REMIND', 'DUPLICATE', 'W # Each zilla instance may have these parameters # TODO: Add 'nicename' that is used for output to IRC. Defaults to name.capitialize -OPTIONS = [ 'name', 'baseurl', 'dataurl', 'showbugurl', 'reporturl' ] +OPTIONS = [ 'name', 'baseurl', 'dataurl', 'showbugurl', 'reporturl', 'buglisturl' ] # Now life gets fun, these are regular expresses to check the above arrays _STATUS_INPUT = (DONE_STATUS+OPEN_STATUS+['ALL']).uniq.join('|') @@ -193,6 +193,20 @@ class BugzillaPlugin < Plugin @reporturl = @registry["zilla.#{name}.reporturl"] = val end + def buglisturl + @buglisturl = @registry["zilla.#{name}.buglisturl"] unless @buglisturl + + unless @buglisturl + guess_buglisturl + end + + return @buglisturl + end + + def buglisturl=(val) + @buglisturl = @registry["zilla.#{name}.buglisturl"] = val + end + def lastseenid return @registry["zilla.#{name}.lastseenid"] end @@ -280,6 +294,11 @@ class BugzillaPlugin < Plugin @reporturl = "#{baseurl}/report.cgi?action=wrap&ctype=csv&format=table" end + # Guess at the default URL to use for generating CSV output for a search + def guess_buglisturl + @buglisturl = "#{baseurl}/buglist.cgi?ctype=csv&order=bugs.bug_id" + end + # Deletes the client object if any def delete_client # TODO: httpclient does not seem to provide a way to close the -- cgit v1.2.3-65-gdbad