Beispiel #1
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)        
Beispiel #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)
Beispiel #3
0
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)