OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright 2017 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 |
| 7 import base64 |
| 8 |
| 9 from writers import admx_writer |
| 10 |
| 11 |
| 12 def GetWriter(config): |
| 13 '''Factory method for creating ADMXWriter objects for the Chrome OS platform |
| 14 See the constructor of TemplateWriter for description of arguments. |
| 15 ''' |
| 16 return ChromeOSADMXWriter(['chrome_os'], config) |
| 17 |
| 18 |
| 19 class ChromeOSADMXWriter(admx_writer.ADMXWriter): |
| 20 '''Class for generating Chrome OS policy templates in the ADMX format. |
| 21 It is used by PolicyTemplateGenerator to write ADMX files. |
| 22 ''' |
| 23 |
| 24 # Overridden. |
| 25 def GetClass(self, policy): |
| 26 is_device_only = 'device_only' in policy and policy['device_only'] |
| 27 return 'Machine' if is_device_only else 'User' |
OLD | NEW |