Newbie question about chaining deffereds

Igor Katson <[email protected]>
Newsgroups gmane.comp.python.twisted.web
Message-ID <[email protected]>
Hello,

I need to download a videofile, a thumbnail to it, process that 
videofile, and after the processing is finished, process the thumbnail 
with the result of processing the video.

I do this, but it the logic (or the order) is wrong, so it does not 
work, it freezes after processing the video, while it downloads both of 
the files:

url = 'http://..../video.flv'
filename = 'video.flv'
video_deffered = downloadPage(url, filename)
video_deffered.addCallback(process_video, filename) => process_video 
returns video_id

url = 'http://..../thumbnail.jpg'
filename = 'thumbnail.jpg'
image_deffered = downloadPage(url, filename)

image_deffered.chainDeffered(video_deffered)
image_deffered.addCallback(process_image, filename) =< video_id needed here

What should I change for it to work?
And also I need to make process_video and process_image work in threads, 
but I can't figure out how to solve this problem first.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.