Chromium Code Reviews| 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..98904aa32b7ff9a5f1c94abe701713e65192a614 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()]) |
|
Sam Clegg
2012/11/29 19:39:10
You can drop the square brackets in these kind of
binji
2012/11/30 18:55:00
Done.
|
| + 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) |