On 3 Sep 2013, at 11:10 AM, Niphlod <niph...@gmail.com> wrote:
> uhm. apart from the technicalities of global_settings, shouldn't be better to 
> just import current and use current.request.folder as the base folder ?

Yeah, that ought to work. 

I wasn't thinking along those lines, I guess. Originally, I was doing my 
imports at top level, and I'm not sure that there was even a request present. 
But I can deal with that.

Thanks.

> 
> On Tuesday, September 3, 2013 7:36:58 PM UTC+2, Jonathan Lundell wrote:
> I have a module in my app's modules/ directory that needs a path to a file in 
> private/ at import time (so I can't pass the path in). 
> 
> Using fileutils.abspath, I have to write: 
> 
> > abspath('applications', 'watchup', 'private', filename) 
> 
> 
> presumably because in abspath: 
> 
> >     return os.path.join(global_settings.applications_parent, path) 
> 
> 
> ...global_settings is empty at import time? (I haven't looked explicitly.) 
> 
> I'd rather not hard-code the application name into the module, of course, 
> though it's not a huge hardship in this case. 
> 
> I don't quite understand why this isn't working. I'm calling import in the 
> context of a request, so I'd think that I'd get the whole path without having 
> to pass in the 'applications/appname' portion. 
> 
> What am I missing?
> 
> 


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to