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

Side by Side Diff: components/policy/tools/template_writers/writers/chromeos_admx_writer.py

Issue 2481183002: Generate ADMX template for Chrome OS policies (Closed)
Patch Set: Couple of fixes after testing Created 3 years, 3 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
(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'
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698