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

Unified Diff: native_client_sdk/src/build_tools/manifest_util.py

Issue 11421138: [NaCl SDK] update_nacl_manifest: Allow manual updating of a version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/tests/test_update_nacl_manifest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/build_tools/manifest_util.py
diff --git a/native_client_sdk/src/build_tools/manifest_util.py b/native_client_sdk/src/build_tools/manifest_util.py
index 1e055d71c22a244bd772a0cca2fa0fa1d497d6f9..478d7c3b5ec79d8976fef686dd8a2bf66e05d670 100644
--- a/native_client_sdk/src/build_tools/manifest_util.py
+++ b/native_client_sdk/src/build_tools/manifest_util.py
@@ -543,6 +543,27 @@ class SDKManifest(object):
def __str__(self):
return self.GetDataAsString()
+ def __eq__(self, other):
+ # Access to protected member _manifest_data of a client class
+ # pylint: disable=W0212
+ if (self._manifest_data['manifest_version'] !=
+ other._manifest_data['manifest_version']):
+ return False
+
+ self_bundle_names = set(b.name for b in self.GetBundles())
+ other_bundle_names = set(b.name for b in other.GetBundles())
+ if self_bundle_names != other_bundle_names:
+ return False
+
+ for bundle_name in self_bundle_names:
+ if self.GetBundle(bundle_name) != other.GetBundle(bundle_name):
+ return False
+
+ return True
+
+ def __ne__(self, other):
+ return not (self == other)
+
def GetDataAsString(self):
"""Returns the current JSON manifest object, pretty-printed"""
return DictToJSON(self._manifest_data)
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/tests/test_update_nacl_manifest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698