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

Side by Side Diff: build/android/adb_profile_chrome.py

Issue 27319002: android: Actually compress traces written to zip files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | « no previous file | no next file » | 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/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import gzip 7 import gzip
8 import logging 8 import logging
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 177
178 def _CompressFile(host_file, output): 178 def _CompressFile(host_file, output):
179 with gzip.open(output, 'wb') as out: 179 with gzip.open(output, 'wb') as out:
180 with open(host_file, 'rb') as input_file: 180 with open(host_file, 'rb') as input_file:
181 out.write(input_file.read()) 181 out.write(input_file.read())
182 os.unlink(host_file) 182 os.unlink(host_file)
183 183
184 184
185 def _ArchiveFiles(host_files, output): 185 def _ArchiveFiles(host_files, output):
186 with zipfile.ZipFile(output, 'w') as z: 186 with zipfile.ZipFile(output, 'w', zipfile.ZIP_DEFLATED) as z:
187 for host_file in host_files: 187 for host_file in host_files:
188 z.write(host_file) 188 z.write(host_file)
189 os.unlink(host_file) 189 os.unlink(host_file)
190 190
191 191
192 def _PrintMessage(heading, eol='\n'): 192 def _PrintMessage(heading, eol='\n'):
193 sys.stdout.write('%s%s' % (heading, eol)) 193 sys.stdout.write('%s%s' % (heading, eol))
194 sys.stdout.flush() 194 sys.stdout.flush()
195 195
196 196
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 return 1 351 return 1
352 352
353 _CaptureAndPullTrace(controllers, 353 _CaptureAndPullTrace(controllers,
354 options.time if not options.continuous else 0, 354 options.time if not options.continuous else 0,
355 options.output, 355 options.output,
356 options.compress) 356 options.compress)
357 357
358 358
359 if __name__ == '__main__': 359 if __name__ == '__main__':
360 sys.exit(main()) 360 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698