Message196825
I'm thinking this may be overengineering, but I may as well post it and find out for sure. :-) Is it worth encapsulating MIME types? They're "really" pairs as far as mail handling applications are concerned, but they have a string representation. So
MacPorts 16:29$ python3.3
Python 3.3.2 (default, May 21 2013, 11:48:51)
>>> from collections import namedtuple
>>> class MIMEType(namedtuple('MIMETYPE', 'type subtype')):
... def __str__(self):
... return "{0}/{1}".format(self.type, self.subtype)
...
>>> mt = MIMEType('text', 'plain')
>>> str(mt)
'text/plain'
>>> t, s = mt
>>> print('type =', t, 'subtype =', s)
type = text subtype = plain
>>>
Obviously there needs to be a constructor that handles the 'type/sub' represention. |
|
Date |
User |
Action |
Args |
2013-09-03 07:37:53 | sjt | set | recipients:
+ sjt, barry, r.david.murray, serhiy.storchaka |
2013-09-03 07:37:53 | sjt | set | messageid: <1378193873.32.0.512757291377.issue18891@psf.upfronthosting.co.za> |
2013-09-03 07:37:53 | sjt | link | issue18891 messages |
2013-09-03 07:37:52 | sjt | create | |
|