From df3602bf4d7f77d3e44f3c5954842c1f6e495be7 Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 24 Oct 2003 12:38:45 +0000 Subject: [PATCH] Added another field (Submitted by) to the snarfer. Centralized the re options for the parsers --- plugins/Sourceforge.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/plugins/Sourceforge.py b/plugins/Sourceforge.py index ea6bd08d6..ef5a8aaa7 100644 --- a/plugins/Sourceforge.py +++ b/plugins/Sourceforge.py @@ -83,21 +83,31 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp): threaded = True regexps = ['sfSnarfer'] + _reopts = re.I + _infoRe = re.compile(r'(\d+)'\ - '([^<]+)', re.I) + '([^<]+)', _reopts) _hrefOpts = '&set=custom&_assigned_to=0&_status=1&_category=100&'\ '_group=100&order=artifact_id&sort=DESC' - _resolution = re.compile(r'Resolution: (.+?)', re.I) + _resolution = re.compile(r'Resolution: (.+?)', + _reopts) _getRes = lambda self, s: '%s: %s' % (ircutils.bold('Resolution'), self._resolution.search(s).group(1)) - _assigned = re.compile(r'Assigned To: (.+?)', re.I) + + _assigned = re.compile(r'Assigned To: (.+?)', _reopts) _getAssign = lambda self, s: '%s: %s' % (ircutils.bold('Assigned to'), self._assigned.search(s).group(1)) - _priority = re.compile(r'Priority: (.+?)', re.I) + + _submitted = re.compile(r'Submitted By:
([^<]+)', _reopts) + _getSubmit = lambda self, s: '%s: %s' % (ircutils.bold('Submmited by'), + self._submitted.search(s).group(1)) + + _priority = re.compile(r'Priority: (.+?)', _reopts) _getPri = lambda self, s: '%s: %s' % (ircutils.bold('Priority'), self._priority.search(s).group(1)) - _status = re.compile(r'Status: (.+?)', re.I) + + _status = re.compile(r'Status: (.+?)', _reopts) _getStatus = lambda self, s: '%s: %s' % (ircutils.bold('Status'), self._status.search(s).group(1)) @@ -259,8 +269,8 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp): fd = urllib2.urlopen(url) s = fd.read() fd.close() - searches = (self._getStatus, self._getRes, self._getPri, - self._getAssign) + searches = (self._getSubmit, self._getStatus, self._getRes, + self._getPri, self._getAssign) try: (num, desc) = self._sfTitle.search(s).groups() resp = [desc]