shotgunsoftware / python-api

A Python-based library for accessing Flow Production Tracking API.
https://developer.shotgridsoftware.com/python-api
Other
308 stars 198 forks source link

SG-35529 Minor code refactoring: Clarify the use of _build_opener in download_attachment #343

Closed julien-lang closed 5 months ago

julien-lang commented 5 months ago

Clarify the use of _build_opener in download_attachment

Before this change, download_attachment indirectly used _build_opener by calling set_up_auth_cookie. This was misleading because the name of the function, set_up_auth_cookie, does not indicate that it will return a request handler object.

Since set_up_auth_cookie is only used by download_attachment, I suggest this small refactoring making download_attachment directly call _build_opener with an optional cookie handler if necessary.

This PR renames/transforms the set_up_auth_cookie function to get_auth_cookie_handler.