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 def Info(manifest, bundle_names): |
| 9 valid_bundles = [bundle.name for bundle in manifest.GetBundles()] |
| 10 valid_bundles = set(bundle_names) & set(valid_bundles) |
| 11 invalid_bundles = set(bundle_names) - valid_bundles |
| 12 if invalid_bundles: |
| 13 logging.warn('Unknown bundle(s): %s\n' % (', '.join(invalid_bundles))) |
| 14 |
| 15 for bundle_name in bundle_names: |
| 16 if bundle_name not in valid_bundles: |
| 17 continue |
| 18 |
| 19 bundle = manifest.GetBundle(bundle_name) |
| 20 |
| 21 print bundle.name |
| 22 for key in sorted(bundle.iterkeys()): |
| 23 value = bundle[key] |
| 24 if key == manifest_util.ARCHIVES_KEY: |
| 25 archive = bundle.GetHostOSArchive() |
| 26 print ' Archive:' |
| 27 if archive: |
| 28 for archive_key in sorted(archive.iterkeys()): |
| 29 print ' %s: %s' % (archive_key, archive[archive_key]) |
| 30 else: |
| 31 print ' No archives for this host.' |
| 32 elif key not in (manifest_util.ARCHIVES_KEY, manifest_util.NAME_KEY): |
| 33 print ' %s: %s' % (key, value) |
| 34 print |
OLD | NEW |