PYTHONPATH=$DAQROOT/pythonLibs/nscldaq python3
import LogBook.LogBook as LogBook
...
book = LogBook.LogBook('logbookfile.log')
person = book.get_person(1)
shift = book.find_shift('Owl')
id = shift.id
name = shift.name
members = shift.members
shift.add_member(person)
shift.remove_member(person)
shift.set_current()
This class provides a wrapping for LogBook shifts. A shift is a
collection of people. Note that shifts are not directly comparable
via =. If, however, their id
attributes are the sam, they wrap the same shift.
LogBook.Shift objects have readonly attributes:
idThe primary key associated with the shift.
nameThe name of the shift.
members
Tuple of LogBook.Person objects that
represent the members of the shift.
LogBook.Person is described in
LogBook.Person
None add_member(LogBook.Person person);
Adds person to the shift.
None remove_member(LogBook.Person person);
Removes person from the shift.
None set_current();
Sets the shift to be the current shift. Run state changes logged after this will be logged as having occured when this shift was on-duty.