def add_event_to_premis_record(path_to_record, new_event): the_record = PremisRecord(frompath=path_to_record) the_record.add_event(new_event) print(path_to_record) print(the_record) the_record.write_to_file(path_to_record) return True
def make_record(file_path, original_name=None): """ build a PremisNode.Object from a file and use it to instantiate a record __Args__ 1. file_path (str): The full path to a file 2. item (LDRItem): The LDRItem representative of the file contents __Returns__ 1. (PremisRecord): The populated record instance """ obj = _make_object(file_path, original_name) rec = PremisRecord(objects=[obj]) rec.add_event(_make_event()) _link_obj_and_event(rec) return rec