(self)
Read the README content from remote awesome repository
Read the README content from remote awesome repository
Read the README content from remote awesome repository
def read_readme(self):
        """Read the README content from remote awesome repository"""
        if self.is_cached() and not self.force_request:
            print('Fetching the README from cache...')
            readme = self.from_cache()
            print('Done.')
            return readme
        print('Fetching the README from awesome place ...')
        response = requests.get(self.AWESOME_README_URL)
        print('Done.')
        if response.status_code == 200:
            readme = response.content.decode('utf8')
            self.cache(readme)
            return readme
        raise requests.RequestException('Error occurs when getting the README from {}'.format(self.AWESOME_README_URL))
def read_readme ( self ) : if self . is_cached ( ) and not self . force_request : print ( 'Fetching the README from cache...' ) readme = self . from_cache ( ) print ( 'Done.' ) return readme print ( 'Fetching the README from awesome place ...' ) response = requests . get ( self . AWESOME_README_URL ) print ( 'Done.' ) if response . status_code == 200 : readme = response . content . decode ( 'utf8' ) self . cache ( readme ) return readme raise requests . RequestException ( 'Error occurs when getting the README from {}' . format ( self . AWESOME_README_URL ) )