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

Side by Side Diff: components/policy/tools/remove_localized_app_restrictions.py

Issue 1062213002: Remove localized App Restrictions resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « components/policy/resources/policy_templates.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2015 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 '''python %prog resources_dir
7
8 resources_dir specifies the root directory of the localized app restrictions
Bernhard Bauer 2015/04/08 10:24:18 Remove one space before "app"
knn 2015/04/08 10:40:50 Done.
9 resources to purge'''
10
11 import re
12 import os
13 import sys
14
15 def main(resources_dir):
16 match = re.compile('^values-.*-v21$')
17 for dir in os.listdir(resources_dir):
18 if match.search(dir):
19 path = os.path.join(resources_dir, dir)
20 os.remove(os.path.join(path, 'restriction_values.xml'))
21 os.rmdir(path)
Bernhard Bauer 2015/04/08 10:24:18 What happens if this fails?
knn 2015/04/08 10:40:50 The stamp file will not be written and build will
Bernhard Bauer 2015/04/08 12:36:17 What I meant to ask was, what happens if e.g. the
knn 2015/04/08 12:52:54 If the directory is not empty, we are packing junk
Bernhard Bauer 2015/04/08 12:58:53 Okay... I'm just worried that someone might rightf
22 open(os.path.join(resources_dir, 'remove_localized_resources.d.stamp'), 'w')
23 return 0
24
25 if __name__ == '__main__':
26 sys.exit(main(sys.argv[1]))
OLDNEW
« no previous file with comments | « components/policy/resources/policy_templates.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698