Yeah, happy that is improving. I will do it this way for now, as it take a bit before I upgrade the server.
It don't like the way it is here in the book.
BR,
Jason Brower

On 05/12/2011 06:35 AM, Bruno Rocha wrote:
here:
http://web2py.com/book/default/chapter/04#Third-Party-Modules

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

web2py provides another way to import modules in such a way that the global |sys.path| is not altered: by placing them in the "modules" folder of an application. One side benefit is that the module will be automatically copied and distributed with the application; however, there are certain restrictions that apply. web2py provides a|local_import| function that must be used to import modules from the "modules" folder. Here is an example of usage:

1.
        
mymodule=local_import  
<http://web2py.com/book/default/docstring/local_import>('mymodule')

The function looks for |mymodule| in the app local modules folder and imports it with the name on the left-hand side of equal.

This function takes three arguments: |name|, |reload| and |app|.

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

*but wait! there are updates coming*, now web2py hs gluon.current and custom importer which is better than that old way.


--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]



On Thu, May 12, 2011 at 12:10 AM, Jason Brower <[email protected] <mailto:[email protected]>> wrote:

    Looked and looked but I couldn't fine where you place a file with
    methods and classes in the modules directory and then you can
    import them.
    Could I see where that is in the book or perhaps some instruction
    here?
    Best Regards,
    Jason



Reply via email to