There is a global variable blob. The old code set it. This code needs to do:

 blob = activityData.blob
 open(blob)

so that it sets the global variable.