Decrypt a file from source to destination.
(source, destination, major, minor)
| 90 | string = source.read(2 ** 20 / 5) |
| 91 | |
| 92 | def decode_file(source, destination, major, minor): |
| 93 | 'Decrypt a file from source to destination.' |
| 94 | _check_major(major) |
| 95 | _check_minor(minor) |
| 96 | map_1 = _decode_map_1(minor) |
| 97 | map_2 = _decode_map_2(major) |
| 98 | string = source.read(2 ** 20 / 5 * 4) |
| 99 | while string: |
| 100 | tail_len = len(string) % 4 |
| 101 | if tail_len == 0: |
| 102 | destination.write(_decode(string, map_1, map_2)) |
| 103 | string = source.read(2 ** 20 / 5 * 4) |
| 104 | else: |
| 105 | destination.write(_decode(string[:-tail_len], map_1, map_2)) |
| 106 | return string[-tail_len:] |
| 107 | return '' |
| 108 | |
| 109 | ################################################################################ |
| 110 |
nothing calls this directly
no test coverage detected