Changeset 53734 in webkit


Ignore:
Timestamp:
Jan 22, 2010 4:21:53 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-01-22 Adam Barth <abarth@webkit.org>

Rubber stamped by Eric Seidel.

Make init.py and buildbot.py pass pep8 style checker.

  • Scripts/webkitpy/init.py:
  • Scripts/webkitpy/buildbot.py:
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r53733 r53734  
     12010-01-22  Adam Barth  <abarth@webkit.org>
     2
     3        Rubber stamped by Eric Seidel.
     4
     5        Make __init__.py and buildbot.py pass pep8 style checker.
     6
     7        * Scripts/webkitpy/__init__.py:
     8        * Scripts/webkitpy/buildbot.py:
     9
    1102010-01-21  Joe Mason  <jmason@rim.com>
    211
  • trunk/WebKitTools/Scripts/webkitpy/__init__.py

    r52723 r53734  
    33import autoinstall
    44
    5 # List our third-party library dependencies here and where they can be downloaded.
     5# List our third-party library dependencies here and where they can be
     6# downloaded.
    67autoinstall.bind("ClientForm", "http://pypi.python.org/packages/source/C/ClientForm/ClientForm-0.2.10.zip", "ClientForm-0.2.10")
    78autoinstall.bind("mechanize", "http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip", "mechanize-0.1.11")
  • trunk/WebKitTools/Scripts/webkitpy/buildbot.py

    r52908 r53734  
    11# Copyright (c) 2009, Google Inc. All rights reserved.
    2 # 
     2#
    33# Redistribution and use in source and binary forms, with or without
    44# modification, are permitted provided that the following conditions are
    55# met:
    6 # 
     6#
    77#     * Redistributions of source code must retain the above copyright
    88# notice, this list of conditions and the following disclaimer.
     
    1414# contributors may be used to endorse or promote products derived from
    1515# this software without specific prior written permission.
    16 # 
     16#
    1717# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1818# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     
    3939from .BeautifulSoup import BeautifulSoup
    4040
     41
    4142class BuildBot:
     43
    4244    default_host = "build.webkit.org"
     45
    4346    def __init__(self, host=default_host):
    4447        self.buildbot_host = host
    4548        self.buildbot_server_url = "http://%s/" % self.buildbot_host
    46        
    47         # If any Leopard builder/tester, Windows builder or Chromium builder is red we should not be landing patches.
    48         # Other builders should be added to this list once they are known to be reliable.
     49
     50        # If any Leopard builder/tester, Windows builder or Chromium builder is
     51        # red we should not be landing patches.  Other builders should be added
     52        # to this list once they are known to be reliable.
    4953        # See https://bugs.webkit.org/show_bug.cgi?id=33296 and related bugs.
    50         self.core_builder_names_regexps = [ "Leopard", "Windows.*Build", "Chromium" ]
     54        self.core_builder_names_regexps = [
     55            "Leopard",
     56            "Windows.*Build",
     57            "Chromium",
     58        ]
    5159
    52     # If WebKit's buildbot has an XMLRPC interface we could use, we could do something more sophisticated here.
    53     # For now we just parse out the basics, enough to support basic questions like "is the tree green?"
    5460    def _parse_builder_status_from_row(self, status_row):
     61        # If WebKit's buildbot has an XMLRPC interface we could use, we could
     62        # do something more sophisticated here.  For now we just parse out the
     63        # basics, enough to support basic questions like "is the tree green?"
    5564        status_cells = status_row.findAll('td')
    5665        builder = {}
     
    5867        name_link = status_cells[0].find('a')
    5968        builder['name'] = name_link.string
    60         # We could generate the builder_url from the name in a future version of this code.
     69        # We could generate the builder_url from the name in a future version
     70        # of this code.
    6171        builder['builder_url'] = self.buildbot_server_url + name_link['href']
    6272
    6373        status_link = status_cells[1].find('a')
    6474        if not status_link:
    65             # We failed to find a link in the first cell, just give up.
    66             # This can happen if a builder is just-added, the first cell will just be "no build"
    67             builder['is_green'] = False # Other parts of the code depend on is_green being present.
     75            # We failed to find a link in the first cell, just give up.  This
     76            # can happen if a builder is just-added, the first cell will just
     77            # be "no build"
     78            # Other parts of the code depend on is_green being present.
     79            builder['is_green'] = False
    6880            return builder
    69         revision_string = status_link.string # Will be either a revision number or a build number
     81        # Will be either a revision number or a build number
     82        revision_string = status_link.string
    7083        # If revision_string has non-digits assume it's not a revision number.
    71         builder['built_revision'] = int(revision_string) if not re.match('\D', revision_string) else None
    72         builder['is_green'] = not re.search('fail', status_cells[1].renderContents())
    73         # We could parse out the build number instead, but for now just store the URL.
     84        builder['built_revision'] = int(revision_string) \
     85                                    if not re.match('\D', revision_string) \
     86                                    else None
     87        builder['is_green'] = not re.search('fail',
     88                                            status_cells[1].renderContents())
     89        # We could parse out the build number instead, but for now just store
     90        # the URL.
    7491        builder['build_url'] = self.buildbot_server_url + status_link['href']
    7592
     
    7895        return builder
    7996
    80     def _builder_statuses_with_names_matching_regexps(self, builder_statuses, name_regexps):
     97    def _builder_statuses_with_names_matching_regexps(self,
     98                                                      builder_statuses,
     99                                                      name_regexps):
    81100        builders = []
    82101        for builder in builder_statuses:
     
    88107    def red_core_builders(self):
    89108        red_builders = []
    90         for builder in self._builder_statuses_with_names_matching_regexps(self.builder_statuses(), self.core_builder_names_regexps):
     109        for builder in self._builder_statuses_with_names_matching_regexps(
     110                               self.builder_statuses(),
     111                               self.core_builder_names_regexps):
    91112            if not builder['is_green']:
    92113                red_builders.append(builder)
Note: See TracChangeset for help on using the changeset viewer.