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

Side by Side Diff: remoting/webapp/build-webapp.py

Issue 11365095: Revert 166003 - Move Chromoting strings to string_resources.grd and simplify remoting_resources tar… (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/remove_official_branding.py ('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
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Creates a directory with with the unpacked contents of the remoting webapp. 6 """Creates a directory with with the unpacked contents of the remoting webapp.
7 7
8 The directory will contain a copy-of or a link-to to all remoting webapp 8 The directory will contain a copy-of or a link-to to all remoting webapp
9 resources. This includes HTML/JS and any plugin binaries. The script also 9 resources. This includes HTML/JS and any plugin binaries. The script also
10 massages resulting files appropriately with host plugin data. Finally, 10 massages resulting files appropriately with host plugin data. Finally,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 # to create a symlink in that case. 104 # to create a symlink in that case.
105 targetname = os.path.relpath(os.path.realpath(current_file), 105 targetname = os.path.relpath(os.path.realpath(current_file),
106 os.path.realpath(destination_file)) 106 os.path.realpath(destination_file))
107 os.symlink(targetname, destination_file) 107 os.symlink(targetname, destination_file)
108 else: 108 else:
109 shutil.copy2(current_file, destination_file) 109 shutil.copy2(current_file, destination_file)
110 110
111 # Copy all the locales, preserving directory structure 111 # Copy all the locales, preserving directory structure
112 destination_locales = os.path.join(destination, "_locales") 112 destination_locales = os.path.join(destination, "_locales")
113 os.mkdir(destination_locales , 0775) 113 os.mkdir(destination_locales , 0775)
114 locale_dir = "/_locales/" 114 chromium_locale_dir = "/_locales/"
115 chrome_locale_dir = "/_locales.official/"
115 for current_locale in locales: 116 for current_locale in locales:
116 pos = current_locale.find(locale_dir) 117 pos = current_locale.find(chromium_locale_dir)
118 locale_len = len(chromium_locale_dir)
117 if (pos == -1): 119 if (pos == -1):
118 raise Exception("Missing locales directory in " + current_locale) 120 pos = current_locale.find(chrome_locale_dir)
119 subtree = current_locale[pos + len(locale_dir):] 121 locale_len = len(chrome_locale_dir)
122 if (pos == -1):
123 raise "Missing locales directory in " + current_locale
124 subtree = current_locale[pos+locale_len:]
120 pos = subtree.find("/") 125 pos = subtree.find("/")
121 if (pos == -1): 126 if (pos == -1):
122 raise Exception("Malformed locale: " + current_locale) 127 raise "Malformed locale: " + current_locale
123 locale_id = subtree[:pos] 128 locale_id = subtree[:pos]
124 messages = subtree[pos+1:] 129 messages = subtree[pos+1:]
125 destination_dir = os.path.join(destination_locales, locale_id) 130 destination_dir = os.path.join(destination_locales, locale_id)
126 destination_file = os.path.join(destination_dir, messages) 131 destination_file = os.path.join(destination_dir, messages)
127 os.mkdir(destination_dir, 0775) 132 os.mkdir(destination_dir, 0775)
128 shutil.copy2(current_locale, destination_file) 133 shutil.copy2(current_locale, destination_file)
129 134
130 # Create fake plugin files to appease the manifest checker. 135 # Create fake plugin files to appease the manifest checker.
131 # It requires that if there is a plugin listed in the manifest that 136 # It requires that if there is a plugin listed in the manifest that
132 # there be a file in the plugin with that name. 137 # there be a file in the plugin with that name.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 else: 224 else:
220 files.append(arg) 225 files.append(arg)
221 226
222 buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], 227 buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5],
223 sys.argv[6], files, locales) 228 sys.argv[6], files, locales)
224 return 0 229 return 0
225 230
226 231
227 if __name__ == '__main__': 232 if __name__ == '__main__':
228 sys.exit(main()) 233 sys.exit(main())
OLDNEW
« no previous file with comments | « remoting/tools/remove_official_branding.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698