OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Archives or replays webpages and creates SKPs in a Google Storage location. | 6 """Archives or replays webpages and creates SKPs in a Google Storage location. |
7 | 7 |
8 To archive webpages and store SKP files (archives should be rarely updated): | 8 To archive webpages and store SKP files (archives should be rarely updated): |
9 | 9 |
10 cd skia | 10 cd skia |
11 python tools/skp/webpages_playback.py --dest_gsbase=gs://rmistry --record \ | 11 python tools/skp/webpages_playback.py --data_store=gs://rmistry --record \ |
12 --page_sets=all --skia_tools=/home/default/trunk/out/Debug/ \ | 12 --page_sets=all --skia_tools=/home/default/trunk/out/Debug/ \ |
13 --browser_executable=/tmp/chromium/out/Release/chrome | 13 --browser_executable=/tmp/chromium/out/Release/chrome |
14 | 14 |
15 The above command uses Google Storage bucket 'rmistry' to download needed files. | |
15 | 16 |
16 To replay archived webpages and re-generate SKP files (should be run whenever | 17 To replay archived webpages and re-generate SKP files (should be run whenever |
17 SkPicture.PICTURE_VERSION changes): | 18 SkPicture.PICTURE_VERSION changes): |
18 | 19 |
19 cd skia | 20 cd skia |
20 python tools/skp/webpages_playback.py --dest_gsbase=gs://rmistry \ | 21 python tools/skp/webpages_playback.py --data_store=gs://rmistry \ |
21 --page_sets=all --skia_tools=/home/default/trunk/out/Debug/ \ | 22 --page_sets=all --skia_tools=/home/default/trunk/out/Debug/ \ |
22 --browser_executable=/tmp/chromium/out/Release/chrome | 23 --browser_executable=/tmp/chromium/out/Release/chrome |
23 | 24 |
24 | 25 |
25 Specify the --page_sets flag (default value is 'all') to pick a list of which | 26 Specify the --page_sets flag (default value is 'all') to pick a list of which |
26 webpages should be archived and/or replayed. Eg: | 27 webpages should be archived and/or replayed. Eg: |
27 | 28 |
28 --page_sets=tools/skp/page_sets/skia_yahooanswers_desktop.py,\ | 29 --page_sets=tools/skp/page_sets/skia_yahooanswers_desktop.py,\ |
29 tools/skp/page_sets/skia_googlecalendar_nexus10.py | 30 tools/skp/page_sets/skia_googlecalendar_nexus10.py |
30 | 31 |
31 The --browser_executable flag should point to the browser binary you want to use | 32 The --browser_executable flag should point to the browser binary you want to use |
32 to capture archives and/or capture SKP files. Majority of the time it should be | 33 to capture archives and/or capture SKP files. Majority of the time it should be |
33 a newly built chrome binary. | 34 a newly built chrome binary. |
34 | 35 |
35 The --upload_to_gs flag controls whether generated artifacts will be uploaded | 36 The --data_store flag controls where the needed artifacts, such as |
36 to Google Storage (default value is False if not specified). | 37 credential files, are downloaded from. It also controls where the |
38 generated artifacts, such as recorded webpages and resulting skp renderings, | |
39 are uploaded to. URLs with scheme 'gs://' use Google Storage. Otherwise | |
40 use local filesystem. | |
41 | |
42 The --upload=True flag means generated artifacts will be | |
43 uploaded or copied to the location specified by --data_store. (default value is | |
44 False if not specified). | |
37 | 45 |
38 The --non-interactive flag controls whether the script will prompt the user | 46 The --non-interactive flag controls whether the script will prompt the user |
39 (default value is False if not specified). | 47 (default value is False if not specified). |
40 | 48 |
41 The --skia_tools flag if specified will allow this script to run | 49 The --skia_tools flag if specified will allow this script to run |
42 debugger, render_pictures, and render_pdfs on the captured | 50 debugger, render_pictures, and render_pdfs on the captured |
43 SKP(s). The tools are run after all SKPs are succesfully captured to make sure | 51 SKP(s). The tools are run after all SKPs are succesfully captured to make sure |
44 they can be added to the buildbots with no breakages. | 52 they can be added to the buildbots with no breakages. |
45 """ | 53 """ |
46 | 54 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 """Class that archives or replays webpages and creates SKPs.""" | 124 """Class that archives or replays webpages and creates SKPs.""" |
117 | 125 |
118 def __init__(self, parse_options): | 126 def __init__(self, parse_options): |
119 """Constructs a SkPicturePlayback BuildStep instance.""" | 127 """Constructs a SkPicturePlayback BuildStep instance.""" |
120 assert parse_options.browser_executable, 'Must specify --browser_executable' | 128 assert parse_options.browser_executable, 'Must specify --browser_executable' |
121 self._browser_executable = parse_options.browser_executable | 129 self._browser_executable = parse_options.browser_executable |
122 | 130 |
123 self._all_page_sets_specified = parse_options.page_sets == 'all' | 131 self._all_page_sets_specified = parse_options.page_sets == 'all' |
124 self._page_sets = self._ParsePageSets(parse_options.page_sets) | 132 self._page_sets = self._ParsePageSets(parse_options.page_sets) |
125 | 133 |
126 self._dest_gsbase = parse_options.dest_gsbase | |
127 self._record = parse_options.record | 134 self._record = parse_options.record |
128 self._skia_tools = parse_options.skia_tools | 135 self._skia_tools = parse_options.skia_tools |
129 self._non_interactive = parse_options.non_interactive | 136 self._non_interactive = parse_options.non_interactive |
130 self._upload_to_gs = parse_options.upload_to_gs | 137 self._upload = parse_options.upload |
138 data_store_location = parse_options.data_store | |
139 if data_store_location.startswith(gs_utils.GS_PREFIX): | |
140 self.gs = GSWithBucket(data_store_location) | |
141 else: | |
142 self.gs = GSFileEmulation(data_store_location) | |
131 self._alternate_upload_dir = parse_options.alternate_upload_dir | 143 self._alternate_upload_dir = parse_options.alternate_upload_dir |
132 self._skip_all_gs_access = parse_options.skip_all_gs_access | |
133 self._telemetry_binaries_dir = os.path.join(parse_options.chrome_src_path, | 144 self._telemetry_binaries_dir = os.path.join(parse_options.chrome_src_path, |
134 'tools', 'perf') | 145 'tools', 'perf') |
135 | 146 |
136 self._local_skp_dir = os.path.join( | 147 self._local_skp_dir = os.path.join( |
137 parse_options.output_dir, ROOT_PLAYBACK_DIR_NAME, SKPICTURES_DIR_NAME) | 148 parse_options.output_dir, ROOT_PLAYBACK_DIR_NAME, SKPICTURES_DIR_NAME) |
138 self._local_record_webpages_archive_dir = os.path.join( | 149 self._local_record_webpages_archive_dir = os.path.join( |
139 parse_options.output_dir, ROOT_PLAYBACK_DIR_NAME, 'webpages_archive') | 150 parse_options.output_dir, ROOT_PLAYBACK_DIR_NAME, 'webpages_archive') |
140 | 151 |
141 # List of SKP files generated by this script. | 152 # List of SKP files generated by this script. |
142 self._skp_files = [] | 153 self._skp_files = [] |
(...skipping 14 matching lines...) Expand all Loading... | |
157 ps = glob.glob(page_sets) | 168 ps = glob.glob(page_sets) |
158 else: | 169 else: |
159 ps = page_sets.split(',') | 170 ps = page_sets.split(',') |
160 ps.sort() | 171 ps.sort() |
161 return ps | 172 return ps |
162 | 173 |
163 def Run(self): | 174 def Run(self): |
164 """Run the SkPicturePlayback BuildStep.""" | 175 """Run the SkPicturePlayback BuildStep.""" |
165 | 176 |
166 # Download the credentials file if it was not previously downloaded. | 177 # Download the credentials file if it was not previously downloaded. |
167 if self._skip_all_gs_access: | 178 if not os.path.isfile(CREDENTIALS_FILE_PATH): |
168 print """\n\nPlease create a %s file that contains: | 179 # Download the credentials.json file from Google Storage. |
180 self.gs.download_file(CREDENTIALS_GS_PATH, CREDENTIALS_FILE_PATH) | |
181 | |
182 if not os.path.isfile(CREDENTIALS_FILE_PATH): | |
183 print """\n\nCould not locate credentials file in the storage. | |
184 Please create a %s file that contains: | |
169 { | 185 { |
170 "google": { | 186 "google": { |
171 "username": "google_testing_account_username", | 187 "username": "google_testing_account_username", |
172 "password": "google_testing_account_password" | 188 "password": "google_testing_account_password" |
173 }, | 189 }, |
174 "facebook": { | 190 "facebook": { |
175 "username": "facebook_testing_account_username", | 191 "username": "facebook_testing_account_username", |
176 "password": "facebook_testing_account_password" | 192 "password": "facebook_testing_account_password" |
177 } | 193 } |
178 }\n\n""" % CREDENTIALS_FILE_PATH | 194 }\n\n""" % CREDENTIALS_FILE_PATH |
179 raw_input("Please press a key when you are ready to proceed...") | 195 raw_input("Please press a key when you are ready to proceed...") |
180 elif not os.path.isfile(CREDENTIALS_FILE_PATH): | |
181 # Download the credentials.json file from Google Storage. | |
182 gs_bucket = remove_prefix(self._dest_gsbase.lstrip(), gs_utils.GS_PREFIX) | |
183 gs_utils.GSUtils().download_file(gs_bucket, CREDENTIALS_GS_PATH, | |
184 CREDENTIALS_FILE_PATH) | |
185 | 196 |
186 # Delete any left over data files in the data directory. | 197 # Delete any left over data files in the data directory. |
187 for archive_file in glob.glob( | 198 for archive_file in glob.glob( |
188 os.path.join(LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR, 'skia_*')): | 199 os.path.join(LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR, 'skia_*')): |
189 os.remove(archive_file) | 200 os.remove(archive_file) |
190 | 201 |
191 # Delete the local root directory if it already exists. | 202 # Delete the local root directory if it already exists. |
192 if os.path.exists(LOCAL_PLAYBACK_ROOT_DIR): | 203 if os.path.exists(LOCAL_PLAYBACK_ROOT_DIR): |
193 shutil.rmtree(LOCAL_PLAYBACK_ROOT_DIR) | 204 shutil.rmtree(LOCAL_PLAYBACK_ROOT_DIR) |
194 | 205 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 break | 237 break |
227 except Exception: | 238 except Exception: |
228 # There was a failure continue with the loop. | 239 # There was a failure continue with the loop. |
229 traceback.print_exc() | 240 traceback.print_exc() |
230 else: | 241 else: |
231 # If we get here then record_wpr did not succeed and thus did not | 242 # If we get here then record_wpr did not succeed and thus did not |
232 # break out of the loop. | 243 # break out of the loop. |
233 raise Exception('record_wpr failed for page_set: %s' % page_set) | 244 raise Exception('record_wpr failed for page_set: %s' % page_set) |
234 | 245 |
235 else: | 246 else: |
236 if not self._skip_all_gs_access: | 247 # Get the webpages archive so that it can be replayed. |
237 # Get the webpages archive so that it can be replayed. | 248 self._DownloadWebpagesArchive(wpr_data_file, page_set_json_name) |
238 self._DownloadWebpagesArchive(wpr_data_file, page_set_json_name) | |
239 | 249 |
240 run_benchmark_cmd = ( | 250 run_benchmark_cmd = ( |
241 'PYTHONPATH=%s:$PYTHONPATH' % page_set_dir, | 251 'PYTHONPATH=%s:$PYTHONPATH' % page_set_dir, |
242 'DISPLAY=%s' % X11_DISPLAY, | 252 'DISPLAY=%s' % X11_DISPLAY, |
243 'timeout', '300', | 253 'timeout', '300', |
244 os.path.join(self._telemetry_binaries_dir, 'run_benchmark'), | 254 os.path.join(self._telemetry_binaries_dir, 'run_benchmark'), |
245 '--extra-browser-args=--disable-setuid-sandbox', | 255 '--extra-browser-args=--disable-setuid-sandbox', |
246 '--browser=exact', | 256 '--browser=exact', |
247 '--browser-executable=%s' % self._browser_executable, | 257 '--browser-executable=%s' % self._browser_executable, |
248 SKP_BENCHMARK, | 258 SKP_BENCHMARK, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
307 if code != 0: | 317 if code != 0: |
308 raise Exception('%s failed!' % ' '.join(tools_cmd)) | 318 raise Exception('%s failed!' % ' '.join(tools_cmd)) |
309 | 319 |
310 if not self._non_interactive: | 320 if not self._non_interactive: |
311 print '\n\n=======Running debugger=======' | 321 print '\n\n=======Running debugger=======' |
312 os.system('%s %s' % (os.path.join(self._skia_tools, 'debugger'), | 322 os.system('%s %s' % (os.path.join(self._skia_tools, 'debugger'), |
313 self._local_skp_dir)) | 323 self._local_skp_dir)) |
314 | 324 |
315 print '\n\n' | 325 print '\n\n' |
316 | 326 |
317 if not self._skip_all_gs_access and self._upload_to_gs: | 327 if self._upload: |
318 print '\n\n=======Uploading to Google Storage=======\n\n' | 328 print '\n\n=======Uploading to %s=======\n\n' % self.gs.target_type() |
319 # Copy the directory structure in the root directory into Google Storage. | 329 # Copy the directory structure in the root directory into Google Storage. |
320 dest_dir_name = ROOT_PLAYBACK_DIR_NAME | 330 dest_dir_name = ROOT_PLAYBACK_DIR_NAME |
321 if self._alternate_upload_dir: | 331 if self._alternate_upload_dir: |
322 dest_dir_name = self._alternate_upload_dir | 332 dest_dir_name = self._alternate_upload_dir |
323 | 333 |
324 gs_bucket = remove_prefix(self._dest_gsbase.lstrip(), gs_utils.GS_PREFIX) | 334 self.gs.upload_dir_contents( |
325 gs_utils.GSUtils().upload_dir_contents( | 335 LOCAL_PLAYBACK_ROOT_DIR, dest_dir_name, |
326 LOCAL_PLAYBACK_ROOT_DIR, gs_bucket, dest_dir_name, | |
327 upload_if=gs_utils.GSUtils.UploadIf.IF_MODIFIED, | 336 upload_if=gs_utils.GSUtils.UploadIf.IF_MODIFIED, |
328 predefined_acl=GS_PREDEFINED_ACL, | 337 predefined_acl=GS_PREDEFINED_ACL, |
329 fine_grained_acl_list=GS_FINE_GRAINED_ACL_LIST) | 338 fine_grained_acl_list=GS_FINE_GRAINED_ACL_LIST) |
330 | 339 |
331 print '\n\n=======New SKPs have been uploaded to %s =======\n\n' % ( | 340 print '\n\n=======New SKPs have been uploaded to %s =======\n\n' % ( |
332 posixpath.join(self._dest_gsbase, dest_dir_name, SKPICTURES_DIR_NAME)) | 341 posixpath.join(self.gs.target_name(), dest_dir_name, |
342 SKPICTURES_DIR_NAME)) | |
333 else: | 343 else: |
334 print '\n\n=======Not Uploading to Google Storage=======\n\n' | 344 print '\n\n=======Not Uploading to %s=======\n\n' % self.gs.target_type() |
335 print 'Generated resources are available in %s\n\n' % ( | 345 print 'Generated resources are available in %s\n\n' % ( |
336 LOCAL_PLAYBACK_ROOT_DIR) | 346 LOCAL_PLAYBACK_ROOT_DIR) |
337 | 347 |
338 return 0 | 348 return 0 |
339 | 349 |
340 def _RenameSkpFiles(self, page_set): | 350 def _RenameSkpFiles(self, page_set): |
341 """Rename generated SKP files into more descriptive names. | 351 """Rename generated SKP files into more descriptive names. |
342 | 352 |
343 Look into the subdirectory of TMP_SKP_DIR and find the most interesting | 353 Look into the subdirectory of TMP_SKP_DIR and find the most interesting |
344 .skp in there to be this page_set's representative .skp. | 354 .skp in there to be this page_set's representative .skp. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
376 shutil.rmtree(d) | 386 shutil.rmtree(d) |
377 os.makedirs(d) | 387 os.makedirs(d) |
378 | 388 |
379 def _DownloadWebpagesArchive(self, wpr_data_file, page_set_json_name): | 389 def _DownloadWebpagesArchive(self, wpr_data_file, page_set_json_name): |
380 """Downloads the webpages archive and its required page set from GS.""" | 390 """Downloads the webpages archive and its required page set from GS.""" |
381 wpr_source = posixpath.join(ROOT_PLAYBACK_DIR_NAME, 'webpages_archive', | 391 wpr_source = posixpath.join(ROOT_PLAYBACK_DIR_NAME, 'webpages_archive', |
382 wpr_data_file) | 392 wpr_data_file) |
383 page_set_source = posixpath.join(ROOT_PLAYBACK_DIR_NAME, | 393 page_set_source = posixpath.join(ROOT_PLAYBACK_DIR_NAME, |
384 'webpages_archive', | 394 'webpages_archive', |
385 page_set_json_name) | 395 page_set_json_name) |
386 gs = gs_utils.GSUtils() | 396 gs = self.gs |
387 gs_bucket = remove_prefix(self._dest_gsbase.lstrip(), gs_utils.GS_PREFIX) | 397 if (gs.does_storage_object_exist(wpr_source) and |
388 if (gs.does_storage_object_exist(gs_bucket, wpr_source) and | 398 gs.does_storage_object_exist(page_set_source)): |
389 gs.does_storage_object_exist(gs_bucket, page_set_source)): | 399 gs.download_file(wpr_source, |
390 gs.download_file(gs_bucket, wpr_source, | |
391 os.path.join(LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR, | 400 os.path.join(LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR, |
392 wpr_data_file)) | 401 wpr_data_file)) |
393 gs.download_file(gs_bucket, page_set_source, | 402 gs.download_file(page_set_source, |
394 os.path.join(LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR, | 403 os.path.join(LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR, |
395 page_set_json_name)) | 404 page_set_json_name)) |
396 else: | 405 else: |
397 raise Exception('%s and %s do not exist in Google Storage!' % ( | 406 raise Exception('%s and %s do not exist in %s!' % (gs.target_type(), |
398 wpr_source, page_set_source)) | 407 wpr_source, page_set_source)) |
399 | 408 |
409 class GSWithBucket: | |
rmistry
2014/12/29 12:28:59
The following is just a suggestion let me know if
| |
410 def __init__(self, data_store_url): | |
411 self._data_store_url = data_store_url | |
412 self._bucket = remove_prefix(self._data_store_url.lstrip(), | |
413 gs_utils.GS_PREFIX) | |
414 self.gs = gs_utils.GSUtils() | |
415 def target_name(self): | |
416 return self._data_store_url; | |
417 def target_type(self): | |
418 return 'Google Storage' | |
419 def does_storage_object_exist(self, *args): | |
420 return self.gs.does_storage_object_exist(self._bucket, *args) | |
421 def download_file(self, *args): | |
422 self.gs.download_file(self._bucket, *args) | |
423 def upload_dir_contents(self, source_dir, **kwargs): | |
424 self.gs.upload_dir_contents(source_dir, self._bucket, **kwargs) | |
425 | |
426 class GSFileEmulation: | |
427 def __init__(self, data_store_location): | |
428 self._base_dir = data_store_location | |
429 def target_name(self): | |
430 return self._base_dir; | |
431 def target_type(self): | |
432 return self._base_dir | |
433 def does_storage_object_exist(self, name): | |
434 return os.path.isfile(os.path.join(self._base_dir, name)) | |
435 def download_file(self, name, local_path): | |
436 shutil.copyfile(os.path.join(self._base_dir, name), local_path) | |
437 def upload_dir_contents(self, source_dir, dest_dir, **kwargs): | |
438 def copytree(source_dir, dest_dir): | |
439 if not os.path.exists(dest_dir): | |
440 os.makedirs(dest_dir) | |
441 for item in os.listdir(source_dir): | |
442 source = os.path.join(source_dir, item) | |
443 dest = os.path.join(dest_dir, item) | |
444 if os.path.isdir(source): | |
445 copytree(source, dest) | |
446 else: | |
447 shutil.copy2(source, dest) | |
448 copytree(source_dir, os.path.join(self._base_dir, dest_dir)) | |
400 | 449 |
401 if '__main__' == __name__: | 450 if '__main__' == __name__: |
402 option_parser = optparse.OptionParser() | 451 option_parser = optparse.OptionParser() |
403 option_parser.add_option( | 452 option_parser.add_option( |
404 '', '--page_sets', | 453 '', '--page_sets', |
405 help='Specifies the page sets to use to archive. Supports globs.', | 454 help='Specifies the page sets to use to archive. Supports globs.', |
406 default='all') | 455 default='all') |
407 option_parser.add_option( | 456 option_parser.add_option( |
408 '', '--skip_all_gs_access', action='store_true', | |
409 help='All Google Storage interactions will be skipped if this flag is ' | |
410 'specified. This is useful for cases where the user does not have ' | |
411 'the required .boto file but would like to generate webpage ' | |
412 'archives and SKPs from the Skia page sets.', | |
413 default=False) | |
414 option_parser.add_option( | |
415 '', '--record', action='store_true', | 457 '', '--record', action='store_true', |
416 help='Specifies whether a new website archive should be created.', | 458 help='Specifies whether a new website archive should be created.', |
417 default=False) | 459 default=False) |
418 option_parser.add_option( | 460 option_parser.add_option( |
419 '', '--dest_gsbase', | |
420 help='gs:// bucket_name, the bucket to upload the file to.', | |
421 default='gs://chromium-skia-gm') | |
422 option_parser.add_option( | |
423 '', '--skia_tools', | 461 '', '--skia_tools', |
424 help=('Path to compiled Skia executable tools. ' | 462 help=('Path to compiled Skia executable tools. ' |
425 'render_pictures/render_pdfs is run on the set ' | 463 'render_pictures/render_pdfs is run on the set ' |
426 'after all SKPs are captured. If the script is run without ' | 464 'after all SKPs are captured. If the script is run without ' |
427 '--non-interactive then the debugger is also run at the end. Debug ' | 465 '--non-interactive then the debugger is also run at the end. Debug ' |
428 'builds are recommended because they seem to catch more failures ' | 466 'builds are recommended because they seem to catch more failures ' |
429 'than Release builds.'), | 467 'than Release builds.'), |
430 default=None) | 468 default=None) |
431 option_parser.add_option( | 469 option_parser.add_option( |
432 '', '--upload_to_gs', action='store_true', | 470 '', '--upload', action='store_true', |
433 help='Does not upload to Google Storage if this is False.', | 471 help=('Uploads to Google Storage or copies to local filesystem storage ' |
472 ' if this is True.'), | |
434 default=False) | 473 default=False) |
435 option_parser.add_option( | 474 option_parser.add_option( |
475 '', '--data_store', | |
476 help=('The location of the file storage to use to download and upload ' | |
477 'files. Can be \'gs://<bucket>\' for Google Storage, or ' | |
478 'a directory for local filesystem storage'), | |
479 default='gs://chromium-skia-gm') | |
480 option_parser.add_option( | |
436 '', '--alternate_upload_dir', | 481 '', '--alternate_upload_dir', |
437 help='Uploads to a different directory in Google Storage if this flag is ' | 482 help= ('Uploads to a different directory in Google Storage or local ' |
438 'specified', | 483 'storage if this flag is specified'), |
439 default=None) | 484 default=None) |
440 option_parser.add_option( | 485 option_parser.add_option( |
441 '', '--output_dir', | 486 '', '--output_dir', |
442 help='Directory where SKPs and webpage archives will be outputted to.', | 487 help=('Temporary directory where SKPs and webpage archives will be ' |
488 'outputted to.'), | |
443 default=tempfile.gettempdir()) | 489 default=tempfile.gettempdir()) |
444 option_parser.add_option( | 490 option_parser.add_option( |
445 '', '--browser_executable', | 491 '', '--browser_executable', |
446 help='The exact browser executable to run.', | 492 help='The exact browser executable to run.', |
447 default=None) | 493 default=None) |
448 option_parser.add_option( | 494 option_parser.add_option( |
449 '', '--chrome_src_path', | 495 '', '--chrome_src_path', |
450 help='Path to the chromium src directory.', | 496 help='Path to the chromium src directory.', |
451 default=None) | 497 default=None) |
452 option_parser.add_option( | 498 option_parser.add_option( |
453 '', '--non-interactive', action='store_true', | 499 '', '--non-interactive', action='store_true', |
454 help='Runs the script without any prompts. If this flag is specified and ' | 500 help='Runs the script without any prompts. If this flag is specified and ' |
455 '--skia_tools is specified then the debugger is not run.', | 501 '--skia_tools is specified then the debugger is not run.', |
456 default=False) | 502 default=False) |
457 options, unused_args = option_parser.parse_args() | 503 options, unused_args = option_parser.parse_args() |
458 | 504 |
459 playback = SkPicturePlayback(options) | 505 playback = SkPicturePlayback(options) |
460 sys.exit(playback.Run()) | 506 sys.exit(playback.Run()) |
OLD | NEW |