| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import fnmatch | 5 import fnmatch |
| 6 import imp | 6 import imp |
| 7 import logging | 7 import logging |
| 8 import modulefinder | 8 import modulefinder |
| 9 import optparse | 9 import optparse |
| 10 import os | 10 import os |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 parser = optparse.OptionParser() | 72 parser = optparse.OptionParser() |
| 73 test_obj.AddCommandLineArgs(parser, None) | 73 test_obj.AddCommandLineArgs(parser, None) |
| 74 options = optparse.Values() | 74 options = optparse.Values() |
| 75 for k, v in parser.get_default_values().__dict__.iteritems(): | 75 for k, v in parser.get_default_values().__dict__.iteritems(): |
| 76 options.ensure_value(k, v) | 76 options.ensure_value(k, v) |
| 77 | 77 |
| 78 # Page set paths are relative to their runner script, not relative to us. | 78 # Page set paths are relative to their runner script, not relative to us. |
| 79 path.GetBaseDir = lambda: base_dir | 79 path.GetBaseDir = lambda: base_dir |
| 80 # TODO: Loading the page set will automatically download its Cloud Storage | 80 # TODO: Loading the page set will automatically download its Cloud Storage |
| 81 # deps. This is really expensive, and we don't want to do this by default. | 81 # deps. This is really expensive, and we don't want to do this by default. |
| 82 page_set = test_obj.CreatePageSet(options) | 82 story_set = test_obj.CreateStorySet(options) |
| 83 | 83 |
| 84 # Add all of its serving_dirs as dependencies. | 84 # Add all of its serving_dirs as dependencies. |
| 85 for serving_dir in page_set.serving_dirs: | 85 for serving_dir in story_set.serving_dirs: |
| 86 yield serving_dir | 86 yield serving_dir |
| 87 | 87 |
| 88 | 88 |
| 89 def FindExcludedFiles(files, options): | 89 def FindExcludedFiles(files, options): |
| 90 # Define some filters for files. | 90 # Define some filters for files. |
| 91 def IsHidden(path_string): | 91 def IsHidden(path_string): |
| 92 for pathname_component in path_string.split(os.sep): | 92 for pathname_component in path_string.split(os.sep): |
| 93 if pathname_component.startswith('.'): | 93 if pathname_component.startswith('.'): |
| 94 return True | 94 return True |
| 95 return False | 95 return False |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 def Run(self, args): | 244 def Run(self, args): |
| 245 target_paths = args.positional_args | 245 target_paths = args.positional_args |
| 246 dependencies = FindDependencies(target_paths, args) | 246 dependencies = FindDependencies(target_paths, args) |
| 247 if args.zip: | 247 if args.zip: |
| 248 ZipDependencies(target_paths, dependencies, args) | 248 ZipDependencies(target_paths, dependencies, args) |
| 249 print 'Zip archive written to %s.' % args.zip | 249 print 'Zip archive written to %s.' % args.zip |
| 250 else: | 250 else: |
| 251 print '\n'.join(sorted(dependencies)) | 251 print '\n'.join(sorted(dependencies)) |
| 252 return 0 | 252 return 0 |
| OLD | NEW |