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 This module provides basic encode and decode functionality to the flashrom | 6 This module provides basic encode and decode functionality to the flashrom |
7 memory map (FMAP) structure. | 7 memory map (FMAP) structure. |
8 | 8 |
9 Usage: | 9 Usage: |
10 (decode) | 10 (decode) |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 if __name__ == '__main__': | 146 if __name__ == '__main__': |
147 # main entry, do a unit test | 147 # main entry, do a unit test |
148 blob = open('bin/example.bin').read() | 148 blob = open('bin/example.bin').read() |
149 obj = fmap_decode(blob) | 149 obj = fmap_decode(blob) |
150 print obj | 150 print obj |
151 blob2 = fmap_encode(obj) | 151 blob2 = fmap_encode(obj) |
152 obj2 = fmap_decode(blob2) | 152 obj2 = fmap_decode(blob2) |
153 print obj2 | 153 print obj2 |
154 assert obj == obj2 | 154 assert obj == obj2 |
OLD | NEW |