コード例 #1
0
ファイル: imagepublish.py プロジェクト: SRI-CSL/ENCODERS
def publishImage(hagglehandle, imagepath,fileowner,count):
    logger.info("creating and publishing dataobject")
    logger.info("creating dataobject")
    dataobject = haggle.haggle_dataobject_new_from_file(imagepath)
    #logger.info("adding attributes. created dataobject=",dataobject)
    haggle.haggle_dataobject_add_attribute(dataobject, "FileOwner", fileowner)
    haggle.haggle_dataobject_add_attribute(dataobject, "Count", str(count))
    logger.info("publilshing")
    haggle.haggle_ipc_publish_dataobject(hagglehandle, dataobject)        
コード例 #2
0
def publishImage(hagglehandle, imagepath, fileowner, count):
    logger.info("creating and publishing dataobject")
    logger.info("creating dataobject")
    dataobject = haggle.haggle_dataobject_new_from_file(imagepath)
    #logger.info("adding attributes. created dataobject=",dataobject)
    haggle.haggle_dataobject_add_attribute(dataobject, "FileOwner", fileowner)
    haggle.haggle_dataobject_add_attribute(dataobject, "Count", str(count))
    logger.info("publilshing")
    haggle.haggle_ipc_publish_dataobject(hagglehandle, dataobject)
コード例 #3
0
ファイル: filegen.py プロジェクト: marciopocebon/ENCODERS
def publishDataObjectFromString(hagglehandle, content,fileowner,count):
    print "creating and publishing dataobject"
    print "creating dataobject"
    dataobject = haggle.haggle_dataobject_new_from_buffer(content,content.__len__())
    print "adding attributes. created dataobject=",dataobject
    haggle.haggle_dataobject_add_attribute(dataobject, "FileOwner", fileowner)
    haggle.haggle_dataobject_add_attribute(dataobject, "Count", str(count))
    haggle.haggle_dataobject_set_flags(dataobject, haggle.DATAOBJECT_FLAG_PERSISTENT)
    haggle.haggle_ipc_publish_dataobject(hagglehandle, dataobject)