OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 '''python %prog [options] platform chromium_os_flag template | 6 '''python %prog [options] platform chromium_os_flag template |
7 | 7 |
8 platform specifies which platform source is being generated for | 8 platform specifies which platform source is being generated for |
9 and can be one of (win, mac, linux) | 9 and can be one of (win, mac, linux) |
10 chromium_os_flag should be 1 if this is a Chromium OS build | 10 chromium_os_flag should be 1 if this is a Chromium OS build |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 for policy in _GetPolicyList(template_file_contents): | 272 for policy in _GetPolicyList(template_file_contents): |
273 f.write('const char k{name}[] = "{name}";\n'.format(name=policy.name)) | 273 f.write('const char k{name}[] = "{name}";\n'.format(name=policy.name)) |
274 f.write('\n} // namespace key\n\n' | 274 f.write('\n} // namespace key\n\n' |
275 '} // namespace policy\n') | 275 '} // namespace policy\n') |
276 | 276 |
277 | 277 |
278 #------------------ policy protobuf --------------------------------# | 278 #------------------ policy protobuf --------------------------------# |
279 PROTO_HEAD = ''' | 279 PROTO_HEAD = ''' |
280 syntax = "proto2"; | 280 syntax = "proto2"; |
281 | 281 |
282 option optimize_for = LITE_RUNTIME; | |
283 | |
284 package enterprise_management; | 282 package enterprise_management; |
285 | 283 |
286 message StringList { | 284 message StringList { |
287 repeated string entries = 1; | 285 repeated string entries = 1; |
288 } | 286 } |
289 | 287 |
290 message PolicyOptions { | 288 message PolicyOptions { |
291 enum PolicyMode { | 289 enum PolicyMode { |
292 // The given settings are applied regardless of user choice. | 290 // The given settings are applied regardless of user choice. |
293 MANDATORY = 0; | 291 MANDATORY = 0; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 if policy['type'] == 'group': | 464 if policy['type'] == 'group': |
467 for sub_policy in policy['policies']: | 465 for sub_policy in policy['policies']: |
468 _WritePolicyCode(f, sub_policy) | 466 _WritePolicyCode(f, sub_policy) |
469 else: | 467 else: |
470 _WritePolicyCode(f, policy) | 468 _WritePolicyCode(f, policy) |
471 f.write(CPP_FOOT) | 469 f.write(CPP_FOOT) |
472 | 470 |
473 | 471 |
474 if __name__ == '__main__': | 472 if __name__ == '__main__': |
475 sys.exit(main()) | 473 sys.exit(main()) |
OLD | NEW |