Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/views/metered_stream.py

Issue 2256793002: Make docstrings more consistent using format-webkitpy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make indentation of final quote based on parse tree (indentation prior to docstring node) rather th… Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (C) 2010, 2012 Google Inc. All rights reserved. 1 # Copyright (C) 2010, 2012 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 17 matching lines...) Expand all
28 28
29 import logging 29 import logging
30 import os 30 import os
31 import sys 31 import sys
32 import time 32 import time
33 33
34 LOG_HANDLER_NAME = 'MeteredStreamLogHandler' 34 LOG_HANDLER_NAME = 'MeteredStreamLogHandler'
35 35
36 36
37 class MeteredStream(object): 37 class MeteredStream(object):
38 """ 38 """This class implements a stream wrapper that has 'meters' as well as
39 This class implements a stream wrapper that has 'meters' as well as
40 regular output. A 'meter' is a single line of text that can be erased 39 regular output. A 'meter' is a single line of text that can be erased
41 and rewritten repeatedly, without producing multiple lines of output. It 40 and rewritten repeatedly, without producing multiple lines of output. It
42 can be used to produce effects like progress bars. 41 can be used to produce effects like progress bars.
43 """ 42 """
44 43
45 @staticmethod 44 @staticmethod
46 def _erasure(txt): 45 def _erasure(txt):
47 num_chars = len(txt) 46 num_chars = len(txt)
48 return '\b' * num_chars + ' ' * num_chars + '\b' * num_chars 47 return '\b' * num_chars + ' ' * num_chars + '\b' * num_chars
49 48
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 129
131 class _LogHandler(logging.Handler): 130 class _LogHandler(logging.Handler):
132 131
133 def __init__(self, meter): 132 def __init__(self, meter):
134 logging.Handler.__init__(self) 133 logging.Handler.__init__(self)
135 self._meter = meter 134 self._meter = meter
136 self.name = LOG_HANDLER_NAME 135 self.name = LOG_HANDLER_NAME
137 136
138 def emit(self, record): 137 def emit(self, record):
139 self._meter.writeln(record.getMessage(), record.created, record.process) 138 self._meter.writeln(record.getMessage(), record.created, record.process)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698