From d00d9b64316eb0ed647621286a708ffc68bc8656 Mon Sep 17 00:00:00 2001 From: Sayamindu Dasgupta Date: Wed, 10 Feb 2010 15:23:09 +0000 Subject: More cleanups for i18n.py --- diff --git a/src/sugar/activity/i18n.py b/src/sugar/activity/i18n.py index 410bc15..1c3c893 100644 --- a/src/sugar/activity/i18n.py +++ b/src/sugar/activity/i18n.py @@ -31,40 +31,41 @@ _MO_BIG_ENDIAN = 0xde120495 _MO_LITTLE_ENDIAN = 0x950412de -def _read_bin(handle, fmt, bytecount): - read_bytes = handle.read(bytecount) - ret_value = struct.unpack(fmt, read_bytes) - if len(ret_value) == 1: - return ret_value[0] +def _read_bin(handle, format_string, byte_count): + read_bytes = handle.read(byte_count) + return_value = struct.unpack(format_string, read_bytes) + if len(return_value) == 1: + return return_value[0] else: - return ret_value + return return_value -def _extract_header(filepath): +def _extract_header(file_path): header = '' - handle = open(filepath, 'rb') + handle = open(file_path, 'rb') magic_number = _read_bin(handle, '