OLD | NEW |
---|---|
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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
343 replaceString(destination, 'DIRECTORY_BOT_JID', | 343 replaceString(destination, 'DIRECTORY_BOT_JID', |
344 os.environ.get('DIRECTORY_BOT_JID', | 344 os.environ.get('DIRECTORY_BOT_JID', |
345 'remoting@bot.talk.google.com')) | 345 'remoting@bot.talk.google.com')) |
346 replaceString(destination, 'THIRD_PARTY_AUTH_REDIRECT_URL', | 346 replaceString(destination, 'THIRD_PARTY_AUTH_REDIRECT_URL', |
347 thirdPartyAuthUrlJs) | 347 thirdPartyAuthUrlJs) |
348 | 348 |
349 # Set the correct API keys. | 349 # Set the correct API keys. |
350 # For overriding the client ID/secret via env vars, see google_api_keys.py. | 350 # For overriding the client ID/secret via env vars, see google_api_keys.py. |
351 apiClientId = google_api_keys.GetClientID('REMOTING') | 351 apiClientId = google_api_keys.GetClientID('REMOTING') |
352 apiClientSecret = google_api_keys.GetClientSecret('REMOTING') | 352 apiClientSecret = google_api_keys.GetClientSecret('REMOTING') |
353 apiClientSecret = google_api_keys.GetClientSecret('REMOTING') | |
Jamie
2015/04/24 18:18:53
Duplicate line?
John Williams
2015/04/24 21:10:17
Fixed.
| |
354 apiKey = google_api_keys.GetAPIKeyRemoting() | |
353 | 355 |
354 if is_app_remoting_webapp and buildtype != 'Dev': | 356 if is_app_remoting_webapp and buildtype != 'Dev': |
355 if not app_client_id: | 357 if not app_client_id: |
356 raise Exception('Invalid app_client_id passed in: "' + | 358 raise Exception('Invalid app_client_id passed in: "' + |
357 app_client_id + '"') | 359 app_client_id + '"') |
358 apiClientIdV2 = app_client_id + '.apps.googleusercontent.com' | 360 apiClientIdV2 = app_client_id + '.apps.googleusercontent.com' |
359 else: | 361 else: |
360 apiClientIdV2 = google_api_keys.GetClientID('REMOTING_IDENTITY_API') | 362 apiClientIdV2 = google_api_keys.GetClientID('REMOTING_IDENTITY_API') |
361 | 363 |
362 replaceString(destination, 'API_CLIENT_ID', apiClientId) | 364 replaceString(destination, 'API_CLIENT_ID', apiClientId) |
363 replaceString(destination, 'API_CLIENT_SECRET', apiClientSecret) | 365 replaceString(destination, 'API_CLIENT_SECRET', apiClientSecret) |
366 replaceString(destination, 'API_KEY', apiKey) | |
364 | 367 |
365 # Write the application capabilities. | 368 # Write the application capabilities. |
366 appCapabilities = ','.join( | 369 appCapabilities = ','.join( |
367 ['remoting.ClientSession.Capability.' + x for x in app_capabilities]) | 370 ['remoting.ClientSession.Capability.' + x for x in app_capabilities]) |
368 findAndReplace(os.path.join(destination, 'app_capabilities.js'), | 371 findAndReplace(os.path.join(destination, 'app_capabilities.js'), |
369 "'APPLICATION_CAPABILITIES'", appCapabilities) | 372 "'APPLICATION_CAPABILITIES'", appCapabilities) |
370 | 373 |
371 # Use a consistent extension id for dev builds. | 374 # Use a consistent extension id for dev builds. |
372 # AppRemoting builds always use the dev app id - the correct app id gets | 375 # AppRemoting builds always use the dev app id - the correct app id gets |
373 # written into the manifest later. | 376 # written into the manifest later. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 parser.add_argument('--use_gcd', choices=['0', '1'], default='0') | 446 parser.add_argument('--use_gcd', choices=['0', '1'], default='0') |
444 | 447 |
445 args = parser.parse_args() | 448 args = parser.parse_args() |
446 args.use_gcd = (args.use_gcd != '0') | 449 args.use_gcd = (args.use_gcd != '0') |
447 args.app_capabilities = set(args.app_capabilities) | 450 args.app_capabilities = set(args.app_capabilities) |
448 return buildWebApp(**vars(args)) | 451 return buildWebApp(**vars(args)) |
449 | 452 |
450 | 453 |
451 if __name__ == '__main__': | 454 if __name__ == '__main__': |
452 sys.exit(main()) | 455 sys.exit(main()) |
OLD | NEW |