[Zope] WorldPilot "patch" for MS-Exhange (long)

Andrew Kenneth Milton akm@mail.theinternet.com.au
Sat, 29 Jan 2000 08:23:55 +1000 (EST)


In WPUtil.py replace stock CreateStruct with this one:-

I'd post a patch, but, it seems my editor removed all the ^M's... so
the patch is the same size.
Basically the last

                else:
                    line=""
                    newrec=0

is the addition.

Nested Folders look screwy, but, I assume this is an exchange thing...

Anyway I've played with this patch and our Exchange server for a few hours
and it seems to be stable, no more 100% CPU usage.. :-)

It might help against the WU-Imap as well.

------------------------------------------------------------------------

def CreateStruct(data):
    j=0;
    c=[]
    s=[c]
    newrec=1
    while data:
        if newrec:
            c=s[0]
            n=[]
            c.append(n)
            c=n
        newrec=1
        if type(data[0])==type(()):
            conts=data[0]
        else:
            conts=[data[0]]
        data=data[1:]
        while conts:
            line=conts[0]
            conts=conts[1:]
            while line!="":
                m=QuotedString.match(line)
                if m:
                    c.append(m.group('String'))
                    line=m.group('Rest')
                    continue
                m=ListOpen.match(line)
                if m:
                    n=[]
                    c.append(n)
                    s.append(c)
                    c=n
                    line=m.group('Rest')
                    continue
                m=ListClose.match(line)
                if m:
                    c=s[-1]
                    s=s[:-1]
                    line=m.group('Rest')
                    continue
                m=NIL.match(line)
                if m:
                    c.append(None)
                    line=m.group('Rest')
                    continue
                m=Number.match(line)
                if m:
                    c.append(int(m.group('Number')))
                    line=m.group('Rest')
                    continue
                m=Atom.match(line)
                if m:
                    c.append(m.group('Atom'))
                    line=m.group('Rest')
                    continue
                m=LiteralString.match(line)
                if m:
                    try:    
                        line=conts[0]
                        conts=conts[1:]
                        c.append(line)
                    except:
                        pass
                    line=""
                    newrec=0
                    continue
                else:
                    line=""
                    newrec=0
    c=s[0]
    return c


-- 
Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew Milton
The Internet (Aust) Pty Ltd          |  F:+61 7 3870 4477   | 
ACN: 082 081 472                     |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068    |akm@theinternet.com.au|