Title: [96560] trunk/Tools
- Revision
- 96560
- Author
- [email protected]
- Date
- 2011-10-03 17:23:56 -0700 (Mon, 03 Oct 2011)
Log Message
webkitpy: Expose cc_emails and comments from bug.py
https://bugs.webkit.org/show_bug.cgi?id=69308
Reviewed by Adam Barth.
* Scripts/webkitpy/common/net/bugzilla/bug.py: Expose cc_emails and comments .
* Scripts/webkitpy/common/net/bugzilla/bugzilla.py: Add parsing support for comments.
* Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py: Fix the unit test due
to comments being exposed.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (96559 => 96560)
--- trunk/Tools/ChangeLog 2011-10-04 00:13:01 UTC (rev 96559)
+++ trunk/Tools/ChangeLog 2011-10-04 00:23:56 UTC (rev 96560)
@@ -1,3 +1,15 @@
+2011-10-03 David Levin <[email protected]>
+
+ webkitpy: Expose cc_emails and comments from bug.py
+ https://bugs.webkit.org/show_bug.cgi?id=69308
+
+ Reviewed by Adam Barth.
+
+ * Scripts/webkitpy/common/net/bugzilla/bug.py: Expose cc_emails and comments .
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py: Add parsing support for comments.
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py: Fix the unit test due
+ to comments being exposed.
+
2011-10-03 James Robinson <[email protected]>
Add myself to the watchlist for platform/graphics/chromium
Modified: trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bug.py (96559 => 96560)
--- trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bug.py 2011-10-04 00:13:01 UTC (rev 96559)
+++ trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bug.py 2011-10-04 00:23:56 UTC (rev 96560)
@@ -53,6 +53,9 @@
def assigned_to_email(self):
return self.bug_dictionary["assigned_to_email"]
+ def cc_emails(self):
+ return self.bug_dictionary["cc_emails"]
+
# FIXME: This information should be stored in some sort of webkit_config.py instead of here.
unassigned_emails = frozenset([
"[email protected]",
@@ -110,3 +113,6 @@
# Checking committer() ensures that it was both commit-queue+'d and has
# a valid committer.
return filter(lambda patch: patch.committer(), patches)
+
+ def comments(self):
+ return self.bug_dictionary["comments"]
Modified: trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py (96559 => 96560)
--- trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py 2011-10-04 00:13:01 UTC (rev 96559)
+++ trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py 2011-10-04 00:23:56 UTC (rev 96560)
@@ -346,11 +346,14 @@
# FIXME: Some bugzilla dates seem to have seconds in them?
# Python does not support timezones out of the box.
# Assume that bugzilla always uses PST (which is true for bugs.webkit.org)
- _bugzilla_date_format = "%Y-%m-%d %H:%M"
+ _bugzilla_date_format = "%Y-%m-%d %H:%M:%S"
@classmethod
def _parse_date(cls, date_string):
(date, time, time_zone) = date_string.split(" ")
+ if time.count(':') == 1:
+ # Add seconds into the time.
+ time += ':0'
# Ignore the timezone because python doesn't understand timezones out of the box.
date_string = "%s %s" % (date, time)
return datetime.strptime(date_string, cls._bugzilla_date_format)
@@ -376,6 +379,13 @@
element, 'commit-queue', attachment, 'committer_email')
return attachment
+ def _parse_log_descr_element(self, element):
+ comment = {}
+ comment['comment_email'] = self._string_contents(element.find('who'))
+ comment['comment_date'] = self._date_contents(element.find('bug_when'))
+ comment['text'] = self._string_contents(element.find('thetext'))
+ return comment
+
def _parse_bugs_from_xml(self, page):
soup = BeautifulSoup(page)
# Without the unicode() call, BeautifulSoup occasionally complains of being
@@ -395,6 +405,8 @@
bug["assigned_to_email"] = self._string_contents(soup.find("assigned_to"))
bug["cc_emails"] = [self._string_contents(element) for element in soup.findAll('cc')]
bug["attachments"] = [self._parse_attachment_element(element, bug["id"]) for element in soup.findAll('attachment')]
+ bug["comments"] = [self._parse_log_descr_element(element) for element in soup.findAll('long_desc')]
+
return bug
# Makes testing fetch_*_from_bug() possible until we have a better
Modified: trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py (96559 => 96560)
--- trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py 2011-10-04 00:13:01 UTC (rev 96559)
+++ trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py 2011-10-04 00:23:56 UTC (rev 96560)
@@ -191,6 +191,13 @@
'type': 'text/plain',
'id': 45548
}],
+ "comments" : [{
+ 'comment_date': datetime.datetime(2009, 12, 15, 15, 17, 28),
+ 'comment_email': '[email protected]',
+ 'text': """bug to test webkit-patch and commit-queue failures
+
+Ignore this bug. Just for testing failure modes of webkit-patch and the commit-queue.""",
+ }]
}
# FIXME: This should move to a central location and be shared by more unit tests.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes