On 2006-02-01, at 17:06, Karl Guertin wrote:
On 2/1/06, staszek <[EMAIL PROTECTED]> wrote:Thanks for your answer. I was thinking about similar solution, but with using session dictionary instead of global variable. As I understand session data is stored on server side. What do you think about this ?
And now the question: how to display generated image map? It have to be
generated by modomicsObject.draw because creation of image and image
map are parallel processes.
You need to make the call to modomicsObject.draw in showpathway (which
I assume is where you're generating the html from the page) in order
to output the imagemap as part of the page. You then need to hold onto
the image and return it when showpathwayimage is called. How you
should do that is the tricky part and depends on your app. The simple
way would be to have a global dict. You stick the image in the dict
with mod as the key. If you have a bunch of mods and memory would be a
problem, you either need to delete the key from the dict as part of
showpathwayimage or figure out a real caching strategy.
Correct me if I'm wrong: global variable (dictionary in this case) would be shared between all active and expired sessions, so it could be used as a kind of cache of generated images?
SDH

