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

Side by Side Diff: chrome/common/extensions/docs/server2/api_models.py

Issue 1151283007: Docserver overhaul: Gitiles away from me. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 posixpath 5 import posixpath
6 6
7 from compiled_file_system import Cache, SingleFile, Unicode 7 from compiled_file_system import Cache, SingleFile, Unicode
8 from extensions_paths import API_PATHS 8 from extensions_paths import API_PATHS
9 from features_bundle import HasParent, GetParentName 9 from features_bundle import HasParent, GetParentName
10 from file_system import FileNotFoundError 10 from file_system import FileNotFoundError
(...skipping 24 matching lines...) Expand all
35 self.name = name 35 self.name = name
36 self.restrictedTo = None 36 self.restrictedTo = None
37 37
38 def __eq__(self, o): 38 def __eq__(self, o):
39 return self.name == o.name and self.restrictedTo == o.restrictedTo 39 return self.name == o.name and self.restrictedTo == o.restrictedTo
40 40
41 def __ne__(self, o): 41 def __ne__(self, o):
42 return not (self == o) 42 return not (self == o)
43 43
44 def __repr__(self): 44 def __repr__(self):
45 return '<ContentScriptAPI name=%s, restrictedTo=%s>' % (name, restrictedTo) 45 return ('<ContentScriptAPI name=%s, restrictedTo=%s>' %
46 (self.name, self.restrictedTo))
Ken Rockot(use gerrit already) 2015/05/26 00:26:23 This is just a drive-by bugfix caught while hackin
46 47
47 def __str__(self): 48 def __str__(self):
48 return repr(self) 49 return repr(self)
49 50
50 51
51 class APIModels(object): 52 class APIModels(object):
52 '''Tracks APIs and their Models. 53 '''Tracks APIs and their Models.
53 ''' 54 '''
54 55
55 def __init__(self, 56 def __init__(self,
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 178
178 def IterModels(self): 179 def IterModels(self):
179 future_models = [(name, self.GetModel(name)) for name in self.GetNames()] 180 future_models = [(name, self.GetModel(name)) for name in self.GetNames()]
180 for name, future_model in future_models: 181 for name, future_model in future_models:
181 try: 182 try:
182 model = future_model.Get() 183 model = future_model.Get()
183 except FileNotFoundError: 184 except FileNotFoundError:
184 continue 185 continue
185 if model: 186 if model:
186 yield name, model 187 yield name, model
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698