Extend ActivitiesClient
In working on the LogbookButton I would have a few improvements to the ActivitiesClient
to make it usable for this use case.
- It should be possible to change the activity.
- There should be a way to get a list of activities associated with the instance in a consistent format (for example as a list of
Activity
objects) regardless of what is passed in (int
/str
/NamedActivity
/etc). - A few methods of
Client
are missing fromActivitiesClient
. For consistency I would include these too.
The difficulty of point 2 is that, combined with #2 (closed), if the RBAC token is invalid then it is not possible to lookup the Activity
objects. I wrote a quick wrapper class which works around this:
https://gitlab.cern.ch/tlevens/accwidgets-logbook/-/blob/master/accwidgets/logbook/_model.py
Not sure if there is a better way...