From ydavis@example.org Sun May 1 08:29:34 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 32926 invoked by uid 99); 1 May 2005 08:29:34 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ydavis@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 01:29:34 -0700 Received: by rproxy.gmail.com with SMTP id y7so912733rne for <ydavis@example.org>; Sun, 01 May 2005 01:28:07 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rJ7OhPdPLvAMkIUnQ4iJK3aMt4DXJzpDZ/h4fjIzJY1A9EsrYrXo7jEuMwEZZDKCv0MAgwx4MkvSynWOmjw59kMNnzgne+bK+pQPWKHsDWIDapUWS+H+sL8vY44Shifki+jbqAB03hvbacpET+DttNAsgbWv8RZ59zuXbaLlgFc= Received: by 83.161.120.155 with SMTP id 1mr5235479rnn; Sun, 01 May 2005 01:28:07 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Sun, 1 May 2005 01:28:07 -0700 (PDT) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 10:28:07 +0200 From: Nicolas Lehuen <ydavis@example.org> Reply-To: ydavis@example.org To: Jim Gallacher <ydavis@example.org> Subject: Re: [jira] Commented: (MODPYTHON-45) Implement a file-based session manager Cc: ydavis@example.org In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <{{EMAIL+PHONE}}> <ydavis@example.org> X-Virus-Checked: Checked Well, Google gives good results for tutorials and FAQs - but make sure you're not using Google Images ;-). Regards Nicolas On 4/30/05, Jim Gallacher <ydavis@example.org> wrote: > Nicolas Lehuen (JIRA) wrote: > > [ http://issues.apache.org/jira/browse/MODPYTHON-45?page=3Dcomment= s#action_64138 ] > > > > Nicolas Lehuen commented on MODPYTHON-45: > > ----------------------------------------- > > > > OK, I have integrated FileSession into Session.py (it previously was in= its own module FileSession.py). Now we need a bit of documentation... > > >=20 > I'm on it. Will post sometime Sunday. I haven't played with latex before > though - can anyone point me to a good quick and dirty tutorial? Or I > could just use google. :) >=20 > Regards, > Jim > From ydavis@example.org Sun May 1 08:31:37 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 34290 invoked by uid 99); 1 May 2005 08:31:37 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ydavis@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 01:31:37 -0700 Received: by rproxy.gmail.com with SMTP id y7so912799rne for <ydavis@example.org>; Sun, 01 May 2005 01:30:11 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UdAHVGTDQc0SkG2gDMVS62Jq+/i8R0i3EJ3nGLiE/6GpX9vgsm3M37bSXgxH1f7LbEBZ2MTPGgMXKFE/ljZ5nabEbYBzkzXpQjSu9R28zHmCY1SntjEDe8FgfEXZ7t7r8/iHEu6xFhrxpS+tZa4J7+XClvi0Xih27WYPr26iVEQ= Received: by 83.161.120.155 with SMTP id x26mr5207845rna; Sun, 01 May 2005 01:30:11 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Sun, 1 May 2005 01:30:11 -0700 (PDT) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 10:30:11 +0200 From: Nicolas Lehuen <ydavis@example.org> Reply-To: ydavis@example.org To: Jim Gallacher <ydavis@example.org> Subject: Re: release? FileSession.py Cc: "Gregory (Grisha) Trubetskoy" <ydavis@example.org>, dharana <ydavis@example.org>, ydavis@example.org In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> X-Virus-Checked: Checked Wooops, I've integrated FileSession.py into Session.py because I thought the subject was settled. Anyway, it's not so difficult to split it again. Only this time, I'll make sure that everyone agrees... Regards Nicolas On 4/30/05, Jim Gallacher <ydavis@example.org> wrote: > Gregory (Grisha) Trubetskoy wrote: > > > > On Thu, 28 Apr 2005, Nicolas Lehuen wrote: > > > >> OK so now I think we have a pretty good implementation of FileSession = :) > > > > > > Excellent - now who's in favor of splitting Session into multiple files > > versus rolling FileSession inti Session.py? >=20 > +1 for splitting. >=20 > > I'm thinking that if the Session.py is split, then same should be done > > with Cookie.py for consistency and that's too much changes when we are > > in a pre-release stage. >=20 > Agreed. Since this is mainly a bug fix release, except for FileSession, > I wouldn't shift things around too much. >=20 > > So I'm in favor of adding FileSession into Session.py for _this_ releas= e > > with the plan to consider splitting Session.py and Cookie.py later. >=20 > I'm not sure I like the idea of merging FileSession into Session and > then splitting it back out in a future release. This just does not seem > all that graceful. If the plan is to split Session, then start with > FileSession as it will not impact any current code. When the ultimate > future split occurs at least some application code will not be broken. >=20 > Regards, > Jim > From ydavis@example.org Sun May 1 08:34:16 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 35970 invoked by uid 99); 1 May 2005 08:34:16 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ydavis@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 01:34:16 -0700 Received: by rproxy.gmail.com with SMTP id y7so912917rne for <ydavis@example.org>; Sun, 01 May 2005 01:32:50 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cL0aAPDmAM6Q4nyWAwRX3gpsMw39Zre+1TetZEWJ6vvf29InHhbNL7dtymVE+7mOJJa854+fvn5ncNhTQ50z0e2oI6UH5UbrvaWZwVCMu5z3WvaLp5GSxVI0Xqw08xl+eBL0WOZ85Vz7wMw4BcwnYp4ngZUyTDOae4DPPtqGRxw= Received: by 83.161.120.155 with SMTP id u4mr4706713rnb; Sun, 01 May 2005 01:32:50 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Sun, 1 May 2005 01:32:50 -0700 (PDT) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 10:32:50 +0200 From: Nicolas Lehuen <ydavis@example.org> Reply-To: ydavis@example.org To: Graham Dumpleton <ydavis@example.org> Subject: Re: mod_python.publisher : proposal for a few implementation changes Cc: ydavis@example.org In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> X-Virus-Checked: Checked Well, the Content-Encoding header is for HTTP content encoding, as explained in the RFC : http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html For example, the server can gzip the result page and set Content-Encoding to gzip. This is not related to the character encoding, which is given as the charset parameter of the Content-Type header. Regards, Nicolas On 4/30/05, Graham Dumpleton <ydavis@example.org> wrote: > Not too start this up again, but just for the record, wanted to add > that there > is the req.content_encoding encoding member. Not sure how this comes > into the > ydavis@example.org. Something to consider later. :-) >=20 > Graham >=20 > On 30/04/2005, at 9:35 PM, Nicolas Lehuen wrote: >=20 > > [Woops, forgot to put the list in the recipients.] > > > > I think in this case the default conversion used is UTF8. Ideally, a > > developer returning Unicode strings from functions should have a way > > to decide in what encoding (UTF-8, iso-latin-1, etc.) the string > > should be returned to the client. > > > > One possible way to do that would be to parse the content-type header, > > i.e. if the developer set the content type header to "text/html; > > charset=3Diso-8859-1", then we know the developer expect the result to > > be encoded in iso-8859-1, so we can do result =3D > > object.encode('iso-8859-1'). > > > > Here is some tentative code for this : > > > > re_charset =3D re.compile(r"charset\s*=3D\s*([^\s;]+)"); > > > > def publish_object(req, object): > > if callable(object): > > req.form =3D util.FieldStorage(req, keep_blank_values=3D1) > > return publish_object(req,util.apply_fs_data(object, req.form, > > req=3Dreq)) > > elif hasattr(object,'__iter__'): > > result =3D False > > for item in object: > > result |=3D publish_object(req,item) > > return result > > else: > > if object is None: > > return False > > elif isinstance(object,UnicodeType): > > # We try to detect the character encoding > > # from the Content-Type header > > if req._content_type_set: > > charset =3D re_charset.search(req.content_type) > > if charset: > > charset =3D charset.group(1) > > else: > > charset =3D 'UTF8' > > req.content_type +=3D '; charset=3DUTF8' > > else: > > charset =3D 'UTF8' > > > > result =3D object.encode(charset) > > else: > > result =3D str(object) > > > > [...] > > > > Regards, > > Nicolas > > > > On 4/30/05, Graham Dumpleton <ydavis@example.org> wrote: > >> > >> On 30/04/2005, at 6:37 PM, Nicolas Lehuen wrote: > >>> elif isinstance(object,UnicodeType): > >>> # TODO : this skips all encoding issues, which is VERY > >>> BAD > >>> # I don't even understand how the req.write below can > >>> work > >>> ! > >>> result =3D object > >>> else: > >>> result =3D str(object) > >> > >> What do you see is the issue that required an explicit check for > >> UnicodeType > >> and avoidance of converting it with str(). > >> > >> As the code is above, req.write() will be called with the > >> UnicodeObject. This > >> will work provided that the Unicode string can be converted into a > >> normal > >> string using the default encoding. Ie., in underlying C code > >> PyArg_ParseTuple > >> will use "s", meaning: > >> > >> "s" (string or Unicode object) [char *] > >> Convert a Python string or Unicode object to a C pointer to a > >> character > >> string. You must not provide storage for the string itself; a > >> pointer > >> to an existing string is stored into the character pointer variable > >> whose address you pass. The C string is null-terminated. The Python > >> string must not contain embedded null bytes; if it does, a > >> TypeError > >> exception is raised. Unicode objects are converted to C strings > >> using > >> the default encoding. If this conversion fails, an UnicodeError is > >> raised. > >> > >> I think though that applying str() in the Python code to the Unicode > >> string > >> probably yields the same result. Ie., str(u'123') results in encode() > >> method > >> of Unicode string object being called. > >> > >> S.encode([encoding[,errors]]) -> string > >> > >> Return an encoded string version of S. Default encoding is the current > >> default string encoding. errors may be given to set a different error > >> handling scheme. Default is 'strict' meaning that encoding errors > >> raise > >> a UnicodeEncodeError. Other possible values are 'ignore', 'replace' > >> and > >> 'xmlcharrefreplace' as well as any other name registered with > >> codecs.register_error that can handle UnicodeEncodeErrors. > >> > >> In other words, I don't believe there is any difference between > >> converting > >> it using str() before the call to req.write() as there is passing > >> Unicode > >> string direct to req.write(). Thus, explicit check for UnicodeType > >> probably > >> not required. > >> > >> Graham > >> > >> >=20 > From ydavis@example.org Sun May 1 09:34:21 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 80015 invoked by uid 99); 1 May 2005 09:34:21 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ydavis@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 02:34:20 -0700 Received: by rproxy.gmail.com with SMTP id y7so915702rne for <ydavis@example.org>; Sun, 01 May 2005 02:32:54 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=DwYLkslig8b1ZCn4fjPnhLOT2UaOcXOP9k1aKInsDCEfhAbSgMCiwEyEFah8AmTDSXEEdCBOMKm8DQBfap/OcLhzT0QPXOujlGyFdTcMC+u7KLKC7OGjFKwiYe5rpJmhdDsuUUQRPNHzfZxoQH+HCtmTt69MU26jFO8hZaXgBJY= Received: by 83.161.120.155 with SMTP id 30mr5210470rnk; Sun, 01 May 2005 02:32:54 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Sun, 1 May 2005 02:32:54 -0700 (PDT) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 11:32:54 +0200 From: Nicolas Lehuen <ydavis@example.org> Reply-To: ydavis@example.org To: Graham Dumpleton <ydavis@example.org> Subject: Re: mod_python.publisher : proposal for a few implementation changes Cc: ydavis@example.org In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1133_24821183.1114939974406" References: <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> X-Virus-Checked: Checked ------=_Part_1133_24821183.1114939974406 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline OK, I now have a proper implementation of my proposals, working with iterables, generators, new-style classes and old-style classes. Generators are especially fun, they allow you to write things like : def index(req): yield '<html><body>' yield greetings(req,'Nicolas') yield '</body></html>' def greetings(req,first_name): yield '<p>Hello, ' yield first_name yield '!</p>' I just had to modify apply_fs_data in util.py to allow new-style classes to be called (changing the test type(object) =3D ClassType to type(object) in (TypeType, ClassType)), and to rewrite publisher.py as enclosed. All unit tests run OK. The only problem, like you wrote, Graham, is that we have to change the traversal & publishing rules to allow old-style classes and new-style classes publishing. This may induce some problems if some developers thought their classes were safe from publishing. Ah, well, I guess we could only allow this for power users, I'll have a look at how we could add a PythonOption for this. For now, I've kept the current traversal & publishing rules, so this should not break anything. But as we are trying to make a 3.2 release, I'm not going to put this on the trunk. I'm building a branch named "experimental-publisher", and we'll merge it after the 3.2 release. Regards, Nicolas ------=_Part_1133_24821183.1114939974406 Content-Type: application/x-python; name="publisher.py" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="publisher.py" ICMKICMgQ29weXJpZ2h0IDIwMDQgQXBhY2hlIFNvZnR3YXJlIEZvdW5kYXRpb24gCiAjIAogIyBM aWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vu c2UiKTsgeW91CiAjIG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3 aXRoIHRoZSBMaWNlbnNlLiAgWW91CiAjIG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNl IGF0CiAjCiAjICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4w CiAjCiAjIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4g d3JpdGluZywgc29mdHdhcmUKICMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlz dHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKICMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENP TkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yCiAjIGltcGxpZWQuICBTZWUg dGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcKICMgcGVybWlz c2lvbnMg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AgcmVx LmZpbGVuYW1lID0gb3MucGF0aC5qb2luKHBhdGgsJ2luZGV4LnB5JykKCiAgICAgICAgIyBOb3cg d2UgYnVpbGQgdGhlIGZ1bmN0aW9uIHBhdGgKICAgICAgICBpZiBub3QgcmVxLnBhdGhfaW5mbyBv ciByZXEucGF0aF9pbmZvPT0nLyc6CgogICAgICAgICAgICAjIHdlIGRvbid0IGhhdmUgYSBwYXRo IGluZm8sIG9yIGl0J3MganVzdCBhIHNsYXNoLAogICAgICAgICAgICAjIHNvIHdlJ2xsIGNhbGwg aW5kZXgKICAgICAgICAgICAgZnVuY19wYXRoID0gJ2luZGV4JwoKICAgICAgICBlbHNlOgoKICAg ICAgICAgICAgIyB3ZSBoYXZlIGEgcGF0aF9pbmZvLCBzbyB3ZSB1c2UgaXQsIHJlbW92aW5nIHRo ZSBmaXJzdCBzbGFzaAogICAgICAgICAgICBmdW5jX3BhdGggPSByZXEucGF0aF9pbmZvWzE6XQog ICAgCiAgICBlbHNlOgogICAgICAgIAogICAgICAgICMgRmlyc3Qgd2UgY2hlY2sgaWYgdGhlcmUg aXMgYSBQeXRob24gbW9kdWxlIHdpdGggdGhhdCBuYW1lCiAgICAgICAgIyBqdXN0IGJ5IGFkZGlu ZyBhIC5weSBleHRlbnNpb24KICAgICAgICBpZiBvcy5wYXRoLmlzZmlsZShyZXEuZmlsZW5hbWUr Jy5weScpOgoKICAgICAgICAgICAgcmVxLmZpbGVuYW1lICs9ICcucHknCiAgICAgICAgICAgIAog ICAgICAgICAgICAjIE5vdyB3ZSBidWlsZCB0aGUgZnVuY3Rpb24gcGF0aAogICAgICAgICAgICBp ZiBub3QgcmVxLnBhdGhfaW5mbyBvciByZXEucGF0aF9pbmZvPT0nLyc6CiAgICAKICAgICAgICAg ICAgICAgICMgd2UgZG9uJ3QgaGF2ZSBhIHBhdGggaW5mbywgb3IgaXQncyBqdXN0IGEgc2xhc2gs CiAgICAgICAgICAgICAgICAjIHNvIHdlJ2xsIGNhbGwgaW5kZXgKICAgICAgICAgICAgICAgIGZ1 bmNfcGF0aCA9ICdpbmRleCcKICAgIAogICAgICAgICAgICBlbHNlOgogICAgCiAgICAgICAgICAg ICAgICAjIHdlIGhhdmUgYSBwYXRoX2luZm8sIHNvIHdlIHVzZSBpdCwgcmVtb3ZpbmcgdGhlIGZp cnN0IHNsYXNoCiAgICAgICAgICAgICAgICBmdW5jX3BhdGggPSByZXEucGF0aF9pbmZvWzE6XQog ICAgICAgIGVsc2U6CgogICAgICAgICAgICAjIFRoZSBmaWxlIGRvZXMgbm90IGV4aXN0LCBzbyBp dCBzZWVtcyB3ZSBhcmUgaW4gdGhlIAogICAgICAgICAgICAjIGNhc2Ugb2YgYSByZXF1ZXN0IGlu IHRoZSBmb3JtIDoKICAgICAgICAgICAgIyAvZGlyZWN0b3J5L2Z1bmNfcGF0aAogICAgCiAgICAg ICAgICAgICMgd2UnbGwganVzdCBpbnNlcnQgdGhlIG1vZHVsZSBuYW1lIGluZGV4LnB5IGluIHRo ZSBtaWRkbGUKICAgICAgICAgICAgcGF0aCwgZnVuY19wYXRoID0gb3MucGF0aC5zcGxpdChyZXEu ZmlsZW5hbWUpCiAgICAgICAgICAgIHJlcS5maWxlbmFtZSA9IG9zLnBhdGguam9pbihwYXRoLCdp bmRleC5weScpCiAgICAKICAgICAgICAgICAgIyBJIGRvbid0IGtub3cgaWYgaXQncyBzdGlsbCBw b3NzaWJsZSB0byBoYXZlIGEgcGF0aF9pbmZvCiAgICAgICAgICAgICMgYnV0IGlmIHdlIGhhdmUg b25lLCB3ZSBhcHBlbmQgaXQgdG8gdGhlIGZpbGVuYW1lIHdoaWNoCiAgICAgICAgICAgICMgaXMg Y29uc2lkZXJlZCBhcyBhIHBhdGhfaW5mby4KICAgICAgICAgICAgaWYgcmVxLnBhdGhfaW5mbzoK ICAgICAgICAgICAgICAgIGZ1bmNfcGF0aCA9IGZ1bmNfcGF0aCArIHJlcS5wYXRoX2luZm8KCiAg ICAjIE5vdyB3ZSB0dXJu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X2F1dGhfcmVhbG1fXyIpOgog ICAgICAgIHJlYWxtID0gb2JqZWN0Ll9fYXV0aF9yZWFsbV9fCgogICAgaWYgdHlwZShvYmplY3Qp IGlzIEZ1bmN0aW9uVHlwZToKICAgICAgICAjIGZ1bmN0aW9ucyBhcmUgYSBiaXQgdHJpY2t5Cgog ICAgICAgIGlmIGhhc2F0dHIob2JqZWN0LCAiZnVuY19jb2RlIik6CiAgICAgICAgICAgIGZ1bmNf Y29kZSA9IG9iamVjdC5mdW5jX2NvZGUKCiAgICAgICAgICAgIGlmICJfX2F1dGhfXyIgaW4gZnVu Y19jb2RlLmNvX25hbWVzOgogICAgICAgICAgICAgICAgaSA9IGxpc3QoZnVuY19jb2RlLmNvX25h bWVzKS5pbmRleCgiX19hdXRoX18iKQogICAgICAgICAgICAgICAgX19hdXRoX18gPSBmdW5jX2Nv ZGUuY29fY29uc3RzW2krMV0KICAgICAgICAgICAgICAgIGlmIGhhc2F0dHIoX19hdXRoX18sICJj b19uYW1lIik6CiAgICAgICAgICAgICAgICAgICAgX19hdXRoX18gPSBuZXcuZnVuY3Rpb24oX19h dXRoX18sIGdsb2JhbHMoKSkKICAgICAgICAgICAgICAgIGZvdW5kX2F1dGggPSAxCgogICAgICAg ICAgICBpZiAiX19hY2Nlc3NfXyIgaW4gZnVuY19jb2RlLmNvX25hbWVzOgogICAgICAgICAgICAg ICAgIyBmaXJzdCBjaGVjayB0aGUgY29uc3RhbnQgbmFtZXMKICAgICAgICAgICAgICAgIGkgPSBs aXN0KGZ1bmNfY29kZS5jb19uYW1lcykuaW5kZXgoIl9fYWNjZXNzX18iKQogICAgICAgICAgICAg ICAgX19hY2Nlc3NfXyA9IGZ1bmNfY29kZS5jb19jb25zdHNbaSsxXQogICAgICAgICAgICAgICAg aWYgaGFzYXR0cihfX2FjY2Vzc19fLCAiY29fbmFtZSIpOgogICAgICAgICAgICAgICAgICAgIF9f YWNjZXNzX18gPSBuZXcuZnVuY3Rpb24oX19hY2Nlc3NfXywgZ2xvYmFscygpKQogICAgICAgICAg ICAgICAgZm91bmRfYWNjZXNzID0gMQoKICAgICAgICAgICAgaWYgIl9fYXV0aF9yZWFsbV9fIiBp biBmdW5jX2NvZGUuY29fbmFtZXM6CiAgICAgICAgICAgICAgICBpID0gbGlzdChmdW5jX2NvZGUu Y29fbmFtZXMpLmluZGV4KCJfX2F1dGhfcmVhbG1fXyIpCiAgICAgICAgICAgICAgICByZWFsbSA9 IGZ1bmNfY29kZS5jb19jb25zdHNbaSsxXQoKICAgIGVsc2U6CiAgICAgICAgaWYgaGFzYXR0cihv YmplY3QsICJfX2F1dGhfXyIpOgogICAgICAgICAgICBfX2F1dGhfXyA9IG9iamVjdC5fX2F1dGhf XwogICAgICAgICAgICBmb3VuZF9hdXRoID0gMQogICAgICAgIGlmIGhhc2F0dHIob2JqZWN0LCAi X19hY2Nlc3NfXyIpOgogICAgICAgICAgICBfX2FjY2Vzc19fID0gb2JqZWN0Ll9fYWNjZXNzX18K ICAgICAgICAgICAgZm91bmRfYWNjZXNzID0gMQoKICAgIGlmIGZvdW5kX2F1dGg6CgogICAgICAg IGlmIG5vdCB1c2VyOgogICAgICAgICAgICAjIG5vdGUgdGhhdCBPcGVyYSBzdXBwb3NlZGx5IGRv ZXNuJ3QgbGlrZSBzcGFjZXMgYXJvdW5kICI9IiBiZWxvdwogICAgICAgICAgICBzID0gJ0Jhc2lj IHJlYWxtPSIlcyInICUgcmVhbG0KICAgICAgICAgICAgcmVxLmVycl9oZWFkZXJzX291dFsiV1dX LUF1dGhlbnRpY2F0ZSJdID0gcwogICAgICAgICAgICByYWlzZSBhcGFjaGUuU0VSVkVSX1JFVFVS TiwgYXBhY2hlLkhUVFBfVU5BVVRIT1JJWkVEICAgIAoKICAgICAgICBpZiBjYWxsYWJsZShfX2F1 dGhfXyk6CiAgICAgICAgICAgIHJjID0gX19hdXRoX18ocmVxLCB1c2VyLCBwYXNzd2QpCiAgICAg ICAgZWxzZToKICAgICAgICAgICAgaWYgdHlwZShfX2F1dGhfXykgaXMgRGljdGlvbmFyeVR5cGU6 CiAgICAgICAgICAgICAgICByYyA9IF9fYXV0aF9fLmhhc19rZXkodXNlcikgYW5kIF9fYXV0aF9f W3VzZXJdID09IHBhc3N3ZAogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgcmMgPSBf X2F1dGhfXwogICAgICAgICAgICAKICAgICAgICBpZiBub3QgcmM6CiAgICAgICAgICAgIHMgPSAn QmFzaWMgcmVhbG0gPSAiJXMiJyAlIHJlYWxtCiAgICAgICAgICAgIHJlcS5lcnJfaGVhZGVyc19v dXRbIldXVy1BdXRoZW50aWNhdGUiXSA9IHMKICAgICAgICAgICAgcmFpc2UgYXBhY2hlLlNFUlZF Ul9SRVRVUk4sIGFwYWNoZS5IVFRQX1VOQVVUSE9SSVpFRCAgICAKCiAgICBpZiBmb3VuZF9hY2Nl c3M6CgogICAgICAgIGlmIGNhbGxhYmxlKF9fYWNjZXNzX18pOgogICAgICAgICAgICByYyA9IF9f YWNjZXNzX18ocmVxLCB1c2VyKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIGlmIHR5cGUoX19h Y2Nlc3NfXykgaW4gKExpc3RUeXBlLCBUdXBsZVR5cGUpOgogICAgICAgICAgICAgICAgcmMgPSB1 c2VyIGluIF9fYWNjZXNzX18KICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIHJjID0g X19hY2Nlc3NfXwoKICAgICAgICBpZiBub3QgcmM6CiAgICAgICAgICAgIHJhaXNlIGFwYWNoZS5T RVJWRVJfUkVUVVJOLCBhcGFjaGUuSFRUUF9GT1JCSURERU4KCiAgICByZXR1cm4gcmVhbG0sIHVz ZXIsIHBhc3N3ZAoKIyMjIFRob3NlIGFyZSB0aGUgdHJhdmVyc2FsIGFuZCBwdWJsaXNoaW5nIHJ1 bGVzICMjIwoKIyB0cF9ydWxlcyBpcyBhIGRpY3Rpb25hcnksIGluZGV4ZWQgYnkgdHlwZSwgd2l0 aCB0dXBsZ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YXJlIGZvcmJpZGRlbgogICAgICAgIGlmIG9ial9zdHJbMF09PSdfJzoKICAgICAgICAg ICAgcmVxLmxvZ19lcnJvcignQ2Fubm90IHRyYXZlcnNlICVzIGluICVzIGJlY2F1c2UgJwogICAg ICAgICAgICAgICAgICAgICAgICAgICdpdCBzdGFydHMgd2l0aCBhbiB1bmRlcnNjb3JlJwogICAg ICAgICAgICAgICAgICAgICAgICAgICUgKG9ial9zdHIsIHJlcS51bnBhcnNlZF91cmkpLCBhcGFj aGUuQVBMT0dfV0FSTklORykKICAgICAgICAgICAgcmFpc2UgYXBhY2hlLlNFUlZFUl9SRVRVUk4s IGFwYWNoZS5IVFRQX0ZPUkJJRERFTgoKICAgICAgICAjIGlmIHdlJ3JlIG5vdCBpbiB0aGUgZmly c3Qgb2JqZWN0ICh3aGljaCBpcyB0aGUgbW9kdWxlKQogICAgICAgIGlmIGk+MDoKICAgICAgICAK ICAgICAgICAgICAgIyB3ZSdyZSBnb2luZyB0byBjaGVjayB3aGV0aGVyIGJlIGNhbiB0cmF2ZXJz ZSB0aGlzIHR5cGUgb3Igbm90CiAgICAgICAgICAgIHJ1bGUgPSB0cF9ydWxlcy5nZXQodHlwZShv YmopLCBkZWZhdWx0X3RwX3J1bGUpCiAgICAgICAgICAgIGlmIG5vdCBydWxlWzBdOgogICAgICAg ICAgICAgICAgcmVxLmxvZ19lcnJvcignQ2Fubm90IHRyYXZlcnNlICVzIGluICVzIGJlY2F1c2Ug JwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnJXMgaXMgbm90IGEgdHJhdmVyc2FibGUg b2JqZWN0JwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAlIChvYmpfc3RyLCByZXEudW5w YXJzZWRfdXJpLCBvYmopLCBhcGFjaGUuQVBMT0dfV0FSTklORykKICAgICAgICAgICAgICAgIHJh aXNlIGFwYWNoZS5TRVJWRVJfUkVUVVJOLCBhcGFjaGUuSFRUUF9GT1JCSURERU4KICAgICAgICAK ICAgICA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gICBpZiByZXEu X2NvbnRlbnRfdHlwZV9zZXQ6CiAgICAgICAgICAgICAgICBjaGFyc2V0ID0gcmVfY2hhcnNldC5z ZWFyY2gocmVxLmNvbnRlbnRfdHlwZSkKICAgICAgICAgICAgICAgIGlmIGNoYXJzZXQ6CiAgICAg ICAgICAgICAgICAgICAgY2hhcnNldCA9IGNoYXJzZXQuZ3JvdXAoMSkKICAgICAgICAgICAgICAg IGVsc2U6CiAgICAgICAgICAgICAgICAgICAgY2hhcnNldCA9ICdVVEY4JwogICAgICAgICAgICAg ICAgICAgIHJlcS5jb250ZW50X3R5cGUgKz0gJzsgY2hhcnNldD1VVEY4JwogICAgICAgICAgICBl bHNlOgogICAgICAgICAgICAgICAgY2hhcnNldCA9ICdVVEY4JwogICAgICAgICAgICAgICAgCiAg ICAgICAgICAgIHJlc3VsdCA9IG9iamVjdC5lbmNvZGUoY2hhcnNldCkKICAgICAgICBlbHNlOgog ICAgICAgICAgICBjaGFyc2V0ID0gTm9uZQogICAgICAgICAgICByZXN1bHQgPSBzdHIob2JqZWN0 KQogICAgICAgICAgICAKICAgICAgICBpZiBub3QgcmVxLl9jb250ZW50X3R5cGVfc2V0OgogICAg ICAgICAgICAjIG1ha2UgYW4gYXR0ZW1wdCB0byBndWVzcyBjb250ZW50LXR5cGUKICAgICAgICAg ICAgIyB3ZSBsb29rIGZvciBhIDwvSFRNTCBpbiB0aGUgbGFzdCAxMDAgY2hhcmFjdGVycy4KICAg ICAgICAgICAgIyByZS5zZWFyY2ggd29ya3MgT0sgd2l0aCBhIG5lZ2F0aXZlIHN0YXJ0IGluZGV4 IChpdCBzdGFydHMgZnJvbSAwCiAgICAgICAgICAgICMgaW4gdGhhdCBjYXNlKQogICAgICAgICAg ICBpZiByZV9odG1sLnNlYXJjaChyZXN1bHQsbGVuKHJlc3VsdCktMTAwKToKICAgICAgICAgICAg ICAgIHJlcS5jb250ZW50X3R5cGUgPSAndGV4dC9odG1sJwogICAgICAgICAgICBlbHNlOgogICAg ICAgICAgICAgICAgcmVxLmNvbnRlbnRfdHlwZSA9ICd0ZXh0L3BsYWluJwogICAgICAgICAgICBp ZiBjaGFyc2V0IGlzIG5vdCBOb25lOgogICAgICAgICAgICAgICAgcmVxLmNvbnRlbnRfdHlwZSAr PSAnOyBjaGFyc2V0PVVURjgnCiAgICAgICAgCiAgICAgICAgaWYgcmVxLm1ldGhvZCE9J0hFQUQn OgogICAgICAgICAgICByZXEud3JpdGUocmVzdWx0KQoKICAgICAgICByZXR1cm4gVHJ1ZQo= ------=_Part_1133_24821183.1114939974406-- From ydavis@example.org Sun May 1 09:48:43 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 91216 invoked by uid 99); 1 May 2005 09:48:43 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from user.openhosting.com (HELO dscpl.user.openhosting.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 02:48:43 -0700 Received: from [83.161.120.155] (ppp205-29.lns1.syd3.internode.on.net [83.161.120.155]) by dscpl.user.openhosting.com (8.12.11/8.12.11) with ESMTP id j419lFY7031854; Sun, 1 May 2005 05:47:15 -0400 In-Reply-To: <ydavis@example.org> References: <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <ydavis@example.org> Content-Transfer-Encoding: 7bit Cc: ydavis@example.org From: Graham Dumpleton <ydavis@example.org> Subject: Re: mod_python.publisher : proposal for a few implementation changes Date: Sun, 1 May 2005 19:47:12 +1000 To: ydavis@example.org X-Mailer: Apple Mail (2.619.2) X-Virus-Checked: Checked I note you send something about new and old style classes just as I was about to send this, so you may find my approach interesting or not. On 30/04/2005, at 9:34 PM, Nicolas Lehuen wrote: > BTW, the more I'm looking at this, the more I think we should keep > this for mod_python 3.3 or something. I think we need to converge on > mod_python 3.2 to make a release soon. > > I'm trying things for now so that we can discuss it, but I'm not going > to integrate them into the subversion trunk, so that we can keep on > preparing the 3.2 release. Maybe I'll create a branch for it and merge > my changes back after the 3.2 release. FWIW, I have added a new wrapper class into my working version of Vampire which provides a mechanism to trigger the creation of an instance of a class and for the class instance to then be called. Ie., import vampire import time class OldStyleClass: def __init__(self): self.__time = time.time() def __call__(self,req,arg1=None,arg2=None): return self.__time,"OldStyleClass.__call__()",arg1,arg2 old_instance = vampire.Instance(OldStyleClass) class NewStyleClass(object): def __init__(self): self.__time = time.time() def __call__(self,req,arg1=None,arg2=None): return self.__time,"NewStyleClass.__call__()",arg1,arg2 new_instance = vampire.Instance(NewStyleClass) It isn't recursive like you had planned. Ie., if "__call__()" returns an object which is callable, it does not in turn call that. Mainly don't do this as can't think of a practical purpose for it. The actual code for me to implement this class was quite simple: class Instance: def __init__(self,target): self.__target = target def __call__(self,req): if not type(self.__target) in [types.ClassType,types.TypeType]: raise apache.SERVER_RETURN, apache.HTTP_INTERNAL_SERVER_ERROR instance = _execute(req,self.__target,lazy=True) if not callable(instance): raise apache.SERVER_RETURN, apache.HTTP_INTERNAL_SERVER_ERROR return _execute(req,instance,lazy=True) Although, did have to also add upgraded knowledge of ClassType and TypeType to one of my utility methods so as to work out parameters for constructor. I managed to work out how to get parameters for the new style class case okay whereas before I had some issue with it. Don't know why, it wasn't that big a problem, issue may have been more to do with traversal rules. My approach means that class types still will not be automatically be able to created, thus existing code doesn't get broken. To have a class automatically created, you have to make the conscious choice to wrap it. This class not only works in my "vampir888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4publisher" equivalent to mod_python.publisher, but also in "vampire.Publisher()", my ability to use published methods from a basic content handler with publisher return semantics, plus in my "vampire.Handler()" class which is published methods from a basic content handler but with standard content handler return semantics. This approach of using a wrapper class fits in better with how I have previously implemented wrapper classes "vampire.PathInfo()" and "vampire.PathArgs()" to allow use of additional path info when using publisher. What you have is a basic core which can be optionally extended in specialised ways just at the place that you need it. At the moment my method for applying a request to an object is private, but I could expose it when I am happy, and that opens up the opportunity for users to easily define their own wrappers to add specialised features. For example, you idea of iterating over items accessible from an object and executing each, could be done as a wrapper without the need to modify the core. One other wrapper class I have been thinking about for a while is a pooling mechanism. This would be similar to "vampire.Instance()" but would actually create a pool of the classes and cache them so they can be reused on subsequent requests. There could be a maximum limit on the number of instances allowed to be active with new requests having to wait until previous requests had completed before being allowed to proceed. Alternatively, you have a high water mark such that if a burst of requests come in, you create new instances, but as they finish you delete excess instances back down to the level of the high water mark. Obviously, this pool is only pertinent to a threaded MPM. Graham From ydavis@example.org Sun May 1 09:55:11 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 96053 invoked by uid 99); 1 May 2005 09:55:11 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from user.openhosting.com (HELO dscpl.user.openhosting.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 02:55:11 -0700 Received: from [83.161.120.155] (ppp205-29.lns1.syd3.internode.on.net [83.161.120.155]) by dscpl.user.openhosting.com (8.12.11/8.12.11) with ESMTP id j419rgsZ002124; Sun, 1 May 2005 05:53:43 -0400 In-Reply-To: <ydavis@example.org> References: <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <ydavis@example.org> Content-Transfer-Encoding: 7bit Cc: ydavis@example.org From: Graham Dumpleton <ydavis@example.org> Subject: Re: mod_python.publisher : proposal for a few implementation changes Date: Sun, 1 May 2005 19:53:40 +1000 To: ydavis@example.org X-Mailer: Apple Mail (2.619.2) X-Virus-Checked: Checked On 01/05/2005, at 7:32 PM, Nicolas Lehuen wrote: > I just had to modify apply_fs_data in util.py to allow new-style > classes to be called (changing the test type(object) = ClassType to > type(object) in (TypeType, ClassType)), and to rewrite publisher.py as > enclosed. Can you post your modified apply_fs_data. Want to see if what you came up with is similar to mine or whether one or the other of us forgot some strange case. In respect of: re_html = re.compile(r"</HTML",re.I) Was thinking that maybe a better pattern might be: re_html = re.compile(r"</HTML\s*>\s*$",re.I) Ie., explicitly require that </html> is the very last thing in the content. If I am right that nothing can come after </html> this would be the most accurate thing to use and would save wrongly calling something HTML when it is not, like this message would be if I stick </html> here. :-) Graham From ydavis@example.org Sun May 1 10:06:50 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 8056 invoked by uid 99); 1 May 2005 10:06:50 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ydavis@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 03:06:50 -0700 Received: by rproxy.gmail.com with SMTP id y7so917234rne for <ydavis@example.org>; Sun, 01 May 2005 03:05:23 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Qm5xgTWYwjstp5jBdkcM22eZT751wkhwcUDqwQ5VUSAUO6dJB1schzonu1O4ozF7RLMFFBo/BviqqWgsep/+MRQewWmKTzILdyLrYL7st4GnLZK4K+pU0A7YtOClbBwzBuukvT2CoKVgTBZQJoP9oItaKzvBaQnDETLyhpqt7CU= Received: by 83.161.120.155 with SMTP id f17mr5221150rng; Sun, 01 May 2005 03:05:23 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Sun, 1 May 2005 03:05:22 -0700 (PDT) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 12:05:22 +0200 From: Nicolas Lehuen <ydavis@example.org> Reply-To: ydavis@example.org To: Graham Dumpleton <ydavis@example.org> Subject: Re: mod_python.publisher : proposal for a few implementation changes Cc: ydavis@example.org In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1137_27552046.1114941922920" References: <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> X-Virus-Checked: Checked ------=_Part_1137_27552046.1114941922920 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Here is util.py with the modified line. I've tested it and it works. The only problem is that it forces the developer to write a __init__ method, even though it only contains "pass". I've modified the regular expression for the HTML closing tag in the new branch. BTW, it was a bit scary to make this branch, at one point I made a mistake and thought I had messed up the entire Apache repository. Turns out I don't have this much power, fortunately ;). If you want to check out this branch, here it is : https://svn.apache.org/repos/asf/httpd/mod_python/branches/3.2.0-experiment= al-publisher Regards, Nicolas On 5/1/05, Graham Dumpleton <ydavis@example.org> wrote: >=20 > On 01/05/2005, at 7:32 PM, Nicolas Lehuen wrote: > > I just had to modify apply_fs_data in util.py to allow new-style > > classes to be called (changing the test type(object) =3D ClassType to > > type(object) in (TypeType, ClassType)), and to rewrite publisher.py as > > enclosed. >=20 > Can you post your modified apply_fs_data. Want to see if what you came > up with is similar to mine or whether one or the other of us forgot some > strange case. >=20 > In respect of: >=20 > re_html =3D re.compile(r"</HTML",re.I) >=20 > Was thinking that maybe a better pattern might be: >=20 > re_html =3D re.compile(r"</HTML\s*>\s*$",re.I) >=20 > Ie., explicitly require that </html> is the very last thing in the > content. >=20 > If I am right that nothing can come after </html> this would be the most > accurate thing to use and would save wrongly calling something HTML > when it is not, like this message would be if I stick </html> here. :-) >=20 > Graham >=20 > ------=_Part_1137_27552046.1114941922920 Content-Type: application/x-python; name="util.py" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="util.py" DQojDQojIENvcHlyaWdodCAyMDA0IEFwYWNoZSBTb2Z0d2FyZSBGb3VuZGF0aW9uDQojDQojIExp Y2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5z ZSIpOyB5b3UNCiMgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdp dGggdGhlIExpY2Vuc2UuICBZb3UNCiMgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2Ug YXQNCiMNCiMgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAN CiMNCiMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3 cml0aW5nLCBzb2Z0d2FyZQ0KIyBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0 cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLA0KIyBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09O RElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3INCiMgaW1wbGllZC4gIFNlZSB0 aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZw0KIyBwZXJtaXNz aW9ucyBhbmQgbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuDQojDQojIE9yaWdpbmFsbHkg ZGV2ZWxvcGVkIGJ5IEdyZWdvcnkgVHJ1YmV0c2tveS4NCiMNCiMgJElkOiB1dGlsLnB5IDE2NTQ3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QNCg0KICAgICAgICNyZWFkIHVudGls IGJvdW5kYXJ5DQogICAgICAgc2VsZi5za2lwX3RvX2JvdW5kYXJ5KHJlcSwgYm91bmRhcnkpDQoN CiAgICAgICB3aGlsZSBUcnVlOg0KDQogICAgICAgICAgICMjIHBhcnNlIGhlYWRlcnMNCg0KICAg ICAgICAgICBjdHlwZSwgdHlwZV9vcHRpb25zID0gInRleHQvcGxhaW4iLCB7fQ0KICAgICAgICAg ICBkaXNwLCBkaXNwX29wdGlvbnMgPSBOb25lLCB7fQ0KICAgICAgICAgICBoZWFkZXJzID0gYXBh Y2hlLm1ha2VfdGFibGUoKQ0KDQogICAgICAgICAgIGxpbmUgPSByZXEucmVhZGxpbmUocmVhZEJs b2NrU2l6ZSkNCiAgICAgICAgICAgc2xpbmUgPSBsaW5lLnN0cmlwKCkNCiAgICAgICAgICAgaWYg bm90IGxpbmUgb3Igc2xpbmUgPT0gKGJvdW5kYXJ5ICsgIi0tIik6DQogICAgICAgICAgICAgICBi cmVhaw0KDQogICAgICAgICAgIHdoaWxlIGxpbmUgYW5kIGxpbmUgbm90IGluIFsiXG4iLCAiXHJc biJdOg0KICAgICAgICAgICAgICAgaCwgdiA9IGxpbmUuc3BsaXQoIjoiLCAxKQ0KICAgICAgICAg ICAgICAgaGVhZGVycy5hZGQoaCwgdikNCiAgICAgICAgICAgICAgIGggPSBoLmxvd2VyKCkNCiAg ICAgICAgICAgICAgIGlmIGggPT0gImNvbnRlbnQtZGlzcG9zaXRpb24iOg0KICAgICAgICAgICAg ICAgICAgIGRpc3AsIGRpc3Bfb3B0aW9ucyA9IHBhcnNlX2hlYWRlcih2KQ0KICAgICAgICAgICAg ICAgZWxpZiBoID09ICJjb250ZW50LXR5cGUiOg0KICAgICAgICAgICAgICAgICAgIGN0eXBlLCB0 eXBlX29wdGlvbnMgPSBwYXJzZV9oZWFkZXIodikNCiAgICAgICAgICAgICAgICAgICAjDQogICAg ICAgICAgICAgICAgICAgIyBOT1RFOiBGSVggdXAgYmluYXJ5IHJ1YmJpc2ggc2VudCBhcyBjb250 ZW50IHR5cGUgZnJvbSBNaWNyb3NvZnQgSUUgNi4wDQogICAgICAgICAgICAgICAgICAgIyB3aGVu IHNlbmRpbmcgYSBmaWxlIHdoaWNoIGRvZXMgbm90IGhhdmUgYSBzdWZmaXguDQogICAgICAgICAg ICAgICAgICAgIw0KICAgICAgICAgICAgICAgICAgIGlmIGN0eXBlLmZpbmQoJy8nKSA9PSAtMToN CiAgICAgICAgICAgICAgICAgICAgICAgY3R5cGUgPSAnYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFt Jw0KICAgICAgICAgICAgICAgbGluZSA9IHJlcS5yZWFkbGluZShyZWFkQmxvY2tTaXplKQ0KICAg ICAgICAgICAgICAgc2xpbmUgPSBsaW5lLnN0cmlwKCkNCg0KICAgICAgICAgICBpZiBkaXNwX29w dGlvbnMuaGFzX2tleSgibmFtZSIpOg0KICAgICAgICAgICAgICAgbmFtZSA9IGRpc3Bfb3B0aW9u c1sibmFtZSJdDQogICAgICAgICAgIGVsc2U6DQogICAgICAgICAgICAgICBuYW1lID0gTm9uZQ0K DQogICAgICAgICAgICMgaXMgdGhpcyBhIGZpbGU/DQogICAgICAgICAgIGlmIGRpc3Bfb3B0aW9u cy5oYXNfa2V5KCJmaWxlbmFtZSIpOg0KICAgICAgICAgICAgICAgaWYgZmlsZV9jYWxsYmFjayBh bmQgY2FsbGFibGUoZmlsZV9jYWxsYmFjayk6DQogICAgICAgICAgICAgICAgICAgZmlsZSA9IGZp bGVfY2FsbGJhY2soZGlzcF9vcHRpb25zWyJmaWxlbmFtZSJdKQ0KICAgICAgICAgICAgICAgZWxz ZToNCiAgICAgICAgICAgICAgICAgICBmaWxlID0gc2VsZi5tYWtlX2ZpbGUoKQ0KICAgICAgICAg ICBlbHNlOg0KICAgICAgICAgICAgICAgaWYgZmllbGRfY2FsbGJhY2sgYW5kIGNhbGxhYmxlKGZp ZWxkX2NhbGxiYWNrKToNCiAgICAgICAg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W4obGFzdF9ib3VuZCkgKyAxMjgNCiAgICAgICBs aW5lID0gcmVxLnJlYWRsaW5lKHJlYWRCbG9ja1NpemUpDQogICAgICAgbGluZUxlbmd0aCA9IGxl bihsaW5lKQ0KICAgICAgIGlmIGxpbmVMZW5ndGggPCByb3VnaEJvdW5kYXJ5TGVuZ3RoOg0KICAg ICAgICAgICBzbGluZSA9IGxpbmUuc3RyaXAoKQ0KICAgICAgIGVsc2U6DQogICAgICAgICAgIHNs aW5lID0gJycNCiAgICAgICB3aGlsZSBsaW5lTGVuZ3RoID4gMCBhbmQgc2xpbmUgIT0gYm91bmRh cnkgYW5kIHNsaW5lICE9IGxhc3RfYm91bmQ6DQogICAgICAgICAgIGlmIG5vdCBsYXN0Q2hhckNh cnJpZWQ6DQogICAgICAgICAgICAgICBmaWxlLndyaXRlKGRlbGltKQ0KICAgICAgICAgICAgICAg ZGVsaW0gPSAnJw0KICAgICAgICAgICBlbHNlOg0KICAgICAgICAgICAgICAgbGFzdENoYXJDYXJy aWVkID0gRmFsc2UNCiAgICAgICAgICAgY3V0TGVuZ3RoID0gMA0KICAgICAgICAgICBpZiBsaW5l TGVuZ3RoID09IHJlYWRCbG9ja1NpemU6DQogICAgICAgICAgICAgICBpZiBsaW5lWy0xOl0gPT0g J1xyJzoNCiAgICAgICAgICAgICAgICAgICBkZWxpbSA9ICdccicNCiAgICAgICAgICAgICAgICAg ICBjdXRMZW5ndGggPSAtMQ0KICAgICAgICAgICAgICAgICAgIGxhc3RDaGFyQ2FycmllZCA9IFRy dWUNCiAgICAgICAgICAgaWYgbGluZVstMjpdID09ICdcclxuJzoNCiAgICAgICAgICAgICAgIGRl bGltICs9ICdcclxuJw0KICAgICAgICAgICAgICAgY3V0TGVuZ3RoID0gLTINCiAgICAgICAgICAg ZWxpZiBsaW5lWy0xOl0gPT0gJ1xuJzoNCiAgICAgICAgICAgICAgIGRlbGltICs9ICdcbicNCiAg ICAgICAgICAgICAgIGN1dExlbmd0aCA9IC0xDQogICAgICAgICAgIGlmIGN1dExlbmd0aCAhPSAw Og0KICAgICAgICAgICAgICAgZmlsZS53cml0ZShsaW5lWzpjdXRMZW5ndGhdKQ0KICAgICAgICAg ICBlbHNlOg0KICAgICAgICAgICAgICAgZmlsZS53cml0ZShsaW5lKQ0KICAgICAgICAgICBsaW5l ID0gcmVxLnJlYWRsaW5lKHJlYWRCbG9ja1NpemUpDQogICAgICAgICAgIGxpbmVMZW5ndGggPSBs ZW4obGluZSkNCiAgICAgICAgICAgaWYgbGluZUxlbmd0aCA8IHJvdWdoQm91bmRhcnlMZW5ndGg6 DQogICAgICAgICAgICAgICBzbGluZSA9IGxpbmUuc3RyaXAoKQ0KICAgICAgICAgICBlbHNlOg0K ICAgICAgICAgICAgICAgc2xpbmUgPSAnJw0KDQogICBkZWYgX19nZXRpdGVtX18oc2VsZiwga2V5 KToNCiAgICAgICAiIiJEaWN0aW9uYXJ5IHN0eWxlIGluZGV4aW5nLiIiIg0KICAgICAgIGlmIHNl bGYubGlzdCBpcyBOb25lOg0KICAgICAgICAgICByYWlzZSBUeXBlRXJyb3IsICJub3QgaW5kZXhh YmxlIg0KICAgICAgIGZvdW5kID0gW10NCiAgICAgICBmb3IgaXRlbSBpbiBzZWxmLmxpc3Q6DQog ICAgICAgICAgIGlmIGl0ZW0ubmFtZSA9PSBrZXk6DQogICAgICAgICAgICAgICBpZiBpc2luc3Rh bmNlKGl0ZW0uZmlsZSwgRmlsZVR5cGUpIG9yIFwNCiAgICAgICAgICAgICAgICAgICAgICBpc2lu c3RhbmNlKGdldGF0dHIoaXRlbS5maWxlLCAnZmlsZScsIE5vbmUpLCBGaWxlVHlwZSk6DQogICAg ICAgICAgICAgICAgICAgZm91bmQuYXBwZW5kKGl0ZW0pDQogICAgICAgICAgICAgICBlbHNlOg0K ICAgICAgICAgICAgICAgICAgIGZvdW5kLmFwcGVuZChTdHJpbmdGaWVsZChpdGVtLnZhbHVlKSkN CiAgICAgICBpZiBub3QgZm91bmQ6DQogICAgICAgICAgIHJhaXNlIEtleUVycm9yLCBrZXkNCiAg ICAgICBpZiBsZW4oZm91bmQpID09IDE6DQogICAgICAgICAgIHJldHVybiBmb3VuZFswXQ0KICAg ICAgIGVsc2U6DQogICAgICAgICAgIHJldHVybiBmb3VuZA0KDQogICBkZWYgZ2V0KHNlbGYsIGtl eSwgZGVmYXVsdCk6DQogICAgICAgdHJ5Og0KICAgICAgICAgICByZXR1cm4gc2VsZi5fX2dldGl0 ZW1fXyhrZXkpDQogICAgICAgZXhjZXB0IEtleUVycm9yOg0KICAgICAgICAgICByZXR1cm4gZGVm YXVsdA0KDQogICBkZWYga2V5cyhzZWxmKToNCiAgICAgICAiIiJEaWN0aW9uYXJ5IHN0eWxlIGtl eXMoKSBtZXRob2QuIiIiDQogICAgICAgaWYgc2VsZi5saXN0IGlzIE5vbmU6DQogICAgICAgICAg IHJhaXNlIFR5cGVFcnJvciwgIm5vdCBpbmRleGFibGUiDQogICAgICAga2V5cyA9IFtdDQogICAg ICAgZm9yIGl0ZW0gaW4gc2VsZi5saXN0Og0KICAgICAgICAgICBpZiBpdGVtLm5hbWUgbm90IGlu IGtleXM6IGtleXMuYXBwZW5kKGl0ZW0ubmFtZSkNCiAgICAgICByZXR1cm4ga2V5cw0KDQogICBk ZWYgaGFzX2tleShzZWxmLCBrZXkpOg0KICAgICAgICIiIkRpY3Rpb25hcnkgc3R5bGUgaGFzX2tl eSgpIG1ldGhvZC4iIiINCiAgICAgICBpZiBzZWxmLmxpc3QgaXMgTm9uZToNCiAgICAgICAgICAg cmFpc2UgVHlwZUVycm9yLCAibm90IGluZGV4YWJsZSINCiAgICAgICBmb3IgaXRlbSBpbiBzZWxm Lmxpc3Q6DQogICAgICAgICAgIGlmIGl0ZW0ubmFtZSA9PSBrZXk6IHJldHVybiAxDQogICAgICAg cmV0dXJuIDANCg0KICAgX19jb250YWluc19fID0gaGFzX2tleQ0KDQogICBkZWYgX19sZW5fXyhz ZWxmKToNCiAgICAgICAiIiJEaWN0aW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6DQogICAgICAgICAgICAgICBkZWwgYXJnc1tuYW1lXQ0KDQog ICByZXR1cm4gb2JqZWN0KCoqYXJncykNCg0KZGVmIHJlZGlyZWN0KHJlcSwgbG9jYXRpb24sIHBl cm1hbmVudD0wLCB0ZXh0PU5vbmUpOg0KICAgIiIiDQogICBBIGNvbnZlbmllbmNlIGZ1bmN0aW9u IHRvIHByb3ZpZGUgcmVkaXJlY3Rpb24NCiAgICIiIg0KDQogICBpZiByZXEuc2VudF9ib2R5Y3Q6 DQogICAgICAgcmFpc2UgSU9FcnJvciwgIkNhbm5vdCByZWRpcmVjdCBhZnRlciBoZWFkZXJzIGhh dmUgYWxyZWFkeSBiZWVuIHNlbnQuIg0KDQogICByZXEuZXJyX2hlYWRlcnNfb3V0WyJMb2NhdGlv biJdID0gbG9jYXRpb24NCiAgIGlmIHBlcm1hbmVudDoNCiAgICAgICByZXEuc3RhdHVzID0gYXBh Y2hlLkhUVFBfTU9WRURfUEVSTUFORU5UTFkNCiAgIGVsc2U6DQogICAgICAgcmVxLnN0YXR1cyA9 IGFwYWNoZS5IVFRQX01PVkVEX1RFTVBPUkFSSUxZDQoNCiAgIGlmIHRleHQgaXMgTm9uZToNCiAg ICAgICByZXEud3JpdGUoJzxwPlRoZSBkb2N1bWVudCBoYXMgbW92ZWQnDQogICAgICAgICAgICAg ICAgICcgPGEgaHJlZj0iJXMiPmhlcmU8L2E+PC9wPlxuJw0KICAgICAgICAgICAgICAgICAlIGxv Y2F0aW9uKQ0KICAgZWxzZToNCiAgICAgICByZXEud3JpdGUodGV4dCkNCg0KICAgcmFpc2UgYXBh Y2hlLlNFUlZFUl9SRVRVUk4sIGFwYWNoZS5PSw0K ------=_Part_1137_27552046.1114941922920-- From ydavis@example.org Sun May 1 10:17:39 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 18972 invoked by uid 99); 1 May 2005 10:17:39 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from user.openhosting.com (HELO dscpl.user.openhosting.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 03:17:39 -0700 Received: from [83.161.120.155] (ppp205-29.lns1.syd3.internode.on.net [83.161.120.155]) by dscpl.user.openhosting.com (8.12.11/8.12.11) with ESMTP id j41AGABI013227; Sun, 1 May 2005 06:16:11 -0400 In-Reply-To: <ydavis@example.org> References: <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: multipart/mixed; boundary=Apple-Mail-2--803584569 Message-Id: <ydavis@example.org> Cc: ydavis@example.org From: Graham Dumpleton <ydavis@example.org> Subject: Re: mod_python.publisher : proposal for a few implementation changes Date: Sun, 1 May 2005 20:16:08 +1000 To: ydavis@example.org X-Mailer: Apple Mail (2.619.2) X-Virus-Checked: Checked --Apple-Mail-2--803584569 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 01/05/2005, at 8:05 PM, Nicolas Lehuen wrote: > Here is util.py with the modified line. I've tested it and it works. > The only problem is that it forces the developer to write a __init__ > method, even though it only contains "pass". You can work around the requirement to have "__init__()", you just need to restructure the code a bit and move interrogation of co_flags into the actual if statement. I actually have a distinct routine for calculating args and other stuff. See code for it attached. --Apple-Mail-2--803584569 Content-Transfer-Encoding: 7bit Content-Type: text/plain; x-unix-mode=0644; name="params.txt" Content-Disposition: attachment; filename=params.txt # Following method determines the set of parameters # that a callable object is able to accept or whether # it accepts keyword arguments. def _params(object): flags = None if callable(object): object_type = type(object) if object_type is types.FunctionType: func_code = object.func_code flags = object.func_code.co_flags defaults = object.func_defaults expected = func_code.co_varnames[0:func_code.co_argcount] elif object_type is types.MethodType: func_code = object.im_func.func_code flags = object.im_func.func_code.co_flags defaults = object.im_func.func_defaults expected = func_code.co_varnames[1:func_code.co_argcount] elif object_type is types.ClassType: if hasattr(object,"__init__") and \ type(object.__init__) is types.MethodType: func_code = object.__init__.im_func.func_code flags = object.__init__.im_func.func_code.co_flags defaults = object.__init__.im_func.func_defaults expected = func_code.co_varnames[1:func_code.co_argcount] else: flags = 0 defaults = [] expected = [] elif object_type is types.TypeType: if hasattr(object,"__init__") and \ type(object.__init__) is types.MethodType: func_code = object.__init__.im_func.func_code flags = object.__init__.im_func.func_code.co_flags defaults = object.__init__.im_func.func_defaults expected = func_code.co_varnames[1:func_code.co_argcount] else: flags = 0 defaults = [] expected = [] elif hasattr(object,"__call__"): if type(object.__call__) is types.MethodType: func_code = object.__call__.im_func.func_code flags = object.__call__.im_func.func_code.co_flags defaults = object.__call__.im_func.func_defaults expected = func_code.co_varnames[1:func_code.co_argcount] elif hasattr(object,"func_code"): func_code = object.func_code flags = object.func_code.co_flags defaults = object.func_defaults expected = func_code.co_varnames[0:func_code.co_argcount] elif hasattr(object,"im_func"): func_code = object.im_func.func_code flags = object.im_func.func_code.co_flags defaults = object.im_func.func_defaults expected = func_code.co_varnames[1:func_code.co_argcount] if flags is None: return (apache.HTTP_INTERNAL_SERVER_ERROR,None,None,None) if defaults is None: defaults = [] return (apache.OK,flags,expected,defaults) --Apple-Mail-2--803584569 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed --Apple-Mail-2--803584569-- From ydavis@example.org Sun May 1 10:34:42 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 31527 invoked by uid 99); 1 May 2005 10:34:42 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 03:34:42 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id AF96B29C for <ydavis@example.org>; Sun, 1 May 2005 12:33:14 +0200 (CEST) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 12:33:14 +0200 (CEST) From: "Nicolas Lehuen (JIRA)" <ydavis@example.org> To: ydavis@example.org Subject: [jira] Resolved: (MODPYTHON-39) couple of documentation improvements In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked [ http://issues.apache.org/jira/browse/MODPYTHON-39?page=3Dall ] =20 Nicolas Lehuen resolved MODPYTHON-39: ------------------------------------- Assign To: Nicolas Lehuen Resolution: Fixed Fix Version: 3.2.0 I've added req.content_type =3D 'text/plain' in the test, and added a littl= e info about headers in the tutorial, paragraph 3.3. > couple of documentation improvements > ------------------------------------ > > Key: MODPYTHON-39 > URL: http://issues.apache.org/jira/browse/MODPYTHON-39 > Project: mod_python > Type: Improvement > Components: documentation > Reporter: andres hurtado > Assignee: Nicolas Lehuen > Priority: Minor > Fix For: 3.2.0 > > in the section : http://www.modpython.org/live/current/doc-html/inst-test= ing.html , the hello world example needs to mention about apache systems wh= ich are not configured with the "DefaultType text/plain" directive,in whic= h the example will not work, or maybe just add an req.content_type =3D 'tex= t/plain' to the example. So noobies wont be frustated because they cant get= the hello world program to work. > Remark somewhere near the begining of the tutorial / examples that : > In order to send any kind of response=A0headers,including cookies and ses= sions,the code should be before any req.write(). So that noobies wont be fr= ustated trying to find out why their hit counter cookie doesnt work. > Perhaps there are some other details that need to be remarked, like sever= al issues regarding internal redirects, those can be found at: > REFERENCES : http://www.modpython.org/pipermail/mod_python/2005-March/017= 729.html --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From ydavis@example.org Sun May 1 10:34:44 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 31716 invoked by uid 99); 1 May 2005 10:34:44 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 03:34:44 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id 2EEB52DE for <ydavis@example.org>; Sun, 1 May 2005 12:33:17 +0200 (CEST) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 12:33:17 +0200 (CEST) From: "Nicolas Lehuen (JIRA)" <ydavis@example.org> To: ydavis@example.org Subject: [jira] Work started: (MODPYTHON-15) Publisher : iterable return values should be corretly published In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked [ http://issues.apache.org/jira/browse/MODPYTHON-15?page=all ] Work on MODPYTHON-15 started by Nicolas Lehuen > Publisher : iterable return values should be corretly published > --------------------------------------------------------------- > > Key: MODPYTHON-15 > URL: http://issues.apache.org/jira/browse/MODPYTHON-15 > Project: mod_python > Type: Improvement > Versions: 3.1.3 > Reporter: Nicolas Lehuen > Assignee: Nicolas Lehuen > Priority: Minor > > Suppose this function in a published module : > def index(req) > req.content_type = 'text/plain' > yield '1\n' > yield '2\n' > yield '3\n' > yield '4\n' > When published, this module should return a text content with '1\n2\n3\n4\n'. > This could also be useful with a file() object, since they are iterable ; this would provide another way to send a file, only slightly less performing than the send_file() method. Handy when you want to filter a file : > def filter(req,filename): > f = open(filename,'r') > for line in f: > yield re.sub('foo','bar',line) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From ydavis@example.org Sun May 1 10:34:45 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 31732 invoked by uid 99); 1 May 2005 10:34:45 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 03:34:44 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id BB3162CD for <ydavis@example.org>; Sun, 1 May 2005 12:33:16 +0200 (CEST) Message-ID: <{{EMAIL+PHONE}}> Date: Sun, 1 May 2005 12:33:16 +0200 (CEST) From: "Nicolas Lehuen (JIRA)" <ydavis@example.org> To: ydavis@example.org Subject: [jira] Resolved: (MODPYTHON-42) Cookie documentation, small correction In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked [ http://issues.apache.org/jira/browse/MODPYTHON-42?page=all ] Nicolas Lehuen resolved MODPYTHON-42: ------------------------------------- Assign To: Nicolas Lehuen Resolution: Fixed Fix Version: 3.2.0 > Cookie documentation, small correction > -------------------------------------- > > Key: MODPYTHON-42 > URL: http://issues.apache.org/jira/browse/MODPYTHON-42 > Project: mod_python > Type: Bug > Components: documentation > Versions: 3.2.0 > Environment: Documentation found on the mod_python website > Reporter: Vivian De Smedt > Assignee: Nicolas Lehuen > Priority: Minor > Fix For: 3.2.0 > Attachments: modpython4-doc-patch > > Dear mod_python developper, > I just want notify you a small mistakes the Cookie module documentation. > The sample section use the get_cookie api instead of the get_cookies one. > In consequence the following section: > from mod_python import apache, Cookie > def handler(req): > cookies = Cookie.get_cookie(req, Cookie.MarshalCookie, > secret='secret007') > if cookies.has_key('spam'): > spamcookie = cookies['spam'] > req.write('Great, a spam cookie was found: %s\n' \ > % str(spamcookie)) > if type(spamcookie) is Cookie.MarshalCookie: > req.write('Here is what it looks like decoded: %s=%s\n' > % (spamcookie.name, spamcookie.value)) > else: > req.write('WARNING: The cookie found is not a \ > MarshalCookie, it may have been tapered with!') > else: > # MarshaCookie allows value to be any marshallable object > value = {'egg_count': 32, 'color': 'white'} > Cookie.add_cookie(req, Cookie.MarshalCookie('spam', value, \ > 'secret007')) > req.write('Spam cookie not found, but we just set one!\n') > return apache.OK > should be rewritten: > from mod_python import apache, Cookie > def handler(req): > cookies = Cookie.get_cookie*s*(req, Cookie.MarshalCookie, > secret='secret007') > if cookies.has_key('spam'): > spamcookie = cookies['spam'] > req.write('Great, a spam cookie was found: %s\n' \ > % str(spamcookie)) > if type(spamcookie) is Cookie.MarshalCookie: > req.write('Here is what it looks like decoded: %s=%s\n' > % (spamcookie.name, spamcookie.value)) > else: > req.write('WARNING: The cookie found is not a \ > MarshalCookie, it may have been tapered with!') > else: > # MarshaCookie allows value to be any marshallable object > value = {'egg_count': 32, 'color': 'white'} > Cookie.add_cookie(req, Cookie.MarshalCookie('spam', value, \ > 'secret007')) > req.write('Spam cookie not found, but we just set one!\n') > return apache.OK > Thanks for your nice module, > Vivian. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From ydavis@example.org Sun May 1 10:34:45 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 31810 invoked by uid 99); 1 May 2005 10:34:45 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 03:34:44 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id 61D5B2DF for <ydavis@example.org>; Sun, 1 May 2005 12:33:17 +0200 (CEST) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 12:33:17 +0200 (CEST) From: "Nicolas Lehuen (JIRA)" <ydavis@example.org> To: ydavis@example.org Subject: [jira] Assigned: (MODPYTHON-16) Publisher : classes could be published In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked [ http://issues.apache.org/jira/browse/MODPYTHON-16?page=all ] Nicolas Lehuen reassigned MODPYTHON-16: --------------------------------------- Assign To: Nicolas Lehuen > Publisher : classes could be published > -------------------------------------- > > Key: MODPYTHON-16 > URL: http://issues.apache.org/jira/browse/MODPYTHON-16 > Project: mod_python > Type: Improvement > Versions: 3.1.3 > Reporter: Nicolas Lehuen > Assignee: Nicolas Lehuen > Priority: Minor > > Suppose this in a published Module : > class index(object): > def __init__(self,req,name): > self.buffer ='<html><body><p>Hello, %s !</p></body></html>'%name > > def __str__(self): > return self.buffer > The publisher could notice that the index object is in fact a class, instantiate it and write the result of a str() conversion to the client. > Why should we do this ? > 1) we can ;) > 2) this could be done by a class definition + a index function which does the job, but this way, we save a function definition. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From ydavis@example.org Sun May 1 10:34:45 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 31818 invoked by uid 99); 1 May 2005 10:34:45 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 03:34:45 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id 7D20F2E0 for <ydavis@example.org>; Sun, 1 May 2005 12:33:17 +0200 (CEST) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 12:33:17 +0200 (CEST) From: "Nicolas Lehuen (JIRA)" <ydavis@example.org> To: ydavis@example.org Subject: [jira] Work started: (MODPYTHON-16) Publisher : classes could be published In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked [ http://issues.apache.org/jira/browse/MODPYTHON-16?page=all ] Work on MODPYTHON-16 started by Nicolas Lehuen > Publisher : classes could be published > -------------------------------------- > > Key: MODPYTHON-16 > URL: http://issues.apache.org/jira/browse/MODPYTHON-16 > Project: mod_python > Type: Improvement > Versions: 3.1.3 > Reporter: Nicolas Lehuen > Assignee: Nicolas Lehuen > Priority: Minor > > Suppose this in a published Module : > class index(object): > def __init__(self,req,name): > self.buffer ='<html><body><p>Hello, %s !</p></body></html>'%name > > def __str__(self): > return self.buffer > The publisher could notice that the index object is in fact a class, instantiate it and write the result of a str() conversion to the client. > Why should we do this ? > 1) we can ;) > 2) this could be done by a class definition + a index function which does the job, but this way, we save a function definition. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From ydavis@example.org Sun May 1 11:08:44 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 62234 invoked by uid 99); 1 May 2005 11:08:44 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ydavis@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 04:08:44 -0700 Received: by rproxy.gmail.com with SMTP id y7so920367rne for <ydavis@example.org>; Sun, 01 May 2005 04:07:17 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rD0XX8NHlYOIqvC4NFB+h0PgGyrLFrJXYy5FI3EnNqTlkAO9kLzjsWcAoc6CCQQIj7b2am7bu6kGDC/fpVogF5hzqYrzSL7QWuy3JATyhLgreehFJixCixHCU8bfRHfUtCoOZ27bsqQOX/jAJcEc/cHgpa8KMnBgKzNzySpElSc= Received: by 83.161.120.155 with SMTP id u4mr4779862rnb; Sun, 01 May 2005 04:07:17 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Sun, 1 May 2005 04:07:17 -0700 (PDT) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 13:07:17 +0200 From: Nicolas Lehuen <ydavis@example.org> Reply-To: ydavis@example.org To: Graham Dumpleton <ydavis@example.org> Subject: Re: mod_python.publisher : proposal for a few implementation changes Cc: ydavis@example.org In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> X-Virus-Checked: Checked Graham, have you seen the standard inspect.getargspec() function ? It exists since Python 2.1 and may save some code and portability : http://www.python.org/doc/2.2.3/lib/inspect-classes-functions.html Regards, Nicolas On 5/1/05, Graham Dumpleton <ydavis@example.org> wrote: >=20 > On 01/05/2005, at 8:05 PM, Nicolas Lehuen wrote: >=20 > > Here is util.py with the modified line. I've tested it and it works. > > The only problem is that it forces the developer to write a __init__ > > method, even though it only contains "pass". >=20 > You can work around the requirement to have "__init__()", you just need > to > restructure the code a bit and move interrogation of co_flags into the > actual if statement. I actually have a distinct routine for calculating > args and other stuff. See code for it attached. >=20 >=20 >=20 >=20 >=20 >=20 > From ydavis@example.org Sun May 1 11:43:53 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 91051 invoked by uid 99); 1 May 2005 11:43:53 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from user.openhosting.com (HELO dscpl.user.openhosting.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 04:43:53 -0700 Received: from [83.161.120.155] (ppp205-29.lns1.syd3.internode.on.net [83.161.120.155]) by dscpl.user.openhosting.com (8.12.11/8.12.11) with ESMTP id j41BgOJb020580; Sun, 1 May 2005 07:42:25 -0400 In-Reply-To: <ydavis@example.org> References: <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> <ydavis@example.org> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <ydavis@example.org> Content-Transfer-Encoding: 7bit Cc: ydavis@example.org From: Graham Dumpleton <ydavis@example.org> Subject: Re: mod_python.publisher : proposal for a few implementation changes Date: Sun, 1 May 2005 21:42:22 +1000 To: ydavis@example.org X-Mailer: Apple Mail (2.619.2) X-Virus-Checked: Checked On 01/05/2005, at 9:07 PM, Nicolas Lehuen wrote: > Graham, have you seen the standard inspect.getargspec() function ? It > exists since Python 2.1 and may save some code and portability : > > http://www.python.org/doc/2.2.3/lib/inspect-classes-functions.html Yes. I probably didn't use it out of habit. Specifically, when I wrote my other Python project where I needed to interrogate arguments, I had to be compatible with Python 1.5 and Python 2.0, so initially didn't exist and then couldn't use it for compatibility reasons. Possibly about time to start using it, although not sure it will change much the amount of code that needs to be written as still need special cases to drop off self parameter of class instance method. It also does not eliminate the chain of if statements which identify the actual object you need to apply the interrogation to. :-) Graham From ydavis@example.org Sun May 1 12:10:32 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 14183 invoked by uid 99); 1 May 2005 12:10:32 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 05:10:32 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id 6535C19F for <ydavis@example.org>; Sun, 1 May 2005 14:09:05 +0200 (CEST) Message-ID: <{{EMAIL+PHONE}}> Date: Sun, 1 May 2005 14:09:05 +0200 (CEST) From: "Nicolas Lehuen (JIRA)" <ydavis@example.org> To: ydavis@example.org Subject: [jira] Assigned: (MODPYTHON-28) Add a standard test handler in the distribution In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked [ http://issues.apache.org/jira/browse/MODPYTHON-28?page=all ] Nicolas Lehuen reassigned MODPYTHON-28: --------------------------------------- Assign To: Nicolas Lehuen > Add a standard test handler in the distribution > ----------------------------------------------- > > Key: MODPYTHON-28 > URL: http://issues.apache.org/jira/browse/MODPYTHON-28 > Project: mod_python > Type: Improvement > Versions: 2.7.10, 3.1.4 > Reporter: Nicolas Lehuen > Assignee: Nicolas Lehuen > Fix For: 3.2.0 > > Improving the testing phase of the installation is crucial as we get a steady stream of question from new users who can't run the mptest or are confused about its meaning (for example, the fact that any URL ending with .py runs the mptest handler is misleading at first). > We should include a standard mptest handler in the distribution so that we can better help beginners, without making them struggle with a new file PYTHONPATH, syntax errors in the handler, etc. Ideally, the mptest handler should display useful informations both in the Apache log and in the result page ; this would help us check their environment and provide better help. > The information displayed could be (both in the log and the result page) : > - Apache version (+MPM type if this information can be queried at runtime) > - Python version > - mod_python version > - sys.path > - mod_python.publisher available yes/no > - mod_python.psp available yes/no > Of course, if anything goes wrong, it should be clearly stated in the Apache log (no misleading 404 errors, please !). > The testing phase of the installation would then be : 1) set "SetHandler mod_python.mptest" directive and 2) watch the results. This would be far less messy as it is currently. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From ydavis@example.org Sun May 1 12:10:33 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 14206 invoked by uid 99); 1 May 2005 12:10:33 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 05:10:33 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id BC2BE2CD for <ydavis@example.org>; Sun, 1 May 2005 14:09:05 +0200 (CEST) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 14:09:05 +0200 (CEST) From: "Nicolas Lehuen (JIRA)" <ydavis@example.org> To: ydavis@example.org Subject: [jira] Commented: (MODPYTHON-28) Add a standard test handler in the distribution In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked [ http://issues.apache.org/jira/browse/MODPYTHON-28?page=comments#action_64201 ] Nicolas Lehuen commented on MODPYTHON-28: ----------------------------------------- OK, the handler is named mod_python.testhandler and display a whole range of information about the configuration. Now we need a little bit of documentation on how to use it. > Add a standard test handler in the distribution > ----------------------------------------------- > > Key: MODPYTHON-28 > URL: http://issues.apache.org/jira/browse/MODPYTHON-28 > Project: mod_python > Type: Improvement > Versions: 2.7.10, 3.1.4 > Reporter: Nicolas Lehuen > Assignee: Nicolas Lehuen > Fix For: 3.2.0 > > Improving the testing phase of the installation is crucial as we get a steady stream of question from new users who can't run the mptest or are confused about its meaning (for example, the fact that any URL ending with .py runs the mptest handler is misleading at first). > We should include a standard mptest handler in the distribution so that we can better help beginners, without making them struggle with a new file PYTHONPATH, syntax errors in the handler, etc. Ideally, the mptest handler should display useful informations both in the Apache log and in the result page ; this would help us check their environment and provide better help. > The information displayed could be (both in the log and the result page) : > - Apache version (+MPM type if this information can be queried at runtime) > - Python version > - mod_python version > - sys.path > - mod_python.publisher available yes/no > - mod_python.psp available yes/no > Of course, if anything goes wrong, it should be clearly stated in the Apache log (no misleading 404 errors, please !). > The testing phase of the installation would then be : 1) set "SetHandler mod_python.mptest" directive and 2) watch the results. This would be far less messy as it is currently. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From ydavis@example.org Sun May 1 12:10:34 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 14255 invoked by uid 99); 1 May 2005 12:10:34 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 05:10:33 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id 1024B2DE for <ydavis@example.org>; Sun, 1 May 2005 14:09:06 +0200 (CEST) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 14:09:06 +0200 (CEST) From: "Nicolas Lehuen (JIRA)" <ydavis@example.org> To: ydavis@example.org Subject: [jira] Assigned: (MODPYTHON-45) Implement a file-based session manager In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked [ http://issues.apache.org/jira/browse/MODPYTHON-45?page=all ] Nicolas Lehuen reassigned MODPYTHON-45: --------------------------------------- Assign To: Nicolas Lehuen > Implement a file-based session manager > -------------------------------------- > > Key: MODPYTHON-45 > URL: http://issues.apache.org/jira/browse/MODPYTHON-45 > Project: mod_python > Type: New Feature > Versions: 3.1.4 > Reporter: Nicolas Lehuen > Assignee: Nicolas Lehuen > Priority: Minor > Fix For: 3.2.0 > > Right now mod_python comes with DbmSession and MemorySession. DbmSession performance can be pretty crappy if for any reason the anydbm module reverts to the dumbdbm implementation. With the current filesystems, implementing a file-based session manager should be easy and should perform well. > See the following thread : http://www.modpython.org/pipermail/mod_python/2005-April/017825.html > I've checked in a preliminary implementation based on dharana's work. We'll have to cope with a few issues (namely locking) before it is final. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From ydavis@example.org Sun May 1 12:10:34 2005 Return-Path: <ydavis@example.org> Mailing-List: contact ydavis@example.org; run by ezmlm Delivered-To: mailing list ydavis@example.org Received: (qmail 14249 invoked by uid 99); 1 May 2005 12:10:34 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 01 May 2005 05:10:32 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id 9D62529C for <ydavis@example.org>; Sun, 1 May 2005 14:09:05 +0200 (CEST) Message-ID: <ydavis@example.org> Date: Sun, 1 May 2005 14:09:05 +0200 (CEST) From: "Nicolas Lehuen (JIRA)" <ydavis@example.org> To: ydavis@example.org Subject: [jira] Work started: (MODPYTHON-28) Add a standard test handler in the distribution In-Reply-To: <ydavis@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked [ http://issues.apache.org/jira/browse/MODPYTHON-28?page=all ] Work on MODPYTHON-28 started by Nicolas Lehuen > Add a standard
{'source': 'Apache Software Foundation Public Mail Archives'}