How to prevent a shared document from downloading more than once?

James Simmons jim.simmons at
Mon Mar 16 11:29:52 EDT 2009

It looks like my last naive question about collaboration started a 
discussion so notable that Walter Bender wrote about it in his blog  Let's see what you can do with this one.

Both my Activities, Read ETexts and View Slides, have document sharing 
code mostly copied from the core Read activity.  Currently this works 
just fine in both Activities, with only one problem.  Suppose someone 
shares a document with me, I receive it successfully, then quit, causing 
the copied document to be saved in my Journal.  Now if the original user 
stops sharing (closes his copy of the Activity) and I resume mine I get 
my stored copy and all is wonderful.  But suppose the original user 
*doesn't* stop sharing.  I resume my copy, see the stored copy on the 
screen, but I *still* download the document my friend is sharing.  I 
don't want to do that.  It wastes bandwidth and time and causes *keep* 
errors when you close the document.

Now the problem is, the sharing code is in the __init__() method, which 
always runs before anything else, and the read_file() method, which runs 
when you resume from the Journal, unfortunately *after* the Activity has 
already decided it needs to download the file.  I need a way for the 
__init__ method to realize that it doesn't need to download the file, or 
some other way to deal with the problem.


James Simmons

More information about the Devel mailing list