]> granicus.if.org Git - python/commitdiff
The usual... Sigh...
authorGuido van Rossum <guido@python.org>
Tue, 8 Oct 1996 14:13:43 +0000 (14:13 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 8 Oct 1996 14:13:43 +0000 (14:13 +0000)
Lib/dos-8x3/formatte.py
Lib/dos-8x3/mimetool.py
Lib/dos-8x3/para.py
Lib/dos-8x3/test_str.py
Lib/dos-8x3/tracebac.py
Lib/dos_8x3/formatte.py
Lib/dos_8x3/mimetool.py
Lib/dos_8x3/para.py
Lib/dos_8x3/test_str.py
Lib/dos_8x3/tracebac.py

index c192e20ddb567525a77fe1af219237fb33e628ee..79be0f64e35b75cddb5126e9fb5a1ac64515b33c 100755 (executable)
@@ -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,
index baf9379f537a52eba04713ee6aaea76f84b738ed..eadc11a5eab56479212fb4c528d1dc35cb5c3b64 100755 (executable)
@@ -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'
index c9b3bdd1bd66b2a4bb94d379dca77b7a0f197772..709b575f935bf84b7e5fcd48af9effb6d40a51d6 100755 (executable)
@@ -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
index 5b2ddfb3d86efacb87a7d35ac06b5f815f73497c..6028b0d92a7d6e7cdadbe8daa7966cbb10e0f98e 100644 (file)
@@ -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`
 
index 982310062df63a7a7411c6942e036828f9f0409f..7488f157a1641eaaa407aee92ed8e6e6b40c02e6 100755 (executable)
@@ -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()
index c192e20ddb567525a77fe1af219237fb33e628ee..79be0f64e35b75cddb5126e9fb5a1ac64515b33c 100755 (executable)
@@ -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,
index baf9379f537a52eba04713ee6aaea76f84b738ed..eadc11a5eab56479212fb4c528d1dc35cb5c3b64 100755 (executable)
@@ -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'
index c9b3bdd1bd66b2a4bb94d379dca77b7a0f197772..709b575f935bf84b7e5fcd48af9effb6d40a51d6 100755 (executable)
@@ -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
index 5b2ddfb3d86efacb87a7d35ac06b5f815f73497c..6028b0d92a7d6e7cdadbe8daa7966cbb10e0f98e 100644 (file)
@@ -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`
 
index 982310062df63a7a7411c6942e036828f9f0409f..7488f157a1641eaaa407aee92ed8e6e6b40c02e6 100755 (executable)
@@ -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()