def read_config(self, option): if self.config_filename is None: self.config_filename = self.generate_config_filename() parser = ConfigParser() parser.read(self.config_filename) try: option = parser.get(section='auth', option=option) except NoSectionError: raise AMaaSException('Invalid AMaaS config file') return option
def patch(self, url, data=None, **kwargs): # Add a refresh if self.last_authenticated and not self.needs_refresh(): return self.session.patch(url=url, data=data, **kwargs) else: raise AMaaSException('Not Authenticated')
def get(self, url, **kwargs): # Add a refresh if self.last_authenticated and not self.needs_refresh(): return self.session.get(url=url, **kwargs) else: raise AMaaSException('Not Authenticated')