def get_dico(idDictionary): current_session, current_header = con_serv.authentification() basic_get_response = current_session.get(url=dictionary_url+idDictionary, headers=current_header) if basic_get_response.ok: j_data = json.loads(basic_get_response.content.decode('utf-8')) else: # If response code is not ok (200), print the resulting http error code with description return mockDico() return j_data
def create_raw_data_url(msg): # check si le rawdata existe, créer ou mettre à jour envoyer à Coli le rawdata current_session, current_header = con_serv.authentification() raw_serv.rawdatas_from_url(msg, current_session, current_header)
def create_location(locationName, locationType, locationCoordinates): loc = location(locationName, locationType, locationCoordinates) current_session, current_header = con_serv.authentification() location_id = location_serv.create_dto_location(loc, current_session, current_header) con_serv.close_connection(current_session) return location_id
def link_picture_to_bio(json_picture, id_bio, rawdata_url_name): current_session, current_header = con_serv.authentification() raw_serv.rawdatas_from_ggimage(json_picture, id_bio, rawdata_url_name, current_session, current_header)
def link_media_to_bio(json_picture, bio_id): current_session, current_header = con_serv.authentification() raw_serv.rawdatas_from_media(json_picture, bio_id, current_session, current_header)
def link_tweet_to_bio(json_tweet, id_bio): current_session, current_header = con_serv.authentification() raw_serv.rawdatas_from_tweet(json_tweet, id_bio, current_session, current_header)
def bind_idbio_to_idbio(candidate_bioId, bioId_to_bind): current_session, current_header = con_serv.authentification() rel_serv.bind_object_to_object(candidate_bioId, bioId_to_bind, Entities.Biographics, Entities.Rawdata, current_session, current_header)
def create_new_biographics(first_name, name, picture, picture_type): bio = biographics(first_name, name, picture, picture_type) current_session, current_header = con_serv.authentification() bio_id = bio_serv.create_dto_biographic(bio, current_session, current_header) con_serv.close_connection(current_session) return bio_id