Re: [Rest2web-develop] Re: Enhancement suggestion to rest2web
Brought to you by:
mjfoord
From: Michael F. <fuz...@vo...> - 2006-04-22 22:21:33
|
Gaël Varoquaux wrote: > On Mon, Apr 10, 2006 at 12:03:26AM +0100, Michael Foord wrote: > >>> I'll write a function to copy file from the source tree to the >>> target tree that can be included in functions.py . I'll just wait until >>> tomorrow in order to have a clearer idea of what options/features might >>> be wanted for such function. >>> > > >>> Suggestions welcomed. >>> > > >> Ok. The file keyword isn't actually one I use (currently), I guess being >> able to specify a list of source files and a single target directory >> (relative to the current target directory I guess). >> > > OK, now that I am using Processor.target in my embedded scripts I > can do what I want. But it would be nicer to have a function for do > this. Something like : > > def add_file(source, targetdir=os.path.dirname(Processor.target+"/"+pagepath) > I *haven't* yet added the target path to the standard namespace. I will do this very soon. I have however made the namespace (and the 'uservalues') accessible to the functions (both as dictionaries). > Where source could be either a string or a tuple of strings. > > Trying to implement this I realize I do not know how to access > pagepath or Processor in functions.py . Maybe it would be nice if the > namespace accessible to the embedded functions was also accessible in > functions.py (note that I have no clue how to code this). > > On a side note: it might be a good idea to have a config entry in > the config file to add a user file where he could define his functions > without modifying functions.py . For large project it could prove > usefull. > Hmm... I'll think about the best way of doing this. Currently you can import whatever you want at the start of the templates, but maybe a way to specify a list of modules to automatically import would be good too. Fuzzyman http://www.vidspace.org.uk/python/index.shtml > Regards, > > 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 > > |