[Pkg-debile-commits] [debile-slave] 22/100: fixing the wrapper
Sylvestre Ledru
sylvestre at alioth.debian.org
Mon Aug 19 14:53:01 UTC 2013
This is an automated email from the git hooks/post-receive script.
sylvestre pushed a commit to branch master
in repository debile-slave.
commit 7d0920c526ae6e0a2d8dbd5e9119e991c953ec4f
Author: Paul Tagliamonte <tag at pault.ag>
Date: Sat May 25 10:56:43 2013 -0400
fixing the wrapper
---
ethel/commands/adequate.py | 36 ++++++------------------------------
1 file changed, 6 insertions(+), 30 deletions(-)
diff --git a/ethel/commands/adequate.py b/ethel/commands/adequate.py
index e3f8b00..60c18ed 100644
--- a/ethel/commands/adequate.py
+++ b/ethel/commands/adequate.py
@@ -1,34 +1,10 @@
from ethel.chroot import schroot, copy, scmd
-from storz.wrapper import generate_analysis
+from ethel.wrappers.adequate import parse_adequate
+
from firehose.model import Issue, Message, File, Location
+from storz.wrapper import generate_analysis
import os
-import re
-
-OUTPUT_REGEX = re.compile(r"(?P<package>.*): (?P<tag>[^\s]*) (?P<info>.*)")
-
-
-def parse_output(lines):
- for line in lines:
- info = OUTPUT_REGEX.match(line).groupdict()
-
- testid = info['tag']
- severity = "error"
- pth = info['info'].split(" ", 1)
- pth = pth[0] if pth else None
-
- if pth is None:
- continue
-
- yield Issue(cwe=None,
- testid=testid,
- location=Location(file=File(pth, None),
- function=None,
- point=None),
- severity=severity,
- message=Message(text=line),
- notes=None,
- trace=None)
def adequate(chroot, package):
@@ -56,7 +32,7 @@ def adequate(chroot, package):
out, err = scmd(session, ['adequate', deb.split("_", 1)[0]])
failed = False
- for issue in parse_output(out.splitlines()):
+ for issue in parse_adequate(out.splitlines()):
failed = True
analysis.results.append(issue)
@@ -66,5 +42,5 @@ def adequate(chroot, package):
def main():
import sys
output = open(sys.argv[3], 'wb')
- info = adequate(sys.argv[1], sys.argv[2])
- output.write(info.to_xml_bytes())
+ failed, out, analysis = adequate(sys.argv[1], sys.argv[2])
+ output.write(analysis.to_xml_bytes())
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-slave.git
More information about the Pkg-debile-commits
mailing list