Revert of ui: Clean up damaged rects and clear them after painting. (patchset #2...
[chromium-blink-merge.git] / components / policy / tools / remove_localized_app_restrictions.py
blob89ddf88675a360961aa1cd999d38089f1532cc4c
1 #!/usr/bin/env python
2 # Copyright 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.
6 '''python %prog resources_dir
8 resources_dir specifies the root directory of the localized app restrictions
9 resources to purge'''
11 import os
12 import re
13 import sys
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)
22 open(os.path.join(resources_dir, 'remove_localized_resources.d.stamp'), 'w')
23 return 0
25 if __name__ == '__main__':
26 sys.exit(main(sys.argv[1]))