Chromium Code Reviews| Index: native_client_sdk/src/build_tools/sdk_tools/commands/info.py |
| diff --git a/native_client_sdk/src/build_tools/sdk_tools/commands/info.py b/native_client_sdk/src/build_tools/sdk_tools/commands/info.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6d9d60bc52e6d55fdfd0e3df184dff40b5edfb31 |
| --- /dev/null |
| +++ b/native_client_sdk/src/build_tools/sdk_tools/commands/info.py |
| @@ -0,0 +1,35 @@ |
| +# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import logging |
| +import manifest_util |
| + |
| +__all__ = ['Info'] |
|
noelallen1
2012/10/29 23:11:30
What is this exactly?
binji
2012/10/29 23:51:18
Removed.
|
| + |
| +def Info(manifest, bundle_names): |
| + valid_bundles = [bundle.name for bundle in manifest.GetBundles()] |
| + valid_bundles = set(bundle_names) & set(valid_bundles) |
| + invalid_bundles = set(bundle_names) - valid_bundles |
| + if invalid_bundles: |
| + logging.warn('Unknown bundle(s): %s\n' % (', '.join(invalid_bundles))) |
| + |
| + for bundle_name in bundle_names: |
| + if bundle_name not in valid_bundles: |
| + continue |
| + |
| + bundle = manifest.GetBundle(bundle_name) |
| + |
| + print bundle.name |
| + 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.
|
| + if key == manifest_util.ARCHIVES_KEY: |
| + archive = bundle.GetHostOSArchive() |
| + print ' Archive:' |
| + if archive: |
| + 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
|
| + print ' %s: %s' % (archive_key, archive_value) |
| + else: |
| + print ' No archives for this host.' |
| + elif key not in (manifest_util.ARCHIVES_KEY, manifest_util.NAME_KEY): |
| + print ' %s: %s' % (key, value) |