diff options
author | Ahmad Sharif <asharif@chromium.org> | 2012-02-02 16:37:18 -0800 |
---|---|---|
committer | Ahmad Sharif <asharif@chromium.org> | 2012-02-02 16:37:18 -0800 |
commit | 0dcbc4b1714260820fd4b8d6536fbb05e139cc0f (patch) | |
tree | f8e4825ddcfc2a51f77a504dc371bc67d55fcd8f /crosperf/label.py | |
parent | 70de27bdb5a05716befea67cdf72a87714fcc0da (diff) | |
download | toolchain-utils-0dcbc4b1714260820fd4b8d6536fbb05e139cc0f.tar.gz |
Synced repos to: 58208
Diffstat (limited to 'crosperf/label.py')
-rw-r--r-- | crosperf/label.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crosperf/label.py b/crosperf/label.py new file mode 100644 index 00000000..3b6fb804 --- /dev/null +++ b/crosperf/label.py @@ -0,0 +1,26 @@ +#!/usr/bin/python + +# Copyright 2011 Google Inc. All Rights Reserved. + +from utils.file_utils import FileUtils + + +class Label(object): + def __init__(self, name, chromeos_image, chromeos_root, board): + self.name = name + self.chromeos_image = chromeos_image + self.board = board + + if not chromeos_root: + chromeos_root = FileUtils().ChromeOSRootFromImage(chromeos_image) + if not chromeos_root: + raise Exception("No ChromeOS root given for label '%s' and could not " + "determine one from image path: '%s'." % + (name, chromeos_image)) + else: + chromeos_root = FileUtils().CanonicalizeChromeOSRoot(chromeos_root) + if not chromeos_root: + raise Exception("Invalid ChromeOS root given for label '%s': '%s'." + % (name, chromeos_root)) + + self.chromeos_root = chromeos_root |