From: deelan <de...@in...> - 2003-07-17 14:16:25
|
hi there, i'm writing a simple blog system with python to learn the language and the webware framework. i've figured out most of the basic things, and now i'm moving to more advanced stuff. i was wondering what is the best way to include static contents in a webware servlet. consider this situation: tipically a blog sidebar contains a list of things that do not need to get updated frequently (blog rolls wih a "last updated" date, a calendar, recent photos--just to name a few). i thought to update this things on a, say, daily basis via taskkit. a tipical blog roll (example here: http://simon.incutio.com/) generation task would be: * read a db table and fetch a service like weblogs.com with a list of blogs of interest * parse weblogs.com output and build an HTML <ul> list with blog title and "last updated" value * write HTML snippet to disk so, at every page request webware just include such static HTML list in the servlet output instead to compute a possibly lengthly operation. i've seen that Page has an includeURL() method, where URL is the URL for another servlet, not a file. correct? of course i could add something like to my WeblogPage object: def includeFile(self, fname) included = file(fname, 'r') s = included.read() return s to include an arbitrary file, but i would like to known how you would solve this problem. thanks in advance. later, deelan PS: from the taskkit docs it's not clear to me how to specify frequency for a task (say twice a day), once a week and so on. |