(data, pid)
return data
this *must* succeed adding the pdf
this *must* succeed adding the pdf
this * must * succeed adding the pdf
def do_compress(data, pid):
    """ this *must* succeed adding the pdf"""
    try:
        # compress
        data = pdf_compress(data)
    except:
        pass

    db = get_mongo('paper')
    db.update({'_id': pid}, {'$set': {'pdf': Binary(data)}} )
    log_info("Updated pdf {0}: size={1}".format(
        pid, parse_file_size(len(data))))
    return data
def do_compress ( data , pid ) : try : # compress data = pdf_compress ( data ) except : pass db = get_mongo ( 'paper' ) db . update ( { '_id' : pid } , { '$set' : { 'pdf' : Binary ( data ) } } ) log_info ( "Updated pdf {0}: size={1}" . format ( pid , parse_file_size ( len ( data ) ) ) ) return data