Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Side by Side Diff: Lib/binhex.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/asyncore.py ('k') | Lib/cgi.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """Macintosh binhex compression/decompression. 1 """Macintosh binhex compression/decompression.
2 2
3 easy interface: 3 easy interface:
4 binhex(inputfilename, outputfilename) 4 binhex(inputfilename, outputfilename)
5 hexbin(inputfilename, outputfilename) 5 hexbin(inputfilename, outputfilename)
6 """ 6 """
7 7
8 # 8 #
9 # Jack Jansen, CWI, August 1995. 9 # Jack Jansen, CWI, August 1995.
10 # 10 #
11 # The module is supposed to be as compatible as possible. Especially the 11 # The module is supposed to be as compatible as possible. Especially the
12 # easy interface should work "as expected" on any platform. 12 # easy interface should work "as expected" on any platform.
13 # XXXX Note: currently, textfiles appear in mac-form on all platforms. 13 # XXXX Note: currently, textfiles appear in mac-form on all platforms.
14 # We seem to lack a simple character-translate in python. 14 # We seem to lack a simple character-translate in python.
15 # (we should probably use ISO-Latin-1 on all but the mac platform). 15 # (we should probably use ISO-Latin-1 on all but the mac platform).
16 # XXXX The simple routines are too simple: they expect to hold the complete 16 # XXXX The simple routines are too simple: they expect to hold the complete
17 # files in-core. Should be fixed. 17 # files in-core. Should be fixed.
18 # XXXX It would be nice to handle AppleDouble format on unix 18 # XXXX It would be nice to handle AppleDouble format on unix
19 # (for servers serving macs). 19 # (for servers serving macs).
20 # XXXX I don't understand what happens when you get 0x90 times the same byte on 20 # XXXX I don't understand what happens when you get 0x90 times the same byte on
21 # input. The resulting code (xx 90 90) would appear to be interpreted as an 21 # input. The resulting code (xx 90 90) would appear to be interpreted as an
22 # escaped *value* of 0x90. All coders I've seen appear to ignore this nicety... 22 # escaped *value* of 0x90. All coders I've seen appear to ignore this nicety...
23 # 23 #
24 import io 24 import io
25 import os 25 import os
26 import sys
26 import struct 27 import struct
27 import binascii 28 import binascii
28 29
29 __all__ = ["binhex","hexbin","Error"] 30 __all__ = ["binhex","hexbin","Error"]
30 31
31 class Error(Exception): 32 class Error(Exception):
32 pass 33 pass
33 34
34 # States (what have we written) 35 # States (what have we written)
35 [_DID_HEADER, _DID_DATA, _DID_RSRC] = range(3) 36 [_DID_HEADER, _DID_DATA, _DID_RSRC] = range(3)
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 if d: 463 if d:
463 ofp = openrsrc(out, 'wb') 464 ofp = openrsrc(out, 'wb')
464 ofp.write(d) 465 ofp.write(d)
465 while True: 466 while True:
466 d = ifp.read_rsrc(128000) 467 d = ifp.read_rsrc(128000)
467 if not d: break 468 if not d: break
468 ofp.write(d) 469 ofp.write(d)
469 ofp.close() 470 ofp.close()
470 471
471 ifp.close() 472 ifp.close()
OLDNEW
« no previous file with comments | « Lib/asyncore.py ('k') | Lib/cgi.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+