Changeset 75438 in webkit
- Timestamp:
- Jan 10, 2011 2:37:58 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r75433 r75438 1 2011-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 1 14 2011-01-10 Tony Chang <tony@chromium.org> 2 15 -
trunk/Tools/Scripts/webkitpy/common/system/executive.py
r71854 r75438 54 54 class ScriptError(Exception): 55 55 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 56 64 def __init__(self, 57 65 message=None, … … 61 69 cwd=None): 62 70 if not message: 63 message = 'Failed to run "%s"' % s cript_args71 message = 'Failed to run "%s"' % self._string_from_args(script_args) 64 72 if exit_code: 65 73 message += " exit_code: %d" % exit_code -
trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py
r71547 r75438 36 36 from webkitpy.common.system.executive import Executive, run_command, ScriptError 37 37 from webkitpy.test import cat, echo 38 39 40 class 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'...") 38 46 39 47
Note: See TracChangeset
for help on using the changeset viewer.