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

Side by Side Diff: recipe_engine/config.py

Issue 2856003002: [doc] fix doc to work in all known repos. (Closed)
Patch Set: add docstring Created 3 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
« no previous file with comments | « no previous file | recipe_engine/doc.py » ('j') | recipe_engine/doc.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The LUCI Authors. All rights reserved. 1 # Copyright 2013 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Recipe Configuration Meta DSL. 5 """Recipe Configuration Meta DSL.
6 6
7 This module contains, essentially, a DSL for writing composable configurations. 7 This module contains, essentially, a DSL for writing composable configurations.
8 You start by defining a schema which describes how your configuration blobs will 8 You start by defining a schema which describes how your configuration blobs will
9 be structured, and what data they can contain. For example: 9 be structured, and what data they can contain. For example:
10 10
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 def schema_proto(self): 333 def schema_proto(self):
334 """Returns a doc.Doc.Schema proto message for this config type.""" 334 """Returns a doc.Doc.Schema proto message for this config type."""
335 raise NotImplementedError 335 raise NotImplementedError
336 336
337 337
338 _SIMPLE_TYPE_LOOKUP = { 338 _SIMPLE_TYPE_LOOKUP = {
339 str: doc.Doc.Schema.STRING, 339 str: doc.Doc.Schema.STRING,
340 basestring: doc.Doc.Schema.STRING, 340 basestring: doc.Doc.Schema.STRING,
341 unicode: doc.Doc.Schema.STRING, 341 unicode: doc.Doc.Schema.STRING,
342 int: doc.Doc.Schema.NUMBER, 342 int: doc.Doc.Schema.NUMBER,
343 long: doc.Doc.Schema.NUMBER,
343 float: doc.Doc.Schema.NUMBER, 344 float: doc.Doc.Schema.NUMBER,
344 bool: doc.Doc.Schema.BOOLEAN, 345 bool: doc.Doc.Schema.BOOLEAN,
345 dict: doc.Doc.Schema.OBJECT, 346 dict: doc.Doc.Schema.OBJECT,
346 list: doc.Doc.Schema.ARRAY, 347 list: doc.Doc.Schema.ARRAY,
347 type(None): doc.Doc.Schema.NULL, 348 type(None): doc.Doc.Schema.NULL,
348 } 349 }
349 350
350 351
351 def _inner_type_schema(inner_type): 352 def _inner_type_schema(inner_type):
352 ret = [] 353 ret = []
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 905
905 def _is_default(self): 906 def _is_default(self):
906 return self.data is None 907 return self.data is None
907 908
908 def schema_proto(self): 909 def schema_proto(self):
909 ret = doc.Doc.Schema() 910 ret = doc.Doc.Schema()
910 ret.enum.values_json.extend(json.dumps(self.jsonish_fn(v)) 911 ret.enum.values_json.extend(json.dumps(self.jsonish_fn(v))
911 for v in self.values) 912 for v in self.values)
912 ret.enum.required = self.required 913 ret.enum.required = self.required
913 return ret 914 return ret
OLDNEW
« no previous file with comments | « no previous file | recipe_engine/doc.py » ('j') | recipe_engine/doc.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698