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

Side by Side Diff: tools/dom/scripts/multiemitter.py

Issue 554853002: "Reverting 39948" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « tools/dom/scripts/monitored.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """Templating to help generate structured text.""" 6 """Templating to help generate structured text."""
7 7
8 import os 8 import os
9 import sys 9 import sys
10 import subprocess 10 import subprocess
11 import time 11 import time
12 import emitter 12 import emitter
13 import logging 13 import logging
14 14
15 _logger = logging.getLogger('multiemitter') 15 _logger = logging.getLogger('multiemitter')
16 16
17 class MultiEmitter(object): 17 class MultiEmitter(object):
18 """A set of Emitters that write to different files. 18 """A set of Emitters that write to different files.
19 19
20 Each entry has a key. 20 Each entry has a key.
21 21
22 file --> emitter 22 file --> emitter
23 key --> emitter 23 key --> emitter
24 24
25 """ 25 """
26 26
27 def __init__(self, logging_level=logging.WARNING): 27 def __init__(self):
28 self._key_to_emitter = {} # key -> Emitter 28 self._key_to_emitter = {} # key -> Emitter
29 self._filename_to_emitter = {} # filename -> Emitter 29 self._filename_to_emitter = {} # filename -> Emitter
30 30
31 _logger.setLevel(logging_level)
32
33 31
34 def FileEmitter(self, filename, key=None): 32 def FileEmitter(self, filename, key=None):
35 """Creates an emitter for writing to a file. 33 """Creates an emitter for writing to a file.
36 34
37 When this MultiEmitter is flushed, the contents of the emitter are written 35 When this MultiEmitter is flushed, the contents of the emitter are written
38 to the file. 36 to the file.
39 37
40 Arguments: 38 Arguments:
41 filename: a string, the path name of the file 39 filename: a string, the path name of the file
42 key: provides an access key to retrieve the emitter. 40 key: provides an access key to retrieve the emitter.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 108
111 if sys.platform == 'win32': 109 if sys.platform == 'win32':
112 handle_file = r'E:\handle.exe' 110 handle_file = r'E:\handle.exe'
113 if os.path.exists(handle_file): 111 if os.path.exists(handle_file):
114 _logger.info('Running handle.exe for debugging purposes') 112 _logger.info('Running handle.exe for debugging purposes')
115 subprocess.call([handle_file, '-a', r'E:\b\build\slave']) 113 subprocess.call([handle_file, '-a', r'E:\b\build\slave'])
116 else: 114 else:
117 _logger.info("Couldn't find %s. Not printing open handles." 115 _logger.info("Couldn't find %s. Not printing open handles."
118 % handle_file) 116 % handle_file)
119 raise error 117 raise error
OLDNEW
« no previous file with comments | « tools/dom/scripts/monitored.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698