[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

aroben at apple.com aroben at apple.com
Wed Dec 22 13:39:16 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 37e649a4ce86a0514ef9c03ee0b73a9fe92513a0
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 22 17:18:56 2010 +0000

    Fix webkit-patch failure-reason now that build.webkit.org has been updated
    
    Fixes <http://webkit.org/b/46273> webkit-patch failure-reason crashes
    every time
    
    Reviewed by Eric Seidel.
    
    * Scripts/webkitpy/common/net/buildbot.py:
    (BuildBot._file_cell_text): Added. Travels down the firstChild chain
    looking for an element that contains text, then returns it.
    (BuildBot._parse_twisted_file_row): Use _file_cell_text to get the
    text out of the cells. This way it doesn't matter whether the cells
    have <b> children (as for cells in directory rows) or not (as for
    cells in file rows)
    (BuildBot._parse_twisted_directory_listing): Look for rows that have
    the "directory" or "file" class, rather than rows with any class,
    since header rows now have a class attribute.
    
    * Scripts/webkitpy/common/net/buildbot_unittest.py:
    (BuildBotTest._example_directory_listing): Updated to more closely
    match the markup that build.webkit.org is producing now.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68053 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 4362e25..149c549 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,28 @@
+2010-09-22  Adam Roben  <aroben at apple.com>
+
+        Fix webkit-patch failure-reason now that build.webkit.org has been
+        updated
+
+        Fixes <http://webkit.org/b/46273> webkit-patch failure-reason crashes
+        every time
+
+        Reviewed by Eric Seidel.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        (BuildBot._file_cell_text): Added. Travels down the firstChild chain
+        looking for an element that contains text, then returns it.
+        (BuildBot._parse_twisted_file_row): Use _file_cell_text to get the
+        text out of the cells. This way it doesn't matter whether the cells
+        have <b> children (as for cells in directory rows) or not (as for
+        cells in file rows)
+        (BuildBot._parse_twisted_directory_listing): Look for rows that have
+        the "directory" or "file" class, rather than rows with any class,
+        since header rows now have a class attribute.
+
+        * Scripts/webkitpy/common/net/buildbot_unittest.py:
+        (BuildBotTest._example_directory_listing): Updated to more closely
+        match the markup that build.webkit.org is producing now.
+
 2010-09-21  Dirk Pranke  <dpranke at chromium.org>
 
         Unreviewed, build fix.
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
index 593ebc1..29f2228 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
@@ -414,20 +414,27 @@ class BuildBot(object):
         build_status_url = "http://%s/one_box_per_builder" % self.buildbot_host
         return urllib2.urlopen(build_status_url)
 
+    def _file_cell_text(self, file_cell):
+        """Traverses down through firstChild elements until one containing a string is found, then returns that string"""
+        element = file_cell
+        while element.string is None and element.contents:
+            element = element.contents[0]
+        return element.string
+
     def _parse_twisted_file_row(self, file_row):
-        string_or_empty = lambda soup: unicode(soup.string) if soup.string else u""
+        string_or_empty = lambda string: unicode(string) if string else u""
         file_cells = file_row.findAll('td')
         return {
-            "filename": string_or_empty(file_cells[0].find("a")),
-            "size": string_or_empty(file_cells[1]),
-            "type": string_or_empty(file_cells[2]),
-            "encoding": string_or_empty(file_cells[3]),
+            "filename": string_or_empty(self._file_cell_text(file_cells[0])),
+            "size": string_or_empty(self._file_cell_text(file_cells[1])),
+            "type": string_or_empty(self._file_cell_text(file_cells[2])),
+            "encoding": string_or_empty(self._file_cell_text(file_cells[3])),
         }
 
     def _parse_twisted_directory_listing(self, page):
         soup = BeautifulSoup(page)
         # HACK: Match only table rows with a class to ignore twisted header/footer rows.
-        file_rows = soup.find('table').findAll('tr', { "class" : True })
+        file_rows = soup.find('table').findAll('tr', {'class': re.compile(r'\b(?:directory|file)\b')})
         return [self._parse_twisted_file_row(file_row) for file_row in file_rows]
 
     # FIXME: There should be a better way to get this information directly from twisted.
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
index b48f0e4..a435b9b 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
@@ -361,22 +361,19 @@ class BuildBotTest(unittest.TestCase):
 <h1>Directory listing for /results/SnowLeopard Intel Leaks/</h1>
 
 <table>
-    <thead>
-        <tr>
+        <tr class="alt">
             <th>Filename</th>
             <th>Size</th>
             <th>Content type</th>
             <th>Content encoding</th>
         </tr>
-    </thead>
-    <tbody>
-<tr class="odd">
-    <td><a href="r47483%20%281%29/">r47483 (1)/</a></td>
-    <td></td>
-    <td>[Directory]</td>
-    <td></td>
+<tr class="directory ">
+    <td><a href="r47483%20%281%29/"><b>r47483 (1)/</b></a></td>
+    <td><b></b></td>
+    <td><b>[Directory]</b></td>
+    <td><b></b></td>
 </tr>
-<tr class="odd">
+<tr class="file alt">
     <td><a href="r47484%20%282%29.zip">r47484 (2).zip</a></td>
     <td>89K</td>
     <td>[application/zip]</td>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list