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

Side by Side Diff: remoting/tools/remove_official_branding.py

Issue 11275101: Fix branding in chromoting string resources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « remoting/tools/json_to_grd.py ('k') | remoting/webapp/_locales.official/ar/messages.json » ('j') | 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) 2012 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 """Replaces "Chrome Remote Desktop" with "Chromoting" in GRD files"""
7
8 import sys
9 from optparse import OptionParser
10 import xml.dom.minidom as minidom
11
12 def update_xml_node(element):
13 for child in element.childNodes:
14 if child.nodeType == minidom.Node.ELEMENT_NODE:
15 update_xml_node(child)
16 elif child.nodeType == minidom.Node.TEXT_NODE:
17 child.replaceWholeText(
18 child.data.replace("Chrome Remote Desktop", "Chromoting"))
19
20 def remove_official_branding(input, output):
21 xml = minidom.parse(input)
22
23 # Remove all translations.
24 for translations in xml.getElementsByTagName("translations"):
25 for translation in xml.getElementsByTagName("translation"):
26 translations.removeChild(translation)
27
28 # Update branding.
29 update_xml_node(xml)
30
31 out = file(output, "w")
32 out.write(xml.toxml(encoding = "UTF-8"))
33 out.close()
34
35 def main():
36 usage = 'Usage: remove_official_branding <input.grd> <output.grd>'
37 parser = OptionParser(usage=usage)
38 options, args = parser.parse_args()
39 if len(args) != 2:
40 parser.error('two positional arguments expected')
41
42 return remove_official_branding(args[0], args[1])
43
44 if __name__ == '__main__':
45 sys.exit(main())
46
OLDNEW
« no previous file with comments | « remoting/tools/json_to_grd.py ('k') | remoting/webapp/_locales.official/ar/messages.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698