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

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

Issue 132203009: Avoid hacking on the case of a typename. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/app.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 logging 6 import logging
7 import os 7 import os
8 8
9 from environment import IsPreviewServer 9 from environment import IsPreviewServer
10 from extensions_paths import ( 10 from extensions_paths import (
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 dst_dict['link'] = self._GetLink(type_.ref_type) 316 dst_dict['link'] = self._GetLink(type_.ref_type)
317 elif type_.property_type == model.PropertyType.ARRAY: 317 elif type_.property_type == model.PropertyType.ARRAY:
318 dst_dict['array'] = self._GenerateType(type_.item_type) 318 dst_dict['array'] = self._GenerateType(type_.item_type)
319 elif type_.property_type == model.PropertyType.ENUM: 319 elif type_.property_type == model.PropertyType.ENUM:
320 dst_dict['enum_values'] = [ 320 dst_dict['enum_values'] = [
321 {'name': value.name, 'description': value.description} 321 {'name': value.name, 'description': value.description}
322 for value in type_.enum_values] 322 for value in type_.enum_values]
323 if len(dst_dict['enum_values']) > 0: 323 if len(dst_dict['enum_values']) > 0:
324 dst_dict['enum_values'][-1]['last'] = True 324 dst_dict['enum_values'][-1]['last'] = True
325 elif type_.instance_of is not None: 325 elif type_.instance_of is not None:
326 dst_dict['simple_type'] = type_.instance_of.lower() 326 dst_dict['simple_type'] = type_.instance_of
327 else: 327 else:
328 dst_dict['simple_type'] = type_.property_type.name.lower() 328 dst_dict['simple_type'] = type_.property_type.name
329 329
330 def _GetIntroTableList(self): 330 def _GetIntroTableList(self):
331 '''Create a generic data structure that can be traversed by the templates 331 '''Create a generic data structure that can be traversed by the templates
332 to create an API intro table. 332 to create an API intro table.
333 ''' 333 '''
334 intro_rows = [ 334 intro_rows = [
335 self._GetIntroDescriptionRow(), 335 self._GetIntroDescriptionRow(),
336 self._GetIntroAvailabilityRow() 336 self._GetIntroAvailabilityRow()
337 ] + self._GetIntroDependencyRows() 337 ] + self._GetIntroDependencyRows()
338 338
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 # anything. Don't do it. 560 # anything. Don't do it.
561 if not IsPreviewServer(): 561 if not IsPreviewServer():
562 handlebar_dict['samples'] = _LazySamplesGetter( 562 handlebar_dict['samples'] = _LazySamplesGetter(
563 handlebar_dict['name'], 563 handlebar_dict['name'],
564 self._samples) 564 self._samples)
565 return handlebar_dict 565 return handlebar_dict
566 566
567 def get(self, api_name, disable_refs=False): 567 def get(self, api_name, disable_refs=False):
568 return self._GenerateHandlebarContext( 568 return self._GenerateHandlebarContext(
569 self._get_schema_model(api_name, disable_refs)) 569 self._get_schema_model(api_name, disable_refs))
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/app.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698