[Zope] Experimental searchable mail list archive
The Dragon De Monsyne
dragondm@integral.org
Sun, 17 Oct 1999 03:51:51 -0500 (CDT)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---221137916-2036866673-940150311=:30786
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Thu, 7 Oct 1999, Ben Leslie wrote:
> Hi The!
>
> On Tue, 05 Oct 1999, The Dragon De Monsyne wrote:
>
> > On Tue, 28 Sep 1999, Michel Pelletier wrote:
> >
> > > Greetings,
> > >
> > > I finally got sick of paging through endless archive messages, so I
> > > implimented an expirimental searchable list archive:
> > >
> > > http://www.zope.org:12080/archives/Catalog/S
[snip]
> > Hmmm! Whaddayaknow! this is exactly what I've been working on!
> > I've been planning out a product called MessageBase to do this. I'm
> > sketching out the Message class right now. I'm planning on it having full
> > MIME suport. (one of the things I have gotten done so far is an imporved
> > version of python's mimetools module thast is actually compliant to the
> > MIME RFC's)
>
>
> Umm any chance you could send me a copy of these? I have been working on
> the NotMail product and have got it viewing MIME messages slightly better,
> however an improved mimetools would certainly make my life easier and code
> neater.
Sure! there was one more improvement I wanted to make, which is
why it took a few days to reply, here's the module.
-The Dragon De Monsyne
---221137916-2036866673-940150311=:30786
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="mimetools.py"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.96.991017035151.30786B@delta.integral.org>
Content-Description:
IyBWYXJpb3VzIHRvb2xzIHVzZWQgYnkgTUlNRS1yZWFkaW5nIG9yIE1JTUUt
d3JpdGluZyBwcm9ncmFtcy4NCg0KDQppbXBvcnQgb3MNCmltcG9ydCByZmM4
MjINCmltcG9ydCBzdHJpbmcNCmltcG9ydCB0ZW1wZmlsZQ0KZnJvbSBVc2Vy
RGljdCBpbXBvcnQgVXNlckRpY3QNCg0KIyBBIGRlcml2ZWQgY2xhc3Mgb2Yg
cmZjODIyLk1lc3NhZ2UgdGhhdC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PT0gJygnIGFuZCBsYXN0Y2hyIDw+J1xcJzoNCiAgICAg
ICAgICAgICAgICAgICAgY29tbWVudD1jb21tZW50KzENCiAgICAgICAgICAg
ICAgICBlbGlmIHRoaXNjaHIgPT0gJyknIGFuZCBsYXN0Y2hyIDw+J1xcJzoN
CiAgICAgICAgICAgICAgICAgICAgY29tbWVudD1jb21tZW50LTENCg0KICAg
ICAgICBlbGlmIHRoaXNjaHIgPT0nPScgOg0KCSAgICBpZiBsZW4ocCkgPjA6
DQogICAgICAgICAgICAgICAgaWYgcFstMV0gPT0gJyonOg0KICAgICAgICAg
ICAgICAgICAgICAjIHJmYyAyMjMxIGRlc2NyaWJlcyBkaWZmZXJlbnQgc2Vt
YW50aWNzIA0KICAgICAgICAgICAgICAgICAgICAjIGZvciBleHRlbmRlZCBw
YXJhbSB2YWx1ZXMuIEFtb25nc3Qgb3RoZXIgdGhpbmdzDQogICAgICAgICAg
ICAgICAgICAgICMgcXVvdGVkIHN0cmluZ3MgYXJlbid0IGFsbG93ZWQsIGJ1
dCAlIGVzY2FwZXMgYXJlLiAtZGRtDQogICAgICAgICAgICAgICAgICAgICNw
cmludCAiMjogJXMgJXMiICUgKHN0cihwKSxwWy0xXSkNCgkJICAgIGlzVmFs
dWU9Mg0KICAgICAgICAgICAgICAgIGVsc2U6DQogICAgICAgICAgICAgICAg
ICAgICNwcmludCAiMTogJXMgJXMiICUgKHN0cihwKSxwWy0xXSkNCiAgICAg
ICAgICAgICAgICAgICAgaXNWYWx1ZT0xDQoNCiAgICAgICAgZWxpZiB0aGlz
Y2hyPT0nIicgYW5kIGlzVmFsdWU9PTEgOg0KICAgICAgICAgICAgd2hpbGUg
cHN0cmxpc3Q6DQogICAgICAgICAgICAgICAgbGFzdGNociA9IHRoaXNjaHIN
CiAgICAgICAgICAgICAgICB0aGlzY2hyPXBzdHJsaXN0LnBvcCgpDQogICAg
ICAgICAgICAgICAgaWYgdGhpc2NociA9PSAnIicgYW5kIGxhc3RjaHI8Pidc
XCc6DQogICAgICAgICAgICAgICAgICAgIGJyZWFrDQogICAgICAgICAgICAg
ICAgaWYgdGhpc2NociA9PSAnXFwnIGFuZCBsYXN0Y2hyIDw+J1xcJzoNCiAg
ICAgICAgICAgICAgICAgICAgcGFzcw0KICAgICAgICAgICAgICAgIGVsc2U6
DQogICAgICAgICAgICAgICAgICAgIHYuYXBwZW5kKHRoaXNjaHIpDQoNCiAg
ICAgICAgZWxpZiB0aGlzY2hyPT0nJScgYW5kIGlzVmFsdWU9PTIgOg0KICAg
ICAgICAgICAgeGQxPScnDQogICAgICAgICAgICB4ZDI9JycNCiAgICAgICAg
ICAgIHRyeToNCiAgICAgICAgICAgICAgICB4ZDE9cHN0cmxpc3QucG9wKCkN
CiAgICAgICAgICAgICAgICB4ZDI9cHN0cmxpc3QucG9wKCkNCiAgICAgICAg
ICAgICAgICB0cnk6DQogICAgICAgICAgICAgICAgICAgIHYuYXBwZW5kKGNo
cihzdHJpbmcuYXRvaSh4ZDEreGQyLDE2KSkpDQogICAgICAgICAgICAgICAg
ZXhjZXB0IFZhbHVlRXJyb3I6DQogICAgICAgICAgICAgICAgICAgICNzb21l
IGJvZ3VzICUgZXNjYXBlID8/IA0KICAgICAgICAgICAgICAgICAgICAjIG1l
YmJlIHNvbWVvbmUgZmVyZ290IHRvIHF1b3RlIHNvbWV0aGluZyAgICANCiAg
ICAgICAgICAgICAgICAgICAgIyBwYXNzIGl0IGFzIGl0LiAtZGRtDQogICAg
ICAgICAgICAgICAgICAgIHYuYXBwZW5kKCclJykNCiAgICAgICAgICAgICAg
ICAgICAgdi5hcHBlbmQoeGQxKQ0KICAgICAgICAgICAgICAgICAgICB2LmFw
cGVuZCh4ZDIpDQogICAgICAgICAgICAgICAgbGFzdGNocj14ZDINCiAgICAg
ICAgICAgIGV4Y2VwdCBJbmRleEVycm9yOg0KICAgICAgICAgICAgICAgICNi
bGFnaC4gU29tZXRoaW5nIGdvdCB0cnVuY2F0ZWQsIG9yIGJhZCAlIGVzY2Fw
ZQ0KICAgICAgICAgICAgICAgICNwYXNzIGFzLWlzIC1kZG0NCiAgICAgICAg
ICAgICAgICB2LmFwcGVuZCgnJScpDQogICAgICAgICAgICAgICAgbGFzdGNo
cj0nJScNCiAgICAgICAgICAgICAgICBpZiB4ZDE6DQogICAgICAgICAgICAg
ICAgICAgIHYuYXBwZW5kKHhkMSkNCiAgICAgICAgICAgICAgICAgICAgbGFz
dGNocj14ZDENCiAgICAgICAgZWxpZiB0aGlzY2hyIGluIHN0cmluZy53aGl0
ZXNwYWNlOg0KICAgICAgICAgICAgcGFzcw0KICAgICAgICBlbHNlOg0KICAg
ICAgICAgICAgaWYgaXNWYWx1ZToNCiAgICAgICAgICAgICAgICB2LmFwcGVu
ZCh0aGlzY2hyKQ0KICAgICAgICAgICAgZWxzZToNCiAgICAgICAgICAgICAg
ICBwLmFwcGVuZCh0aGlzY2hyKQ0KDQogICAgcHBzdHI9c3RyaW5nLmxvd2Vy
KHN0cmluZy5zdHJpcChzdHJpbmcuam9pbihwLCcnKSkpDQogICAgdnBzdHI9
c3RyaW5nLmpvaW4odiwnJykNCiAgICBpZiBwcHN0cjoNCiAgICAgICAgcGFy
YW1zW3Bwc3RyXT12cHN0cg0KICAgIGZwYXJhbXM9e30NCiAgICAjdW5kbyAg
cmZjMjIzMSBwYXJhbSBmb2xkaW5nLiAtZGRtDQogICAgZm9yIGVhY2ggaW4g
cGFyYW1zLmtleXMoKTogICAgDQogICAgICAgaWYgZWFjaFstMV09PScqJzoN
CiAgICAgICAgICAgcGFyYW1uYW1lPWVhY2hbOi0xXQ0KICAgICAgIGVsc2U6
DQogICAgICAgICAgIHBhcmFtbmFtZT1lYWNoDQogICAgICAgaWYgJyonIGlu
IHBhcmFtbmFtZToNCiAgICAgICAgICAgcGw9c3RyaW5nLnNwbGl0KHBhcmFt
bmFtZSwnKicsMSkNCiAgICAgICAgICAgaWYgbGVuKHBsKSA8PjI6DQogICAg
ICAgICAgICAgICBicmVhaw0KICAgICAgICAgICB0cnk6DQogICAgICAgICAg
ICAgICBwYXJhbW51bT1zdHJpbmcuYXRvaShwbFsxXSwxMCkNCiAgICAgICAg
ICAgZXhjZXB0IFZhbHVlRXJyb3I6DQogICAgICAgICAgICAgICBwYXNzDQog
ICAgICAgICAgIGVsc2U6DQoJICAgICAgIGlmIHBhcmFtbnVtPT0wOg0KCSAg
ICAgICAgICAgaWYgZWFjaFstMV09PScqJzogDQogICAgICAgICAgICAgICAg
ICAgICAgIGlmIG5vdCBmcGFyYW1zLmhhc19rZXkocGxbMF0rIioiKToNCgkJ
ICAgICAgICAgICBpZiBmcGFyYW1zLmhhc19rZXkocGxbMF0pOg0KICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIGZwYXJhbXNbcGxbMF0rIioiXT1m
cGFyYW1zW3BsWzBdXQ0KCQkJICAgICAgIGRlbCBmcGFyYW1zW3BsWzBdXQ0K
CQkJICAgZWxzZToNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBm
cGFyYW1zW3BsWzBdKyIqIl09e30NCgkJICAgICAgIGZwYXJhbXNbcGxbMF0r
JyonXVswXT1wYXJhbXNbZWFjaF0NCiAJCSAgIGVsc2U6DQogICAgICAgICAg
ICAgICAgICAgICAgIGlmIG5vdCBmcGFyYW1zLmhhc19rZXkocGxbMF0pOg0K
ICAgICAgICAgICAgICAgICAgICAgICAgICAgZnBhcmFtc1twbFswXV09e30N
CgkJICAgICAgIGZwYXJhbXNbcGxbMF1dWzBdPXBhcmFtc1tlYWNoXQ0KICAg
ICAgICAgICAgICAgZWxzZToNCiAgICAgICAgICAgICAgICAgICBpZiBmcGFy
YW1zLmhhc19rZXkocGxbMF0rJyonKToNCiAgICAgICAgICAgICAgICAgICAg
ICAgZnBhcmFtc1twbFswXSsnKiddW3BhcmFtbnVtXT1wYXJhbXNbZWFjaF0N
CgkJICAgZWxzZToNCiAgICAgICAgICAgICAgICAgICAgICAgaWYgbm90IGZw
YXJhbXMuaGFzX2tleShwbFswXSk6D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