Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: native_client_sdk/src/build_tools/sdk_tools/commands/info.py

Issue 11228013: [NaCl SDK] Refactor sdk_update*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests pass Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
9 def Info(manifest, bundle_names):
10 valid_bundles = [bundle.name for bundle in manifest.GetBundles()]
11 valid_bundles = set(bundle_names) & set(valid_bundles)
12 invalid_bundles = set(bundle_names) - valid_bundles
13 if invalid_bundles:
14 logging.warn('Unknown bundle(s): %s\n' % (', '.join(invalid_bundles)))
15
16 for bundle_name in bundle_names:
17 if bundle_name not in valid_bundles:
18 continue
19
20 bundle = manifest.GetBundle(bundle_name)
21
22 print bundle.name
23 for key, value in bundle.iteritems():
24 if key == manifest_util.ARCHIVES_KEY:
25 archive = bundle.GetHostOSArchive()
26 print ' Archive:'
27 if archive:
28 for archive_key, archive_value in archive.iteritems():
29 print ' %s: %s' % (archive_key, archive_value)
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698