diff options
author | Georg Brandl <georg@python.org> | 2009-09-02 20:34:14 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-09-02 20:34:14 (GMT) |
commit | 0bb1cc72c8e37a5ac53b800667693c4330beb5a3 (patch) | |
tree | 8d50fa11caf60b51edf740a61e0e894c64f18bc5 /Lib | |
parent | 7837a968e270654fdf2d1d08d83b2078c4294e63 (diff) | |
download | cpython-0bb1cc72c8e37a5ac53b800667693c4330beb5a3.zip cpython-0bb1cc72c8e37a5ac53b800667693c4330beb5a3.tar.gz cpython-0bb1cc72c8e37a5ac53b800667693c4330beb5a3.tar.bz2 |
Use true booleans and a bit more PEP8.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/quopri.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/quopri.py b/Lib/quopri.py index 6b3d13e..ff27923 100755 --- a/Lib/quopri.py +++ b/Lib/quopri.py @@ -41,7 +41,7 @@ def quote(c): -def encode(input, output, quotetabs, header = 0): +def encode(input, output, quotetabs, header=False): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. @@ -54,7 +54,7 @@ def encode(input, output, quotetabs, header = 0): if b2a_qp is not None: data = input.read() - odata = b2a_qp(data, quotetabs = quotetabs, header = header) + odata = b2a_qp(data, quotetabs=quotetabs, header=header) output.write(odata) return @@ -105,9 +105,9 @@ def encode(input, output, quotetabs, header = 0): if prevline is not None: write(prevline, lineEnd=stripped) -def encodestring(s, quotetabs = 0, header = 0): +def encodestring(s, quotetabs=False, header=False): if b2a_qp is not None: - return b2a_qp(s, quotetabs = quotetabs, header = header) + return b2a_qp(s, quotetabs=quotetabs, header=header) from io import BytesIO infp = BytesIO(s) outfp = BytesIO() @@ -116,14 +116,14 @@ def encodestring(s, quotetabs = 0, header = 0): -def decode(input, output, header = 0): +def decode(input, output, header=False): """Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. If 'header' is true, decode underscore as space (per RFC 1522).""" if a2b_qp is not None: data = input.read() - odata = a2b_qp(data, header = header) + odata = a2b_qp(data, header=header) output.write(odata) return @@ -159,13 +159,13 @@ def decode(input, output, header = 0): if new: output.write(new) -def decodestring(s, header = 0): +def decodestring(s, header=False): if a2b_qp is not None: - return a2b_qp(s, header = header) + return a2b_qp(s, header=header) from io import BytesIO infp = BytesIO(s) outfp = BytesIO() - decode(infp, outfp, header = header) + decode(infp, outfp, header=header) return outfp.getvalue() |