5 """Script to rename the session (first session if multiple and not specified)"""
9 if session_name
is not None:
11 session = db.get_dal(
"Session",session_name)
13 print(f
"Error could not find Session {session_name} in file {oksfile}")
16 sessions = db.get_dals(
"Session")
18 print(f
"Error in {oksfile}: no sessions found.")
21 print(f
"{oksfile} found {len(sessions)}. Will change name of first ({sessions[0].id})")
24 new_session = copy.copy(session)
25 setattr(new_session,
"id",output_name)
27 db.add_dal(new_session)
28 db.destroy_dal(session)