Changeset 75438 in webkit


Ignore:
Timestamp:
Jan 10, 2011 2:37:58 PM (13 years ago)
Author:
eric@webkit.org
Message:

2011-01-10 Eric Seidel <eric@webkit.org>

Reviewed by Ojan Vafai.

style-queue messages are way too long for big patches
https://bugs.webkit.org/show_bug.cgi?id=52161

We definitely could build much fancier list-to-string-with-limit functions
but this should be sufficient for our needs at the moment.

  • Scripts/webkitpy/common/system/executive.py:
  • Scripts/webkitpy/common/system/executive_unittest.py:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r75433 r75438  
     12011-01-10  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        style-queue messages are way too long for big patches
     6        https://bugs.webkit.org/show_bug.cgi?id=52161
     7
     8        We definitely could build much fancier list-to-string-with-limit functions
     9        but this should be sufficient for our needs at the moment.
     10
     11        * Scripts/webkitpy/common/system/executive.py:
     12        * Scripts/webkitpy/common/system/executive_unittest.py:
     13
    1142011-01-10  Tony Chang  <tony@chromium.org>
    215
  • trunk/Tools/Scripts/webkitpy/common/system/executive.py

    r71854 r75438  
    5454class ScriptError(Exception):
    5555
     56    # This is a custom List.__str__ implementation to allow size limiting.
     57    def _string_from_args(self, args, limit=100):
     58        args_string = unicode(args)
     59        # We could make this much fancier, but for now this is OK.
     60        if len(args_string) > limit:
     61            return args_string[:limit - 3] + "..."
     62        return args_string
     63
    5664    def __init__(self,
    5765                 message=None,
     
    6169                 cwd=None):
    6270        if not message:
    63             message = 'Failed to run "%s"' % script_args
     71            message = 'Failed to run "%s"' % self._string_from_args(script_args)
    6472            if exit_code:
    6573                message += " exit_code: %d" % exit_code
  • trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py

    r71547 r75438  
    3636from webkitpy.common.system.executive import Executive, run_command, ScriptError
    3737from webkitpy.test import cat, echo
     38
     39
     40class ScriptErrorTest(unittest.TestCase):
     41    def test_string_from_args(self):
     42        error = ScriptError()
     43        self.assertEquals(error._string_from_args(None), 'None')
     44        self.assertEquals(error._string_from_args([]), '[]')
     45        self.assertEquals(error._string_from_args(map(str, range(30))), "['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17'...")
    3846
    3947
Note: See TracChangeset for help on using the changeset viewer.