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

Unified Diff: copy_apprtc.py

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/
Patch Set: Created 5 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build_apprtc_closure.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: copy_apprtc.py
===================================================================
--- copy_apprtc.py (revision 293856)
+++ copy_apprtc.py (working copy)
@@ -10,22 +10,31 @@
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')
- 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.
- os.system('rmdir /s /q %s' % target_dir)
- else:
- shutil.rmtree(target_dir, ignore_errors=True)
+
+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):
+ 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 +41,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():
+ 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())
+
« no previous file with comments | « build_apprtc_closure.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698