class NullFormatter:
- def __init__(self, writer): pass
+ def __init__(self, writer=None):
+ if not writer:
+ writer = NullWriter()
+ self.writer = writer
def end_paragraph(self, blankline): pass
def add_line_break(self): pass
def add_hor_rule(self, abswidth=None, percentwidth=1.0,
return rfc822.unquote(p[n:])
return None
+ def getparamnames(self):
+ result = []
+ for p in self.plist:
+ i = string.find(p, '=')
+ if i >= 0:
+ result.append(string.lower(p[:i]))
+ return result
+
def getencoding(self):
if self.encodingheader == None:
return '7bit'
for i in range(len(self.words)):
word = self.words[i]
if type(word) == Int: continue
- fo, te, wi, sp, st, as, de = word
- self.words[i] = fo, te, wi, sp, 0, as, de
+ (fo, te, wi, sp, st, as, de) = word
+ self.words[i] = (fo, te, wi, sp, 0, as, de)
total = total + wi + sp
if total < tab:
- self.words.append(None, '', 0, tab-total, 0, as, de)
+ self.words.append((None, '', 0, tab-total, 0, as, de))
#
# Make a hanging tag: tab to hang, increment indent_left by hang,
# and reset indent_hang to -hang
value = f(input)
except:
value = sys.exc_type
- print sys.exc_value
if value != output:
print f, `input`, `output`, `value`
line = linecache.getline(filename, lineno)
if line: line = string.strip(line)
else: line = None
- list.append(filename, lineno, name, line)
+ list.append((filename, lineno, name, line))
tb = tb.tb_next
n = n+1
return list
line = linecache.getline(filename, lineno)
if line: line = string.strip(line)
else: line = None
- list.append(filename, lineno, name, line)
+ list.append((filename, lineno, name, line))
f = f.f_back
n = n+1
list.reverse()
class NullFormatter:
- def __init__(self, writer): pass
+ def __init__(self, writer=None):
+ if not writer:
+ writer = NullWriter()
+ self.writer = writer
def end_paragraph(self, blankline): pass
def add_line_break(self): pass
def add_hor_rule(self, abswidth=None, percentwidth=1.0,
return rfc822.unquote(p[n:])
return None
+ def getparamnames(self):
+ result = []
+ for p in self.plist:
+ i = string.find(p, '=')
+ if i >= 0:
+ result.append(string.lower(p[:i]))
+ return result
+
def getencoding(self):
if self.encodingheader == None:
return '7bit'
for i in range(len(self.words)):
word = self.words[i]
if type(word) == Int: continue
- fo, te, wi, sp, st, as, de = word
- self.words[i] = fo, te, wi, sp, 0, as, de
+ (fo, te, wi, sp, st, as, de) = word
+ self.words[i] = (fo, te, wi, sp, 0, as, de)
total = total + wi + sp
if total < tab:
- self.words.append(None, '', 0, tab-total, 0, as, de)
+ self.words.append((None, '', 0, tab-total, 0, as, de))
#
# Make a hanging tag: tab to hang, increment indent_left by hang,
# and reset indent_hang to -hang
value = f(input)
except:
value = sys.exc_type
- print sys.exc_value
if value != output:
print f, `input`, `output`, `value`
line = linecache.getline(filename, lineno)
if line: line = string.strip(line)
else: line = None
- list.append(filename, lineno, name, line)
+ list.append((filename, lineno, name, line))
tb = tb.tb_next
n = n+1
return list
line = linecache.getline(filename, lineno)
if line: line = string.strip(line)
else: line = None
- list.append(filename, lineno, name, line)
+ list.append((filename, lineno, name, line))
f = f.f_back
n = n+1
list.reverse()