Skip to content

Commit

Permalink
docs: add method comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pthompson127 committed Jun 12, 2020
1 parent 0734e0f commit c1afef2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion optimizely/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def start(self):


class AuthDatafilePollingConfigManager(PollingConfigManager):
""" Config manager that polls for authenticated datafile based on access token. """
""" Config manager that polls for authenticated datafile using access token. """

def __init__(
self,
Expand All @@ -390,16 +390,19 @@ def __init__(
super(AuthDatafilePollingConfigManager, self).__init__(**kwargs)

def _set_url_template(self, kwargs):
""" Helper method to set url template depending on kwargs input. """
if 'url_template' not in kwargs or kwargs['url_template'] is None:
kwargs['url_template'] = enums.ConfigManager.AUTHENTICATED_DATAFILE_URL_TEMPLATE

def _set_access_token(self, access_token):
""" Checks for valid access token input and sets it. """
if not access_token:
raise optimizely_exceptions.InvalidInputException(
'access_token cannot be empty or None.')
self.access_token = access_token

def fetch_datafile(self):
""" Fetch authenticated datafile and set ProjectConfig. """
request_headers = {}
request_headers[enums.HTTPHeaders.AUTHORIZATION] = \
enums.ConfigManager.AUTHORIZATION_HEADER_DATA_TEMPLATE.format(access_token=self.access_token)
Expand Down

0 comments on commit c1afef2

Please sign in to comment.