def get_paper_status(bibref): ''' Finds an returns the status of a bibrec to person assignment @param bibref: the bibref-bibrec pair that unambiguously identifies a paper @type bibref: string ''' db_data = tu.get_papers_status([[bibref]]) #data,PersonID,flag status = None try: status = db_data[0][2] except IndexError: status = -10 status = wash_integer_id(status) return status
def get_person_id_from_paper(bibref=None): ''' Returns the id of the person who wrote the paper @param bibref: the bibref,bibrec pair that identifies the person @type bibref: str @return: the person id @rtype: int ''' if not is_valid_bibref(bibref): return - 1 person_id = -1 db_data = tu.get_papers_status([(bibref,)]) try: person_id = db_data[0][1] except (IndexError): pass return person_id