Work started: (MODPYTHON-54) Add a way to import a published page into another publish
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Work started: (MODPYTHON-54) Add a way to import a published page into another publish




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Work started: (MODPYTHON-54) Add a way to import a published page into another publish  
Nicolas Lehuen (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-13-05 07:45 AM

[ http://issues.apache.org/jira/brows...HON-54?page=all ]

Work on MODPYTHON-54 started by Nicolas Lehuen

> Add a way to import a published page into another published page
> ----------------------------------------------------------------
>
>          Key: MODPYTHON-54
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-54
>      Project: mod_python
>         Type: Improvement
>     Versions: 3.2.0
>     Reporter: Nicolas Lehuen
>     Assignee: Nicolas Lehuen
>      Fix For: 3.2.0

>
> Before mod_python 3.2, standard Python modules and published modules could
 be imported the same way, using apache.import_module. This had a number of 
disadvantages, leading to MODPYTHON-8, MODPYTHON-9, MODPYTHON-10, MODPYTHON-
11 and MODPYTHON-12.
> All these bugs were fixed by separating the published modules from the standard Py
thon module. apache.import_module can still be used to import standard modules, but 
published modules are now fully managed  by mod_python.publisher, and are not insert
ed
into sys.modules.
> The problem is that there is a use case of importing a published module fr
om another published module :
> /index.py----------------
> def index(req):
>     return "Hello, world !"
> def utility_function(foobar):
>     return foobar+1
> /other.py----------------
> import os
> directory = os.path.split(__file__)[0]
> other_index = apache.import_module("index",path=[directory])
> def index(req):
>     return "%s %i"%(other_index.index(req),other_index.utility_function(20
04))
> This was alread a bit of a hack in 3.1.4, but in 3.2 it does not really work the e
xpected way since the imported module (other_index in the example) is not the same m
odule as the one the publisher would use to publish /index.py. This could be trouble
som
e if the developer wanted to share some data between the modules, e.g. a cache or a connecti
on pool, but not if he only wanted to share some code.
> Therefore, we need to provide a clean API in mod_python.publisher to allow develop
ers to reference another published module.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:43 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register