diff options
| -rw-r--r-- | Mailman/htmlformat.py | 19 | ||||
| -rw-r--r-- | modules/htmlformat.py | 19 |
2 files changed, 16 insertions, 22 deletions
diff --git a/Mailman/htmlformat.py b/Mailman/htmlformat.py index 72a6a53b9..c2e568deb 100644 --- a/Mailman/htmlformat.py +++ b/Mailman/htmlformat.py @@ -8,16 +8,13 @@ import string, types # Format an arbitrary object. def HTMLFormatObject(item, indent): -## try: - if type(item) == type(''): - return item - if type(item) == type(2): - return `item` - + "Return a presentation of an object, invoking their Format method if any." + if type(item) == type(''): + return item + elif not hasattr(item, "Format"): + return `item` + else: return item.Format(indent) -## except: -## return `item` - def CaseInsensitiveKeyedDict(d): result = {} @@ -320,9 +317,9 @@ class Form(Container): class InputObj: - def __init__(self, name, type, value, checked, **kws): + def __init__(self, name, ty, value, checked, **kws): self.name = name - self.type = type + self.type = ty self.value = `value` self.checked = checked self.kws = kws diff --git a/modules/htmlformat.py b/modules/htmlformat.py index 72a6a53b9..c2e568deb 100644 --- a/modules/htmlformat.py +++ b/modules/htmlformat.py @@ -8,16 +8,13 @@ import string, types # Format an arbitrary object. def HTMLFormatObject(item, indent): -## try: - if type(item) == type(''): - return item - if type(item) == type(2): - return `item` - + "Return a presentation of an object, invoking their Format method if any." + if type(item) == type(''): + return item + elif not hasattr(item, "Format"): + return `item` + else: return item.Format(indent) -## except: -## return `item` - def CaseInsensitiveKeyedDict(d): result = {} @@ -320,9 +317,9 @@ class Form(Container): class InputObj: - def __init__(self, name, type, value, checked, **kws): + def __init__(self, name, ty, value, checked, **kws): self.name = name - self.type = type + self.type = ty self.value = `value` self.checked = checked self.kws = kws |
