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

Unified Diff: tools/cc-frame-viewer/run_dev_server.py

Issue 12225131: [cc] Initial checkin of cc-frame-viewer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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 | « tools/cc-frame-viewer/ccfv.py ('k') | tools/cc-frame-viewer/src/analysis_view.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cc-frame-viewer/run_dev_server.py
diff --git a/tools/cc-frame-viewer/run_dev_server.py b/tools/cc-frame-viewer/run_dev_server.py
new file mode 100755
index 0000000000000000000000000000000000000000..1eb0684bc9c6ad0bc852262dfc5977eaadc7fd98
--- /dev/null
+++ b/tools/cc-frame-viewer/run_dev_server.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+import optparse
+import os
+import sys
+
+import SimpleHTTPServer
+import BaseHTTPServer
+
+from build import calcdeps
+
+DEFAULT_PORT = 8003
+
+class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
+ def do_GET(self):
+ if self.path == '/src/base/deps.js':
+ self.log_message('Regenerating deps')
+ calcdeps.regenerate_deps()
+ return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
+
+class Server(BaseHTTPServer.HTTPServer):
+ def handle_one_request(self):
+ try:
+ HTTPServer.handle_one_request(self)
+ except KeyboardInterrupt:
+ sys.exit(255)
+
+def Main(args):
+ parser = optparse.OptionParser()
+ parser.add_option('--port',
+ action='store',
+ type='int',
+ default=DEFAULT_PORT,
+ help='Port to serve from')
+ options, args = parser.parse_args()
+ server = Server(('', options.port), Handler)
+ sys.stderr.write("Now running on http://localhost:%i\n" % options.port)
+ server.serve_forever()
+
+if __name__ == '__main__':
+ sys.exit(Main(sys.argv[1:]))
« no previous file with comments | « tools/cc-frame-viewer/ccfv.py ('k') | tools/cc-frame-viewer/src/analysis_view.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698