diff options
author | Matěj Cepl <mcepl@redhat.com> | 2010-04-26 12:18:08 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2010-04-26 12:18:08 +0200 |
commit | 80bc5b6aa6e6a093cd2c2a70a7cf0829afa13b27 (patch) | |
tree | 4ddbd36f611b293e31a6d66a1de24e9138e0d21b /bugzillaBugTriage.js | |
parent | 0c87af0bff666c98f410499eef40adfe821206de (diff) | |
download | bugzilla-triage-80bc5b6aa6e6a093cd2c2a70a7cf0829afa13b27.tar.gz |
fix issue 30 ... new format of Xorg.0.log
Diffstat (limited to 'bugzillaBugTriage.js')
-rw-r--r-- | bugzillaBugTriage.js | 108 |
1 files changed, 53 insertions, 55 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index cfc3025..8c39590 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -63,9 +63,8 @@ var msgStrs = {}; var CommentRe = new RegExp("^\\s*#"); var BlankLineRe = new RegExp("^\\s*$"); // nová řádka -// [ 65.631] (--) intel(0): Chipset: "845G" -var ChipsetRE = new RegExp( - "^\\s*\\[?[ 0-9.]*\\]?\\s*\\(--\\) ([A-Za-z]+)\\([0-9]?\\): Chipset: (.*)$"); +// [ 65.631] (--) intel(0): Chipset: "845G" +var ChipsetRE = new RegExp("^\\s*\\[?[ 0-9.]*\\]?\\s*\\(--\\) ([A-Za-z]+)\\([0-9]?\\): Chipset: (.*)$"); var ATIgetIDRE = new RegExp("^.*\\(ChipID = 0x([0-9a-fA-F]+)\\).*$"); var AbrtRE = new RegExp("^\\s*\\[abrt\\]"); var signalHandlerRE = new RegExp("^\\s*#[0-9]*\\s*<signal handler called>"); @@ -1265,58 +1264,57 @@ BzPage.prototype.addNewButton = function(originalLocation, newId, newLabel, * * @return None */ -BzPage.prototype.fillInChipMagic = function() { - var XorgLogURL = ""; - var XorgLogAttID = ""; - var XorgLogFound = false; - var attURL = "", interestingLine = ""; - var interestingArray = []; - - // Find out Xorg.0.log attachment URL - this.XorgLogAttList = this.attachments - .filter(function(value, index, array) { - // Xorg.0.log must be text, otherwise we cannot parse it - return (/[xX].*log/.test(value[0]) && /text/.test(value[2])); - }); - if (this.XorgLogAttList.length === 0) { - return; - } - - XorgLogAttID = this.XorgLogAttList[this.XorgLogAttListIndex][1]; - attURL = "https://bugzilla.redhat.com/attachment.cgi?id=" + XorgLogAttID; - that = this; - - var req = new XMLHttpRequest(); - req.open("GET", attURL, true); - req.onreadystatechange = function(aEvt) { - if (req.readyState == 4) { - if (req.status == 200) { - var ret = req.responseText; - var interestingLineArr = ret.split("\n").filter( - function(v, i, a) { - return ChipsetRE.test(v); - }); - console.log("interestingLineArr = " - + interestingLineArr.toSource()); - if (interestingLineArr.length > 0) { - interestingArray = ChipsetRE.exec(interestingLineArr[0]); - interestingLine = interestingArray[2].replace(/[\s"]+/g, - " ").trim(); - var whiteboardInput = that.dok - .getElementById("status_whiteboard"); - that.addNewButton(whiteboardInput, "chipmagic", "Fill In", - "", "CHIPMAGIC", interestingLine + "\t" - + interestingArray[1].toUpperCase(), false, - true); - } - } else { - throw "Getting attachment " + attURL + "failed!"; - } - } - }; - req.send(""); - - this.XorgLogAttListIndex++; +BzPage.prototype.fillInChipMagic = function () { + var XorgLogURL = ""; + var XorgLogAttID = ""; + var XorgLogFound = false; + var attURL = "", interestingLine = ""; + var interestingArray = []; + + + // Find out Xorg.0.log attachment URL + this.XorgLogAttList = this.attachments.filter(function (value, index, array) { + // Xorg.0.log must be text, otherwise we cannot parse it + return (/[xX].*log/.test(value[0]) && /text/.test(value[2])); + }); + if (this.XorgLogAttList.length === 0) { + return; + } + + XorgLogAttID = this.XorgLogAttList[this.XorgLogAttListIndex][1]; + attURL = "https://bugzilla.redhat.com/attachment.cgi?id="+XorgLogAttID; + that = this; + + var req = new XMLHttpRequest(); + req.open("GET",attURL,true); + req.onreadystatechange = function (aEvt) { + if (req.readyState == 4) { + if (req.status == 200) { + var ret = req.responseText; + var interestingLineArr = ret.split("\n"). + filter(function (v,i,a) { + return ChipsetRE.test(v); + }); + console.log("interestingLineArr = " + interestingLineArr.toSource()); + if (interestingLineArr.length >0) { + interestingArray = ChipsetRE.exec(interestingLineArr[0]); + interestingLine = interestingArray[2]. + replace(/[\s"]+/g," ").trim(); + var whiteboardInput = that.dok. + getElementById("status_whiteboard"); + that.addNewButton(whiteboardInput,"chipmagic","Fill In", + "","CHIPMAGIC", + interestingLine+"\t"+interestingArray[1].toUpperCase(), + false,true); + } + } else { + throw "Getting attachment " + attURL + "failed!"; + } + } + }; + req.send(""); + + this.XorgLogAttListIndex++; }; /** |