OAuth2Util/OAuth2Util.py
def set_access_credentials(self, _retry=0):
		"""
		Set the token on the Reddit Object again
		"""
		if _retry >= 5:
			raise ConnectionAbortedError('Reddit is not accessible right now, cannot refresh OAuth2 tokens.')

		self._check_token_present()

		try:
			self.r.set_access_credentials(self._get_value(CONFIGKEY_SCOPE, set, split_val=","),
										  self._get_value(CONFIGKEY_TOKEN),
										  self._get_value(CONFIGKEY_REFRESH_TOKEN))
		except (praw.errors.OAuthInvalidToken, praw.errors.HTTPException) as e:
			# todo check e status code
			# self._log('Retrying in 5s.')
			# time.sleep(5)
			# self.set_access_credentials(_retry=_retry + 1)

			self._log("Request new Token (SAC)")
			self._get_new_access_information()
def set_access_credentials(self, _retry=0):
		if _retry >= 5:
			raise ConnectionAbortedError('Reddit is not accessible right now, cannot refresh OAuth2 tokens.')

		self._check_token_present()

		try:
			self.r.set_access_credentials(self._get_value(CONFIGKEY_SCOPE, set, split_val=","),
										  self._get_value(CONFIGKEY_TOKEN),
										  self._get_value(CONFIGKEY_REFRESH_TOKEN))
		except (praw.errors.OAuthInvalidToken, praw.errors.HTTPException) as e:
			# todo check e status code
			# self._log('Retrying in 5s.')
			# time.sleep(5)
			# self.set_access_credentials(_retry=_retry + 1)

			self._log("Request new Token (SAC)")
			self._get_new_access_information()
def set_access_credentials ( self , _retry = 0 ) : if _retry >= 5 : raise ConnectionAbortedError ( 'Reddit is not accessible right now, cannot refresh OAuth2 tokens.' ) self . _check_token_present ( ) try : self . r . set_access_credentials ( self . _get_value ( CONFIGKEY_SCOPE , set , split_val = "," ) , self . _get_value ( CONFIGKEY_TOKEN ) , self . _get_value ( CONFIGKEY_REFRESH_TOKEN ) ) except ( praw . errors . OAuthInvalidToken , praw . errors . HTTPException ) as e : # todo check e status code # self._log('Retrying in 5s.') # time.sleep(5) # self.set_access_credentials(_retry=_retry + 1) self . _log ( "Request new Token (SAC)" ) self . _get_new_access_information ( )
Set the token on the Reddit Object again
Set the token on the Reddit Object again