Re: [Rest2web-develop] Re: Enhancement suggestion to rest2web
Brought to you by:
mjfoord
From: Michael F. <fuz...@vo...> - 2006-04-09 22:50:41
|
Gaël Varoquaux wrote: > On Sun, Apr 09, 2006 at 11:28:01PM +0100, Michael Foord wrote: > >>> You mean if the file keyword is "foo/bar" rest2web won't create a >>> foo subdirectory in the target directory and copy bar there ? If so then >>> I think it would be an interesting feature to add. >>> > > > >> I *don't* do this so that you can copy relative files into the target >> directory using the ``file`` keyword. >> > > Fare enough. You have a point. > > >> I think it would be easy enough to create a standard function that does >> this - so modifying the file keyword shouldn't be necessary. >> > > >> The full path to the page being generated is ``pagepath``. >> > > Well unless I am wrong this is the relative path from the root of > the web site. To be able to copy the file from the source tree to the > target tree I also need to know their roots. The root of the source tree > seems to be the current working dir of the script, that I can get with > os.getcwd(), but I have not found a way of accessing the root of the > target directory. > > >> You should find that ``os.path.dirname(pagepath)`` gives you the >> directory. Let me know how you get on with this. >> > > I get the source directory with : > fullpath=os.path.dirname(os.getcwd()+"/"+pagepath) > > If you know a way of finding out the target directory or the root of > the target tree from either functions.py or embedded code than I can > code a appropriate function. > > Ahh.... good point, you need the target directory as well. You can find this using ``Processor.target``, which is kind of a hack - but why I included access to the Processor object. What values would you like (they are very easy to add into the namespace) ? Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Cheers, > > Gaël > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > > |