diff options
author | Guido van Rossum <guido@python.org> | 1996-10-08 14:13:43 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-10-08 14:13:43 (GMT) |
commit | b8cc6ae5a1e8e548c8c2619e20fb1898ab2521f5 (patch) | |
tree | 72e5d9cf750cb8eb7f6196db295adabbf126c340 /Lib | |
parent | 6592f88fc0598aa465f214de0dd4eb5c58229976 (diff) | |
download | cpython-b8cc6ae5a1e8e548c8c2619e20fb1898ab2521f5.zip cpython-b8cc6ae5a1e8e548c8c2619e20fb1898ab2521f5.tar.gz cpython-b8cc6ae5a1e8e548c8c2619e20fb1898ab2521f5.tar.bz2 |
The usual... Sigh...
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/dos-8x3/formatte.py | 5 | ||||
-rwxr-xr-x | Lib/dos-8x3/mimetool.py | 8 | ||||
-rwxr-xr-x | Lib/dos-8x3/para.py | 6 | ||||
-rw-r--r-- | Lib/dos-8x3/test_str.py | 1 | ||||
-rwxr-xr-x | Lib/dos-8x3/tracebac.py | 4 | ||||
-rwxr-xr-x | Lib/dos_8x3/formatte.py | 5 | ||||
-rwxr-xr-x | Lib/dos_8x3/mimetool.py | 8 | ||||
-rwxr-xr-x | Lib/dos_8x3/para.py | 6 | ||||
-rw-r--r-- | Lib/dos_8x3/test_str.py | 1 | ||||
-rwxr-xr-x | Lib/dos_8x3/tracebac.py | 4 |
10 files changed, 34 insertions, 14 deletions
diff --git a/Lib/dos-8x3/formatte.py b/Lib/dos-8x3/formatte.py index c192e20..79be0f6 100755 --- a/Lib/dos-8x3/formatte.py +++ b/Lib/dos-8x3/formatte.py @@ -10,7 +10,10 @@ AS_IS = None 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, diff --git a/Lib/dos-8x3/mimetool.py b/Lib/dos-8x3/mimetool.py index baf9379..eadc11a 100755 --- a/Lib/dos-8x3/mimetool.py +++ b/Lib/dos-8x3/mimetool.py @@ -67,6 +67,14 @@ class Message(rfc822.Message): 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' diff --git a/Lib/dos-8x3/para.py b/Lib/dos-8x3/para.py index c9b3bdd..709b575 100755 --- a/Lib/dos-8x3/para.py +++ b/Lib/dos-8x3/para.py @@ -64,11 +64,11 @@ class Para: 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 diff --git a/Lib/dos-8x3/test_str.py b/Lib/dos-8x3/test_str.py index 5b2ddfb..6028b0d 100644 --- a/Lib/dos-8x3/test_str.py +++ b/Lib/dos-8x3/test_str.py @@ -6,7 +6,6 @@ def test(name, input, output): value = f(input) except: value = sys.exc_type - print sys.exc_value if value != output: print f, `input`, `output`, `value` diff --git a/Lib/dos-8x3/tracebac.py b/Lib/dos-8x3/tracebac.py index 9823100..7488f15 100755 --- a/Lib/dos-8x3/tracebac.py +++ b/Lib/dos-8x3/tracebac.py @@ -66,7 +66,7 @@ def extract_tb(tb, limit = None): 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 @@ -176,7 +176,7 @@ def extract_stack(f=None, limit = None): 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() diff --git a/Lib/dos_8x3/formatte.py b/Lib/dos_8x3/formatte.py index c192e20..79be0f6 100755 --- a/Lib/dos_8x3/formatte.py +++ b/Lib/dos_8x3/formatte.py @@ -10,7 +10,10 @@ AS_IS = None 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, diff --git a/Lib/dos_8x3/mimetool.py b/Lib/dos_8x3/mimetool.py index baf9379..eadc11a 100755 --- a/Lib/dos_8x3/mimetool.py +++ b/Lib/dos_8x3/mimetool.py @@ -67,6 +67,14 @@ class Message(rfc822.Message): 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' diff --git a/Lib/dos_8x3/para.py b/Lib/dos_8x3/para.py index c9b3bdd..709b575 100755 --- a/Lib/dos_8x3/para.py +++ b/Lib/dos_8x3/para.py @@ -64,11 +64,11 @@ class Para: 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 diff --git a/Lib/dos_8x3/test_str.py b/Lib/dos_8x3/test_str.py index 5b2ddfb..6028b0d 100644 --- a/Lib/dos_8x3/test_str.py +++ b/Lib/dos_8x3/test_str.py @@ -6,7 +6,6 @@ def test(name, input, output): value = f(input) except: value = sys.exc_type - print sys.exc_value if value != output: print f, `input`, `output`, `value` diff --git a/Lib/dos_8x3/tracebac.py b/Lib/dos_8x3/tracebac.py index 9823100..7488f15 100755 --- a/Lib/dos_8x3/tracebac.py +++ b/Lib/dos_8x3/tracebac.py @@ -66,7 +66,7 @@ def extract_tb(tb, limit = None): 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 @@ -176,7 +176,7 @@ def extract_stack(f=None, limit = None): 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() |