Nicolas Lehuen
nicolas.lehuen at gmail.com
Mon May 30 18:31:32 EDT 2005
Hi Berry, First check whether this is really due to the way you call your page. Don't parse the page, just call urllib2.urlopen and see what happens. Regards, Nicolas 2005/5/30, berry groenendijk <berry.groenendijk at gmail.com>: > Hi! > > Strictly speaking this is not a mod_python question. Please accept my > apologies. Still I hope somebody can give me some hints. > > I am using mod_python 3.1.3 with mod_python servlets. I am experimenting > with a REST-style interface to my website. > > This is the situation. Page A in my website returns a RSS XML file. I want > to use this output on page B in the same website. To present page B to the > user I do a little server side conversion to HTML. The problem is: this is > very slow! My guess is that it has to do with the way I call page A. > > Here is part of the code of page B: > > > import os > import urllib > from cElementTree import iterparse > > import _SitePage as sitepage > import _Config as config > > class keywordshtml2(sitepage.SitePage): > > def write_content(self): > > url_keywords = "http://%s/keywords" % self.req.hostname > > self.writeln('<h1>List of articles by keyword</h1>') > self.writeln("<p>Available keywords:") > for event, elem in iterparse(urllib.urlopen(url_keywords)): > if elem.tag == "item": > self.writeln("<a href='#%(x)s'>%(x)s</a>, " % ({'x': > elem.findtext("title")})) > elem.clear() > self.writeln("</p>") > > Is there a better way to call page A from within page B? > > -- > Berry Groenendijk > http://www.bersie.de > > _______________________________________________ > Mod_python mailing list > Mod_python at modpython.org > http://mailman.modpython.org/mailman/listinfo/mod_python > > >
|