Skip to content

Provide explicit attachment capability to an event.

Philip Elson requested to merge pelson/pylogbook:event_attachment into develop

@bbielaws - this one is for your consideration. I don't propose to be able to do both the existing Event.add_attachment as well as the Event.attach_file(...) and Event.attach_contents, so please only merge if you are happy with the implication that:

lb = pylogbook.Logbook(
    pylogbook.Activity.LHC,
)
lb.add_event(
    'my event',
    attachments=pylogbook.AttachmentBuilder.from_file('filename.png')
)

Would be replaced with:

lb = pylogbook.Logbook(
    pylogbook.Activity.LHC,
)
event = lb.add_event('my event')
event.attach_file('filename.png')

And that the AttachmentBuilder class would become private.

Merge request reports