[mod_python] how to handle xforms with publisher handler

Emiliano Moscato moski666 at gmail.com
Wed Jan 24 12:09:38 EST 2007


Hi, I'm sorry, I've forgot to send this lines:

        # figure out boundary
        try:
            i = ctype.lower().rindex("boundary=")
            end = set([ctype.find(';', i+9), ctype.find(' ', i+9)])
            end.discard(-1)
            if len(end) > 0:
                boundary = ctype[i+9:min(list(end))]
            else:
                boundary = ctype[i+9:]
            boundary_str = boundary
            if len(boundary) >= 2 and boundary[0] == boundary[-1] == '"':
                boundary = boundary[1:-1]
            boundary = re.compile("--" + re.escape(boundary) + "(--)?\r?\n")


        except ValueError:
            raise apache.SERVER_RETURN, apache.HTTP_BAD_REQUEST


Is a little long, but I didn't find a shorter way.

Graham et all, I'm interested on the another tip (how to treat xml dom
models), I'd like to know your opinion about my opinion sent with the first
bugfix. I'd like to use mod_python (and publisher handler if possible) in
our framework.
Thanks

Emiliano

2007/1/17, Graham Dumpleton <grahamd at dscpl.com.au>:
>
> Emiliano Moscato wrote ..
> > Hi;
> >
> > I've followed my tiny work with FieldStorage.
> > I changed the line:
> >             boundary = ctype[i+9:]
> > for:
> >             boundary = ctype[i+9:ctype.find(';',i+9)]
> > to fix the problem with boundary.
>
> I don't think this will always work. Where there is no semicolon then the
> result would be:
>
>   boundary = ctype[i+9:-1]
>
> This would have the affect of dropping off the last character in the value
> which may be part of the boundary tag or the quote which might surround
> it.
>
> Graham
>
>
> > I've tried to use this method without any other change to FieldStorage
> > and
> > works. I only need this bugfix and it is a good new for me.
> > On the other hand, I was thinking about the matter with
> "application/xml"
> > serialize method and the name of the method says all: who uses
> > "application/xml" as serialize method waits in the server for an xml
> > document, not for its mapping to a dict, and it have nothing to do with
> > xforms.
> > For example: cherryPy, where I come from, uses the same philosophy of
> put
> > the form fields as attributes of an object, but when it receives an
> > "application/xml" puts it available in "threadData" attribute.
> > Thanks for the attention :)
> >
> > Emiliano
> >
>


-- 
mOsKi
"No hay nada que uno haga mal , lo que hay es poco vino." Autor Anonimo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20070124/82705a61/attachment.html


More information about the Mod_python mailing list