(self, invalid_sources=None)
Uses the GitHub API to construct necessary info for a package

        :param invalid_sources:
            A list of URLs that should be ignored

        :raises:
            DownloaderException: when there is an issue download package info
            ClientException: when there is an issue parsing package info

        :return:
            A generator of
            (
                'Package Name',
                {
                    'name': name,
                    'description': description,
                    'author': author,
                    'homepage': homepage,
                    'last_modified': last modified date,
                    'download': {
                        'url': url,
                        'date': date,
                        'version': version
                    },
                    'previous_names': [],
                    'labels': [],
                    'sources': [the repo URL],
                    'readme': url,
                    'issues': url,
                    'donate': url,
                    'buy': None
                }
            )
            tuples
Uses the GitHub API to construct necessary info for a package
Uses the GitHub API to construct necessary info for a package
def get_packages(self, invalid_sources=None):
        """
        Uses the GitHub API to construct necessary info for a package

        :param invalid_sources:
            A list of URLs that should be ignored

        :raises:
            DownloaderException: when there is an issue download package info
            ClientException: when there is an issue parsing package info

        :return:
            A generator of
            (
                'Package Name',
                {
                    'name': name,
                    'description': description,
                    'author': author,
                    'homepage': homepage,
                    'last_modified': last modified date,
                    'download': {
                        'url': url,
                        'date': date,
                        'version': version
                    },
                    'previous_names': [],
                    'labels': [],
                    'sources': [the repo URL],
                    'readme': url,
                    'issues': url,
                    'donate': url,
                    'buy': None
                }
            )
            tuples
        """

        if 'get_packages' in self.cache:
            for key, value in self.cache['get_packages'].items():
                yield (key, value)
            return

        client = GitHubClient(self.settings)

        if invalid_sources != None and self.repo in invalid_sources:
            raise StopIteration()

        try:
            repo_info = client.repo_info(self.repo)
            download = client.download_info(self.repo)

            name = repo_info['name']
            details = {
                'name': name,
                'description': repo_info['description'],
                'homepage': repo_info['homepage'],
                'author': repo_info['author'],
                'last_modified': download.get('date'),
                'download': download,
                'previous_names': [],
                'labels': [],
                'sources': [self.repo],
                'readme': repo_info['readme'],
                'issues': repo_info['issues'],
                'donate': repo_info['donate'],
                'buy': None
            }
            self.cache['get_packages'] = {name: details}
            yield (name, details)

        except (DownloaderException, ClientException, ProviderException) as e:
            self.failed_sources[self.repo] = e
            self.cache['get_packages'] = {}
            raise StopIteration()
def get_packages ( self , invalid_sources = None ) : if 'get_packages' in self . cache : for key , value in self . cache [ 'get_packages' ] . items ( ) : yield ( key , value ) return client = GitHubClient ( self . settings ) if invalid_sources != None and self . repo in invalid_sources : raise StopIteration ( ) try : repo_info = client . repo_info ( self . repo ) download = client . download_info ( self . repo ) name = repo_info [ 'name' ] details = { 'name' : name , 'description' : repo_info [ 'description' ] , 'homepage' : repo_info [ 'homepage' ] , 'author' : repo_info [ 'author' ] , 'last_modified' : download . get ( 'date' ) , 'download' : download , 'previous_names' : [ ] , 'labels' : [ ] , 'sources' : [ self . repo ] , 'readme' : repo_info [ 'readme' ] , 'issues' : repo_info [ 'issues' ] , 'donate' : repo_info [ 'donate' ] , 'buy' : None } self . cache [ 'get_packages' ] = { name : details } yield ( name , details ) except ( DownloaderException , ClientException , ProviderException ) as e : self . failed_sources [ self . repo ] = e self . cache [ 'get_packages' ] = { } raise StopIteration ( )