OLD | NEW |
1 #!/usr/bin/python | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 | |
3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
4 # 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 |
5 # found in the LICENSE file. | 3 # found in the LICENSE file. |
6 | 4 |
7 """BookmarkModel: python representation of the bookmark model. | 5 """BookmarkModel: python representation of the bookmark model. |
8 | 6 |
9 Obtain one of these from PyUITestSuite::GetBookmarkModel() call. | 7 Obtain one of these from PyUITestSuite::GetBookmarkModel() call. |
10 """ | 8 """ |
11 | 9 |
12 import os | 10 import os |
13 import simplejson as json | 11 import simplejson as json |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 # their kids. | 90 # their kids. |
93 results = [] | 91 results = [] |
94 for node in nodes: | 92 for node in nodes: |
95 node_title = node.get('title', None) or node.get('name', None) | 93 node_title = node.get('title', None) or node.get('name', None) |
96 if title == node_title: | 94 if title == node_title: |
97 results.append(node) | 95 results.append(node) |
98 # Note we check everything; unlike the FindByID, we do not stop early. | 96 # Note we check everything; unlike the FindByID, we do not stop early. |
99 for child in node.get('children', []): | 97 for child in node.get('children', []): |
100 results += self.FindByTitle(title, [child]) | 98 results += self.FindByTitle(title, [child]) |
101 return results | 99 return results |
OLD | NEW |