Commit 771287b6 authored by Tim Peters's avatar Tim Peters

Whitespace normalization.

parent 92843af1
...@@ -68,7 +68,7 @@ def disassemble(co, lasti=-1): ...@@ -68,7 +68,7 @@ def disassemble(co, lasti=-1):
table_index += 1 table_index += 1
addr = 0 addr = 0
line_incr = 0 line_incr = 0
labels = findlabels(code) labels = findlabels(code)
n = len(code) n = len(code)
i = 0 i = 0
......
...@@ -11,7 +11,7 @@ else: ...@@ -11,7 +11,7 @@ else:
from types import UnicodeType from types import UnicodeType
def _is_unicode(x): def _is_unicode(x):
return isinstance(x, UnicodeType) return isinstance(x, UnicodeType)
from email.Encoders import encode_7or8bit from email.Encoders import encode_7or8bit
import email.base64MIME import email.base64MIME
import email.quopriMIME import email.quopriMIME
......
...@@ -52,12 +52,12 @@ def _formatparam(param, value=None, quote=1): ...@@ -52,12 +52,12 @@ def _formatparam(param, value=None, quote=1):
def _unquotevalue(value): def _unquotevalue(value):
if isinstance(value, TupleType): if isinstance(value, TupleType):
return (value[0], value[1], Utils.unquote(value[2])) return (value[0], value[1], Utils.unquote(value[2]))
else: else:
return Utils.unquote(value) return Utils.unquote(value)
class Message: class Message:
"""Basic message object for use inside the object tree. """Basic message object for use inside the object tree.
......
...@@ -129,7 +129,7 @@ class Parser: ...@@ -129,7 +129,7 @@ class Parser:
# boundary. # boundary.
separator = '--' + boundary separator = '--' + boundary
payload = fp.read() payload = fp.read()
# We use an RE here because boundaries can have trailing # We use an RE here because boundaries can have trailing
# whitespace. # whitespace.
mo = re.search( mo = re.search(
r'(?P<sep>' + re.escape(separator) + r')(?P<ws>[ \t]*)', r'(?P<sep>' + re.escape(separator) + r')(?P<ws>[ \t]*)',
...@@ -176,15 +176,15 @@ class Parser: ...@@ -176,15 +176,15 @@ class Parser:
terminator = len(payload) terminator = len(payload)
# We split the textual payload on the boundary separator, which # We split the textual payload on the boundary separator, which
# includes the trailing newline. If the container is a # includes the trailing newline. If the container is a
# multipart/digest then the subparts are by default message/rfc822 # multipart/digest then the subparts are by default message/rfc822
# instead of text/plain. In that case, they'll have a optional # instead of text/plain. In that case, they'll have a optional
# block of MIME headers, then an empty line followed by the # block of MIME headers, then an empty line followed by the
# message headers. # message headers.
parts = re.split( parts = re.split(
linesep + re.escape(separator) + r'[ \t]*' + linesep, linesep + re.escape(separator) + r'[ \t]*' + linesep,
payload[start:terminator]) payload[start:terminator])
for part in parts: for part in parts:
if isdigest: if isdigest:
if part[0] == linesep: if part[0] == linesep:
# There's no header block so create an empty message # There's no header block so create an empty message
# object as the container, and lop off the newline so # object as the container, and lop off the newline so
......
...@@ -14,7 +14,7 @@ class Codec(codecs.Codec): ...@@ -14,7 +14,7 @@ class Codec(codecs.Codec):
class StreamWriter(Codec,codecs.StreamWriter): class StreamWriter(Codec,codecs.StreamWriter):
pass pass
class StreamReader(Codec,codecs.StreamReader): class StreamReader(Codec,codecs.StreamReader):
pass pass
......
...@@ -105,7 +105,7 @@ class Pdb(bdb.Bdb, cmd.Cmd): ...@@ -105,7 +105,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
if len(line) > 0 and line[0] != '#': if len(line) > 0 and line[0] != '#':
self.onecmd(line) self.onecmd(line)
# Override Bdb methods # Override Bdb methods
def user_call(self, frame, argument_list): def user_call(self, frame, argument_list):
"""This method is called when there is the remote possibility """This method is called when there is the remote possibility
......
...@@ -79,7 +79,7 @@ class CallTips: ...@@ -79,7 +79,7 @@ class CallTips:
wordchars="._" + string.ascii_letters + string.digits): wordchars="._" + string.ascii_letters + string.digits):
# Usage of ascii_letters is necessary to avoid UnicodeErrors # Usage of ascii_letters is necessary to avoid UnicodeErrors
# if chars contains non-ASCII. # if chars contains non-ASCII.
# XXX - This needs to be moved to a better place # XXX - This needs to be moved to a better place
# so the "." attribute lookup code can also use it. # so the "." attribute lookup code can also use it.
text = self.text text = self.text
......
...@@ -209,7 +209,7 @@ class IOBinding: ...@@ -209,7 +209,7 @@ class IOBinding:
"installation. The file may not display correctly" % name, "installation. The file may not display correctly" % name,
master = self.text) master = self.text)
enc = None enc = None
if enc: if enc:
try: try:
return unicode(chars, enc) return unicode(chars, enc)
......
...@@ -53,7 +53,7 @@ class ScriptBinding: ...@@ -53,7 +53,7 @@ class ScriptBinding:
def __init__(self, editwin): def __init__(self, editwin):
if not editwin.runnable: if not editwin.runnable:
self.menudefs = [] self.menudefs = []
self.keydefs = {} self.keydefs = {}
self.editwin = editwin self.editwin = editwin
# Provide instance variables referenced by Debugger # Provide instance variables referenced by Debugger
# XXX This should be done differently # XXX This should be done differently
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment