Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import copy | 5 import copy |
| 6 import hashlib | 6 import hashlib |
| 7 import json | 7 import json |
| 8 import string | 8 import string |
| 9 import sys | 9 import sys |
| 10 import urllib2 | 10 import urllib2 |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 new_bundle.CopyFrom(b) | 536 new_bundle.CopyFrom(b) |
| 537 bundles.append(new_bundle) | 537 bundles.append(new_bundle) |
| 538 self._manifest_data[key] = bundles | 538 self._manifest_data[key] = bundles |
| 539 else: | 539 else: |
| 540 self._manifest_data[key] = value | 540 self._manifest_data[key] = value |
| 541 self.Validate(add_missing_info) | 541 self.Validate(add_missing_info) |
| 542 | 542 |
| 543 def __str__(self): | 543 def __str__(self): |
| 544 return self.GetDataAsString() | 544 return self.GetDataAsString() |
| 545 | 545 |
| 546 def __eq__(self, other): | |
| 547 # Access to protected member _manifest_data of a client class | |
| 548 # pylint: disable=W0212 | |
| 549 if (self._manifest_data['manifest_version'] != | |
| 550 other._manifest_data['manifest_version']): | |
| 551 return False | |
| 552 | |
| 553 self_bundle_names = set([b.name for b in self.GetBundles()]) | |
| 554 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.
| |
| 555 if self_bundle_names != other_bundle_names: | |
| 556 return False | |
| 557 | |
| 558 for bundle_name in self_bundle_names: | |
| 559 if self.GetBundle(bundle_name) != other.GetBundle(bundle_name): | |
| 560 return False | |
| 561 | |
| 562 return True | |
| 563 | |
| 564 def __ne__(self, other): | |
| 565 return not (self == other) | |
| 566 | |
| 546 def GetDataAsString(self): | 567 def GetDataAsString(self): |
| 547 """Returns the current JSON manifest object, pretty-printed""" | 568 """Returns the current JSON manifest object, pretty-printed""" |
| 548 return DictToJSON(self._manifest_data) | 569 return DictToJSON(self._manifest_data) |
| OLD | NEW |