[web2py] Re: application path in module

2010-02-20 Thread selecta
did you try request.env.web2py_path+'/
applications/'+request.application ?

On Feb 20, 10:40 am, sherdim sher...@gmail.com wrote:
 Hello,all!

 How to get application path inside module correctly?

 When using os.getcwd() for web2py root it is needed the application
 path also.

 request is not available, is it?

 Vale!

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: application path in module

2010-02-20 Thread mdipierro
do not trust getcwd() because that depends on installation details.

use request.folder

On Feb 20, 3:40 am, sherdim sher...@gmail.com wrote:
 Hello,all!

 How to get application path inside module correctly?

 When using os.getcwd() for web2py root it is needed the application
 path also.

 request is not available, is it?

 Vale!

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: application path in module

2010-02-20 Thread sherdim
OK, what I should import in my module?

The module is supposed detouchable, developed for the extra web2py use
also

What a clever way to check web2py, to import only needed
gluon.globals.Request and to resolve exception if any?

Also:  if I really need only  some functions from my hypothetic
module, how to optimize functions (may be classes) for a better
performance?
To import only needed function inside functions in controller? Or to
import * (all) inside model? Will be any difference? What will be
impact of the ballast inside that module (extra lib imports etc)?

Finally - is it practical to develop universal pythonic module, for
which the work inside web2py will be optional? It is like GAE is
optional for web2py, but can be web2py is optional for my tiny lib? Or
the better to make a special wrapper inside module folder and to push
other staff into site-packages?

Vale!

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: application path in module

2010-02-20 Thread Iceberg
Not sure I understand your question, but you can always deploy your
lib as a normal python lib, then all web2py app can import it,
provided you are running web2py from source version.

Or you can just deploy your lib in web2py/applications/yourapp/
modules. Just go ahead, nothing special here.

On Feb21, 5:37am, sherdim sher...@gmail.com wrote:
 OK, what I should import in my module?

 The module is supposed detouchable, developed for the extra web2py use
 also

 What a clever way to check web2py, to import only needed
 gluon.globals.Request and to resolve exception if any?

 Also:  if I really need only  some functions from my hypothetic
 module, how to optimize functions (may be classes) for a better
 performance?
 To import only needed function inside functions in controller? Or to
 import * (all) inside model? Will be any difference? What will be
 impact of the ballast inside that module (extra lib imports etc)?

 Finally - is it practical to develop universal pythonic module, for
 which the work inside web2py will be optional? It is like GAE is
 optional for web2py, but can be web2py is optional for my tiny lib? Or
 the better to make a special wrapper inside module folder and to push
 other staff into site-packages?

 Vale!

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.