Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8cc6ae

Browse files
committed
The usual... Sigh...
1 parent 6592f88 commit b8cc6ae

10 files changed

Lines changed: 34 additions & 14 deletions

File tree

Lib/dos-8x3/formatte.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010

1111
class NullFormatter:
1212

13-
def __init__(self, writer): pass
13+
def __init__(self, writer=None):
14+
if not writer:
15+
writer = NullWriter()
16+
self.writer = writer
1417
def end_paragraph(self, blankline): pass
1518
def add_line_break(self): pass
1619
def add_hor_rule(self, abswidth=None, percentwidth=1.0,

Lib/dos-8x3/mimetool.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ def getparam(self, name):
6767
return rfc822.unquote(p[n:])
6868
return None
6969

70+
def getparamnames(self):
71+
result = []
72+
for p in self.plist:
73+
i = string.find(p, '=')
74+
if i >= 0:
75+
result.append(string.lower(p[:i]))
76+
return result
77+
7078
def getencoding(self):
7179
if self.encodingheader == None:
7280
return '7bit'

Lib/dos-8x3/para.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ def tabto(self, tab):
6464
for i in range(len(self.words)):
6565
word = self.words[i]
6666
if type(word) == Int: continue
67-
fo, te, wi, sp, st, as, de = word
68-
self.words[i] = fo, te, wi, sp, 0, as, de
67+
(fo, te, wi, sp, st, as, de) = word
68+
self.words[i] = (fo, te, wi, sp, 0, as, de)
6969
total = total + wi + sp
7070
if total < tab:
71-
self.words.append(None, '', 0, tab-total, 0, as, de)
71+
self.words.append((None, '', 0, tab-total, 0, as, de))
7272
#
7373
# Make a hanging tag: tab to hang, increment indent_left by hang,
7474
# and reset indent_hang to -hang

Lib/dos-8x3/test_str.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ def test(name, input, output):
66
value = f(input)
77
except:
88
value = sys.exc_type
9-
print sys.exc_value
109
if value != output:
1110
print f, `input`, `output`, `value`
1211

Lib/dos-8x3/tracebac.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def extract_tb(tb, limit = None):
6666
line = linecache.getline(filename, lineno)
6767
if line: line = string.strip(line)
6868
else: line = None
69-
list.append(filename, lineno, name, line)
69+
list.append((filename, lineno, name, line))
7070
tb = tb.tb_next
7171
n = n+1
7272
return list
@@ -176,7 +176,7 @@ def extract_stack(f=None, limit = None):
176176
line = linecache.getline(filename, lineno)
177177
if line: line = string.strip(line)
178178
else: line = None
179-
list.append(filename, lineno, name, line)
179+
list.append((filename, lineno, name, line))
180180
f = f.f_back
181181
n = n+1
182182
list.reverse()

Lib/dos_8x3/formatte.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010

1111
class NullFormatter:
1212

13-
def __init__(self, writer): pass
13+
def __init__(self, writer=None):
14+
if not writer:
15+
writer = NullWriter()
16+
self.writer = writer
1417
def end_paragraph(self, blankline): pass
1518
def add_line_break(self): pass
1619
def add_hor_rule(self, abswidth=None, percentwidth=1.0,

Lib/dos_8x3/mimetool.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ def getparam(self, name):
6767
return rfc822.unquote(p[n:])
6868
return None
6969

70+
def getparamnames(self):
71+
result = []
72+
for p in self.plist:
73+
i = string.find(p, '=')
74+
if i >= 0:
75+
result.append(string.lower(p[:i]))
76+
return result
77+
7078
def getencoding(self):
7179
if self.encodingheader == None:
7280
return '7bit'

Lib/dos_8x3/para.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ def tabto(self, tab):
6464
for i in range(len(self.words)):
6565
word = self.words[i]
6666
if type(word) == Int: continue
67-
fo, te, wi, sp, st, as, de = word
68-
self.words[i] = fo, te, wi, sp, 0, as, de
67+
(fo, te, wi, sp, st, as, de) = word
68+
self.words[i] = (fo, te, wi, sp, 0, as, de)
6969
total = total + wi + sp
7070
if total < tab:
71-
self.words.append(None, '', 0, tab-total, 0, as, de)
71+
self.words.append((None, '', 0, tab-total, 0, as, de))
7272
#
7373
# Make a hanging tag: tab to hang, increment indent_left by hang,
7474
# and reset indent_hang to -hang

Lib/dos_8x3/test_str.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ def test(name, input, output):
66
value = f(input)
77
except:
88
value = sys.exc_type
9-
print sys.exc_value
109
if value != output:
1110
print f, `input`, `output`, `value`
1211

Lib/dos_8x3/tracebac.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def extract_tb(tb, limit = None):
6666
line = linecache.getline(filename, lineno)
6767
if line: line = string.strip(line)
6868
else: line = None
69-
list.append(filename, lineno, name, line)
69+
list.append((filename, lineno, name, line))
7070
tb = tb.tb_next
7171
n = n+1
7272
return list
@@ -176,7 +176,7 @@ def extract_stack(f=None, limit = None):
176176
line = linecache.getline(filename, lineno)
177177
if line: line = string.strip(line)
178178
else: line = None
179-
list.append(filename, lineno, name, line)
179+
list.append((filename, lineno, name, line))
180180
f = f.f_back
181181
n = n+1
182182
list.reverse()

0 commit comments

Comments
 (0)