| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Provides convenience routines to access the GBB on the current BIOS. | 6 """Provides convenience routines to access the GBB on the current BIOS. |
| 7 | 7 |
| 8 GBBUtility is a wrapper of gbb_utility program. | 8 GBBUtility is a wrapper of gbb_utility program. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import os | 11 import os |
| 12 import tempfile | 12 import tempfile |
| 13 | 13 |
| 14 from autotest_lib.client.bin import utils |
| 14 from autotest_lib.client.common_lib import error | 15 from autotest_lib.client.common_lib import error |
| 15 from autotest_lib.client.common_lib import flashrom_util | 16 import common |
| 16 from autotest_lib.client.common_lib import utils | 17 import flashrom_util |
| 17 | 18 |
| 18 | 19 |
| 19 class GBBUtility(object): | 20 class GBBUtility(object): |
| 20 """GBBUtility is a wrapper of gbb_utility program. | 21 """GBBUtility is a wrapper of gbb_utility program. |
| 21 | 22 |
| 22 It accesses the GBB on the current BIOS image. | 23 It accesses the GBB on the current BIOS image. |
| 23 """ | 24 """ |
| 24 def __init__(self, | 25 def __init__(self, |
| 25 gbb_command='gbb_utility', | 26 gbb_command='gbb_utility', |
| 26 temp_dir=None, | 27 temp_dir=None, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 self._remove_temp_file(rootkey_file) | 185 self._remove_temp_file(rootkey_file) |
| 185 self._need_commit = False | 186 self._need_commit = False |
| 186 self._clear_cached() | 187 self._clear_cached() |
| 187 | 188 |
| 188 | 189 |
| 189 def discard(self): | 190 def discard(self): |
| 190 """Discard all uncommitted changes.""" | 191 """Discard all uncommitted changes.""" |
| 191 if self._need_commit: | 192 if self._need_commit: |
| 192 self._need_commit = False | 193 self._need_commit = False |
| 193 self._clear_cached() | 194 self._clear_cached() |
| OLD | NEW |