 Chromium Code Reviews
 Chromium Code Reviews Issue 872143005:
  Now starting AppRTC server up in "developer mode".  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webrtc/webrtc.DEPS/
    
  
    Issue 872143005:
  Now starting AppRTC server up in "developer mode".  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webrtc/webrtc.DEPS/| Index: copy_apprtc.py | 
| =================================================================== | 
| --- copy_apprtc.py (revision 293856) | 
| +++ copy_apprtc.py (working copy) | 
| @@ -10,13 +10,28 @@ | 
| understand those symlinks). | 
| """ | 
| +import fileinput | 
| import os | 
| import shutil | 
| +import sys | 
| import utils | 
| -if __name__ == '__main__': | 
| - target_dir = os.path.join('src', 'out', 'webrtc-samples') | 
| + | 
| +def _ConfigureApprtcServerToDeveloperMode(apprtc_dir): | 
| + app_yaml_path = os.path.join(apprtc_dir, 'app.yaml') | 
| + if not os.path.exists(app_yaml_path): | 
| + return 'Expected app.yaml at %s.' % os.path.abspath(app_yaml_path) | 
| + | 
| + for line in fileinput.input(app_yaml_path, inplace=True): | 
| + # We can't click past these in the firefox interop test, so | 
| + # disable them. | 
| + line = line.replace('BYPASS_JOIN_CONFIRMATION: false', | 
| + 'BYPASS_JOIN_CONFIRMATION: true') | 
| + sys.stdout.write(line) | 
| + | 
| + | 
| +def _CopyApprtcToTargetDir(target_dir, apprtc_subdir): | 
| 
phoglund_chromium
2015/01/29 13:00:14
The more I think about it, this should really be a
 
kjellander_chromium
2015/01/29 13:11:15
Yeah, our hooks starts growing out of control here
 
phoglund_chromium
2015/01/29 13:46:24
Hm, yeah. The downloading and syncing stuff should
 | 
| if utils.GetPlatform() is 'win': | 
| # Work around the fact that node_modules create ridiculously long paths. | 
| # Unfortunately shutil will choke on those on Windows, but not rmdir. | 
| @@ -25,7 +40,6 @@ | 
| shutil.rmtree(target_dir, ignore_errors=True) | 
| shutil.copytree('webrtc-samples', | 
| target_dir, ignore=shutil.ignore_patterns('.svn', '.git')) | 
| - apprtc_subdir = os.path.join('samples', 'web', 'content', 'apprtc') | 
| # This file is symlinked on windows, so copy it since win doesn't understand | 
| # symlinks. | 
| @@ -32,3 +46,14 @@ | 
| shutil.copyfile(os.path.join('webrtc-samples', 'samples', 'web', | 
| 'js', 'adapter.js'), | 
| os.path.join(target_dir, apprtc_subdir, 'js', 'adapter.js')) | 
| + | 
| + | 
| +def Main(): | 
| 
kjellander_chromium
2015/01/29 13:11:15
nit: the Chromium style guide says the main functi
 
phoglund_chromium
2015/01/29 13:46:24
Done.
 | 
| + target_dir = os.path.join('src', 'out', 'webrtc-samples') | 
| + apprtc_subdir = os.path.join('samples', 'web', 'content', 'apprtc') | 
| + _CopyApprtcToTargetDir(target_dir, apprtc_subdir) | 
| + _ConfigureApprtcServerToDeveloperMode(os.path.join(target_dir, apprtc_subdir)) | 
| + | 
| +if __name__ == '__main__': | 
| + sys.exit(Main()) | 
| + |