Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 import logging | |
| 6 import manifest_util | |
| 7 | |
| 8 __all__ = ['Info'] | |
|
noelallen1
2012/10/29 23:11:30
What is this exactly?
binji
2012/10/29 23:51:18
Removed.
| |
| 9 | |
| 10 def Info(manifest, bundle_names): | |
| 11 valid_bundles = [bundle.name for bundle in manifest.GetBundles()] | |
| 12 valid_bundles = set(bundle_names) & set(valid_bundles) | |
| 13 invalid_bundles = set(bundle_names) - valid_bundles | |
| 14 if invalid_bundles: | |
| 15 logging.warn('Unknown bundle(s): %s\n' % (', '.join(invalid_bundles))) | |
| 16 | |
| 17 for bundle_name in bundle_names: | |
| 18 if bundle_name not in valid_bundles: | |
| 19 continue | |
| 20 | |
| 21 bundle = manifest.GetBundle(bundle_name) | |
| 22 | |
| 23 print bundle.name | |
| 24 for key, value in bundle.iteritems(): | |
|
noelallen1
2012/10/29 23:11:30
Shouldn't these be sorted somehow?
binji
2012/10/29 23:51:18
Done.
| |
| 25 if key == manifest_util.ARCHIVES_KEY: | |
| 26 archive = bundle.GetHostOSArchive() | |
| 27 print ' Archive:' | |
| 28 if archive: | |
| 29 for archive_key, archive_value in archive.iteritems(): | |
|
noelallen1
2012/10/29 23:11:30
You print all archives if one is found for this ho
binji
2012/10/29 23:51:18
That's not quite right. I print all members of the
| |
| 30 print ' %s: %s' % (archive_key, archive_value) | |
| 31 else: | |
| 32 print ' No archives for this host.' | |
| 33 elif key not in (manifest_util.ARCHIVES_KEY, manifest_util.NAME_KEY): | |
| 34 print ' %s: %s' % (key, value) | |
| 35 print | |
| OLD | NEW |