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)
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)
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)