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

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

Issue 2714773003: Extension Docs: Correct how enum values are rendered. (Closed)
Patch Set: Rebase Created 3 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 from copy import copy 5 from copy import copy
6 import logging 6 import logging
7 import posixpath 7 import posixpath
8 8
9 from api_models import GetNodeCategories 9 from api_models import GetNodeCategories
10 from api_schema_graph import APINodeCursor 10 from api_schema_graph import APINodeCursor
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 elif type_.property_type == model.PropertyType.REF: 422 elif type_.property_type == model.PropertyType.REF:
423 dst_dict['link'] = self._GetLink(type_.ref_type) 423 dst_dict['link'] = self._GetLink(type_.ref_type)
424 elif type_.property_type == model.PropertyType.ARRAY: 424 elif type_.property_type == model.PropertyType.ARRAY:
425 dst_dict['array'] = self._GenerateType(type_.item_type) 425 dst_dict['array'] = self._GenerateType(type_.item_type)
426 elif type_.property_type == model.PropertyType.ENUM: 426 elif type_.property_type == model.PropertyType.ENUM:
427 dst_dict['enum_values'] = [ 427 dst_dict['enum_values'] = [
428 {'name': value.name, 'description': value.description} 428 {'name': value.name, 'description': value.description}
429 for value in type_.enum_values] 429 for value in type_.enum_values]
430 if len(dst_dict['enum_values']) > 0: 430 if len(dst_dict['enum_values']) > 0:
431 dst_dict['enum_values'][-1]['last'] = True 431 dst_dict['enum_values'][-1]['last'] = True
432 dst_dict['enum_values'][0]['first'] = True
432 elif type_.instance_of is not None: 433 elif type_.instance_of is not None:
433 dst_dict['simple_type'] = type_.instance_of 434 dst_dict['simple_type'] = type_.instance_of
434 else: 435 else:
435 dst_dict['simple_type'] = type_.property_type.name 436 dst_dict['simple_type'] = type_.property_type.name
436 437
437 def _CreateAvailabilityTemplate(self, status, scheduled, version): 438 def _CreateAvailabilityTemplate(self, status, scheduled, version):
438 '''Returns an object suitable for use in templates to display availability 439 '''Returns an object suitable for use in templates to display availability
439 information. 440 information.
440 ''' 441 '''
441 return { 442 return {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 request): 630 request):
630 return _JSCViewBuilder(content_script_apis, 631 return _JSCViewBuilder(content_script_apis,
631 jsc_model, 632 jsc_model,
632 availability_finder, 633 availability_finder,
633 json_cache, 634 json_cache,
634 template_cache, 635 template_cache,
635 features_bundle, 636 features_bundle,
636 event_byname_future, 637 event_byname_future,
637 platform, 638 platform,
638 samples).ToDict(request) 639 samples).ToDict(request)
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/app.yaml ('k') | chrome/common/extensions/docs/templates/private/type.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698