rtc@google.com | ded2240 | 2009-10-26 22:36:21 +0000 | [diff] [blame] | 1 | # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
rtc@google.com | 21a5ca3 | 2009-11-04 18:23:23 +0000 | [diff] [blame] | 5 | import os |
rtc@google.com | 6424466 | 2009-11-12 00:52:08 +0000 | [diff] [blame] | 6 | import web |
| 7 | from datetime import datetime |
| 8 | import time |
rtc@google.com | 21a5ca3 | 2009-11-04 18:23:23 +0000 | [diff] [blame] | 9 | |
rtc@google.com | 6424466 | 2009-11-12 00:52:08 +0000 | [diff] [blame] | 10 | class BuildObject: |
rtc@google.com | ded2240 | 2009-10-26 22:36:21 +0000 | [diff] [blame] | 11 | """ |
rtc@google.com | 6424466 | 2009-11-12 00:52:08 +0000 | [diff] [blame] | 12 | Common base class that defines key paths in the source tree. |
rtc@google.com | ded2240 | 2009-10-26 22:36:21 +0000 | [diff] [blame] | 13 | """ |
rtc@google.com | 6424466 | 2009-11-12 00:52:08 +0000 | [diff] [blame] | 14 | def __init__(self, root_dir, static_dir): |
| 15 | self.app_id = "87efface-864d-49a5-9bb3-4b050a7c227a" |
| 16 | self.root_dir = root_dir |
| 17 | self.scripts_dir = "%s/scripts" % self.root_dir |
| 18 | self.static_dir = static_dir |
| 19 | self.x86_pkg_dir = "%s/build/x86/local_packages" % self.root_dir |
| 20 | |
| 21 | def AssertSystemCallSuccess(self, err, cmd="unknown"): |
| 22 | """ |
| 23 | TODO(rtc): This code should probably live somewhere else. |
| 24 | """ |
| 25 | if err != 0: |
rtc@google.com | a9aaa99 | 2009-11-13 20:10:34 +0000 | [diff] [blame] | 26 | raise Exception("%s failed to execute" % cmd) |