Re: [Rest2web-develop] Re: Enhancement suggestion to rest2web
Brought to you by:
mjfoord
From: V. <gae...@no...> - 2006-04-09 22:38:18
|
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 th= en > >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=20 > 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= =20 > 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=20 > directory. Let me know how you get on with this. I get the source directory with : fullpath=3Dos.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. Cheers, Ga=EBl |