# HG changeset patch # User Gerard Krijgsman # Date 1347880115 -7200 # Mon Sep 17 13:08:35 2012 +0200 # Node ID 0de4777fc130d689ddae953a6e6f3a1276db7884 # Parent c7ab62c5e380fe728c48892e363295d748b5cdb2 Another improvement to readability… probably diff --git a/result.py b/result.py --- a/result.py +++ b/result.py @@ -16,17 +16,17 @@ result = {} if not filesize: raise InvalidResultFile('RST file size zero or not defined') - pointers = _get_sections(f, filesize) + # Get pointers to sections + p = _get_sections(f, filesize) # Read standard sections (should always exist, even if 0 items in section) - result['ships'] = Ship.read(f, offset=pointers['ships'], has_count=True) + result['ships'] = Ship.read(f, offset=p['ships'], has_count=True) result['targets'] = Target.read_result( - f, offset=pointers['targets'], extra_offset=pointers['extratargets']) - result['planets'] = Planet.read( - f, offset=pointers['planets'], has_count=True) - result['bases'] = Base.read(f, offset=pointers['bases'], has_count=True) - result['messages'] = read_messages(f, offset=pointers['messages']) - result['shipxy'] = ShipXY.read(f, offset=pointers['shipxy']) - result['general'] = read_general(f, offset=pointers['general']) + f, offset=p['targets'], extra_offset=p['extratargets']) + result['planets'] = Planet.read(f, offset=p['planets'], has_count=True) + result['bases'] = Base.read(f, offset=p['bases'], has_count=True) + result['messages'] = read_messages(f, offset=p['messages']) + result['shipxy'] = ShipXY.read(f, offset=p['shipxy']) + result['general'] = read_general(f, offset=p['general']) return result def _valid_pointer(pointer, filesize, datasize):