-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api_config: avoid duplicating initialization state logic
Currently the api_config.py is used as both a module containing methods as well as defining a class that, until recently, was used to obtain values from the class attributes instead of some instance state. To avoid global state and reduce logic duplication, specifically read_key(), move the module methods to class methods. The ApiConfig should be convenient on instantiation and should try to set some sane initial state. While we're at it reduce file stat(3) reading when calling get_config_from_kwargs(). Return default api config instead of creating new objects for every call an authorized session instance makes. Signed-off-by: Jamie Couture <[email protected]>
- Loading branch information
1 parent
e87eee2
commit 1066b01
Showing
5 changed files
with
140 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.