Return-Path: Delivered-To: apmail-httpd-python-dev-archive@www.apache.org Received: (qmail 38811 invoked from network); 10 Sep 2006 06:51:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Sep 2006 06:51:00 -0000 Received: (qmail 65910 invoked by uid 500); 10 Sep 2006 06:51:00 -0000 Delivered-To: apmail-httpd-python-dev-archive@httpd.apache.org Received: (qmail 65885 invoked by uid 500); 10 Sep 2006 06:51:00 -0000 Mailing-List: contact python-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list python-dev@httpd.apache.org Received: (qmail 65874 invoked by uid 99); 10 Sep 2006 06:50:59 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Sep 2006 23:50:59 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=grahamd@dscpl.com.au; spf=permerror X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received-SPF: error (idunn.apache.osuosl.org: domain dscpl.com.au from 203.16.214.182 cause and error) Received: from ([203.16.214.182:2595] helo=ash25e.internode.on.net) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id DA/10-18725-3D5B3054 for ; Sat, 09 Sep 2006 23:51:01 -0700 Received: from [10.0.1.3] (ppp45-161.lns2.syd6.internode.on.net [59.167.45.161]) by ash25e.internode.on.net (8.13.6/8.13.5) with ESMTP id k8A6okgu036306; Sun, 10 Sep 2006 16:20:47 +0930 (CST) (envelope-from grahamd@dscpl.com.au) In-Reply-To: <0ED7FDEF-FCC5-470F-AAE5-002613784760@emedialibrary.org> References: <586C10B1-16E2-4F08-A017-D2199E9CCCEC@emedialibrary.org> <355DBF2B-400C-4C47-8691-37829466F896@emedialibrary.org> <0ED7FDEF-FCC5-470F-AAE5-002613784760@emedialibrary.org> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Cc: python-dev@httpd.apache.org Content-Transfer-Encoding: quoted-printable From: Graham Dumpleton Subject: Re: Regex based publisher proposal Date: Sun, 10 Sep 2006 16:51:35 +1000 To: =?ISO-8859-1?Q?S=E9bastien_Arnaud?= X-Mailer: Apple Mail (2.752.2) X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 10/09/2006, at 12:28 PM, S=E9bastien Arnaud wrote: > I love the wiki you put together, lots of great stuff in there! I =20 > am going to go back to the drawing board here due to all the new =20 > things you presented available in mod_python 3.3 which I did not =20 > know about. It looks like a fixuphandler would fit the bill for =20 > what I am attempting to do. Once I get something working, I will =20 > make sure to give more detailed info and a clear example of how the =20= > framework/url matching works so that you can better advise on which =20= > mod_python 3.3 features can be better taken advantage of. > > In regards to mod_python.publisher, it looks like indeed it is =20 > better to divorce myself from it after the points you brought up. =20 > On that topic though, should I reuse at all the ModuleCache object =20 > to load & cache modules? Or is there something more efficient/=20 > better in mod_python 3.3? Ignore the ModuleCache class which appears to be used by =20 mod_python.publisher as when the new importer gets used in mod_python 3.3 it doesn't =20 actually get used. In mod_python 3.3, I would suggest you simply assume/require that the =20= new module importer is used and use apache.import_module() instead. The new =20 module importer is the default in 3.3, but it still patches itself in in place of the =20= old module importers and so just reading the code everything still looks to use the old. The most important things you will want to know about =20 apache.import_module() in mod_python 3.3 are: 1. The first argument 'module' can actually now also be an absolute =20 path to a module code file, including '.py' extension. By specifying the actual =20 location, you skip any searching through directories trying to find an appropriate match. 2. You don't need to ever supply 'log' or 'autoreload' arguments as =20 the function is now able to always get them directly from Apache configuration =20 information appropriate to the request. 3. Because of (1), when using handler directives in Apache =20 configuration, you can now supply an absolute path for a handler module file as well. Where =20 module file is in non standard location, this avoids need to setup PythonPath. The =20 need to set up PythonPath explicitly should be much reduced and using it couldn't =20 indicate a wrong setup and you might even find mod_python complaining about it. You can check out some of the behaviour of the new module importer by =20= reading the old mailing list thread at: http://www.modpython.org/pipermail/mod_python/2006-April/020936.html http://www.modpython.org/pipermail/mod_python/2006-May/021097.html http://www.mail-archive.com/python-dev@httpd.apache.org/msg02185.html There are lots of details though and not sure that these capture it =20 all. I still need to turn this all into a wiki page as well and use some of it for =20 official mod_python docs. :-) Graham=