OLD | NEW |
1 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
| 5 import os, sys |
| 6 |
5 class BuildObject(object): | 7 class BuildObject(object): |
6 """ | 8 """ |
7 Common base class that defines key paths in the source tree. | 9 Common base class that defines key paths in the source tree. |
8 """ | 10 """ |
9 def __init__(self, root_dir, static_dir): | 11 def __init__(self, root_dir, static_dir): |
10 self.app_id = "87efface-864d-49a5-9bb3-4b050a7c227a" | 12 self.app_id = "87efface-864d-49a5-9bb3-4b050a7c227a" |
11 self.root_dir = root_dir | 13 self.root_dir = root_dir |
12 self.scripts_dir = "%s/scripts" % self.root_dir | 14 self.scripts_dir = "%s/src/scripts" % os.environ["CROS_WORKON_SRCROOT"] |
| 15 self.devserver_dir = os.path.dirname(os.path.abspath(sys.argv[0])) |
13 self.static_dir = static_dir | 16 self.static_dir = static_dir |
14 self.x86_pkg_dir = "%s/build/x86/local_packages" % self.root_dir | 17 self.x86_pkg_dir = "%s/build/x86/local_packages" % self.root_dir |
15 | 18 |
16 def AssertSystemCallSuccess(self, err, cmd="unknown"): | 19 def AssertSystemCallSuccess(self, err, cmd="unknown"): |
17 """ | 20 """ |
18 TODO(rtc): This code should probably live somewhere else. | 21 TODO(rtc): This code should probably live somewhere else. |
19 """ | 22 """ |
20 if err != 0: | 23 if err != 0: |
21 raise Exception("%s failed to execute" % cmd) | 24 raise Exception("%s failed to execute" % cmd) |
OLD | NEW |