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

Unified Diff: devserver.py

Issue 6305004: Modify devserver and gmerge to be friendlier (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/dev-util.git@master
Patch Set: Numerous code review fixes. Added --USE flag as well Created 9 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 | « builder_test.py ('k') | gmerge » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devserver.py
diff --git a/devserver.py b/devserver.py
index 7d744c59f3aeb6d44201ccd6d1b777ee152e426d..7d4162d9475e919273f721dcc90b60e5a3bc449b 100755
--- a/devserver.py
+++ b/devserver.py
@@ -9,9 +9,11 @@
import cherrypy
import optparse
import os
+import subprocess
import sys
import autoupdate
+import builder
CACHED_ENTRIES=12
@@ -69,7 +71,7 @@ def _PrepareToServeUpdatesOnly(image_dir):
'DEVSERVER')
-class DevServerRoot:
+class DevServerRoot(object):
"""The Root Class for the Dev Server.
CherryPy works as follows:
@@ -81,17 +83,12 @@ class DevServerRoot:
cherrypy uses the update method and puts the extra paths in args.
"""
- def build(self, board, pkg):
+ def __init__(self):
+ self._builder = builder.Builder()
+
+ def build(self, board, pkg, **kwargs):
"""Builds the package specified."""
- cherrypy.log('emerging %s' % pkg, 'BUILD')
- emerge_command = 'emerge-%s %s' % (board, pkg)
- err = os.system(emerge_command)
- if err != 0:
- raise Exception('failed to execute %s' % emerge_command)
- eclean_command = 'eclean-%s -d packages' % board
- err = os.system(eclean_command)
- if err != 0:
- raise Exception('failed to execute %s' % emerge_command)
+ return self._builder.Build(board, pkg, kwargs)
def index(self):
return 'Welcome to the Dev Server!'
« no previous file with comments | « builder_test.py ('k') | gmerge » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698